mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 13:52:34 +00:00
Compare commits
3 Commits
v0.7.0
...
2d2a4e0733
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d2a4e0733 | |||
| d61785c98a | |||
| 07fdf0055e |
@@ -30,4 +30,4 @@ DEPENDENCIES
|
|||||||
releasy
|
releasy
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.3.17
|
2.4.3
|
||||||
|
|||||||
@@ -640,6 +640,8 @@ module TAC
|
|||||||
def update
|
def update
|
||||||
super
|
super
|
||||||
|
|
||||||
|
current_state.request_repaint unless @highlight_animator.complete?
|
||||||
|
|
||||||
while (hash = @scroll_into_view_list.shift)
|
while (hash = @scroll_into_view_list.shift)
|
||||||
list_container = hash[:list]
|
list_container = hash[:list]
|
||||||
item_container = hash[:item]
|
item_container = hash[:item]
|
||||||
|
|||||||
@@ -59,30 +59,36 @@ module TAC
|
|||||||
def populate_action_presets
|
def populate_action_presets
|
||||||
@action_presets.clear do
|
@action_presets.clear do
|
||||||
window.backend.config.presets.actions.each_with_index do |action, i|
|
window.backend.config.presets.actions.each_with_index do |action, i|
|
||||||
flow(width: 1.0, height: 36, **THEME_ITEM_CONTAINER_PADDING) do
|
stack(width: 1.0, height: action.comment.empty? ? 36 : 72, **THEME_ITEM_CONTAINER_PADDING) do
|
||||||
background i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
background i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||||
|
|
||||||
button action.name, fill: true, text_size: THEME_ICON_SIZE - 3 do
|
flow(width: 1.0, height: 36) do
|
||||||
page(TAC::Pages::Editor, { action: action, action_is_preset: true })
|
button action.name, fill: true, text_size: THEME_ICON_SIZE - 3 do
|
||||||
|
page(TAC::Pages::Editor, { action: action, action_is_preset: true })
|
||||||
|
end
|
||||||
|
|
||||||
|
button get_image("#{TAC::ROOT_PATH}/media/icons/gear.png"), image_width: THEME_ICON_SIZE, tip: "Edit action preset" do
|
||||||
|
push_state(
|
||||||
|
Dialog::ActionDialog,
|
||||||
|
title: "Edit Action Preset",
|
||||||
|
action: action,
|
||||||
|
list: window.backend.config.presets.actions,
|
||||||
|
callback_method: method(:update_action_preset)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: THEME_ICON_SIZE, tip: "Delete action preset", **THEME_DANGER_BUTTON do
|
||||||
|
push_state(
|
||||||
|
Dialog::ConfirmDialog,
|
||||||
|
title: "Are you sure?",
|
||||||
|
message: "Delete action preset and all of its actions and variables?",
|
||||||
|
callback_method: proc { delete_action_preset(action) }
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
button get_image("#{TAC::ROOT_PATH}/media/icons/gear.png"), image_width: THEME_ICON_SIZE, tip: "Edit action preset" do
|
stack(width: 1.0, fill: true, scroll: true, visible: !action.comment.empty?, tag: "comment_container") do
|
||||||
push_state(
|
caption action.comment.to_s, width: 1.0, text_wrap: :word_wrap, text_border: true, text_border_size: 1, text_border_color: 0xaa_000000, tag: "comment"
|
||||||
Dialog::NamePromptDialog,
|
|
||||||
title: "Rename Action Preset",
|
|
||||||
renaming: action,
|
|
||||||
list: window.backend.config.presets.actions,
|
|
||||||
callback_method: method(:update_action_preset)
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: THEME_ICON_SIZE, tip: "Delete action preset", **THEME_DANGER_BUTTON do
|
|
||||||
push_state(
|
|
||||||
Dialog::ConfirmDialog,
|
|
||||||
title: "Are you sure?",
|
|
||||||
message: "Delete action preset and all of its actions and variables?",
|
|
||||||
callback_method: proc { delete_action_preset(action) }
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -105,8 +111,9 @@ module TAC
|
|||||||
populate_group_presets
|
populate_group_presets
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_action_preset(action, name)
|
def update_action_preset(action, name, comment)
|
||||||
action.name = name
|
action.name = name
|
||||||
|
action.comment = comment
|
||||||
window.backend.config.presets.actions.sort_by! { |a| a.name.downcase }
|
window.backend.config.presets.actions.sort_by! { |a| a.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
@@ -122,4 +129,4 @@ module TAC
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user