mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 05:42:35 +00:00
Allow edited action to keep its name when editing it (fixes: #1), made dialogs respond to enter and escape, Confirm dialog now shows dark red color for dangerous operations and prevents enter for accepting it
This commit is contained in:
@@ -2,8 +2,10 @@ module TAC
|
||||
class Dialog
|
||||
class ConfirmDialog < Dialog
|
||||
def build
|
||||
@dialog_root.style.border_color = [ Palette::ALERT, darken(Palette::ALERT, 50) ]
|
||||
@titlebar.style.background = [ Palette::ALERT, darken(Palette::ALERT, 50) ]
|
||||
color = @options[:dangerous] ? Palette::DANGEROUS : Palette::ALERT
|
||||
|
||||
@dialog_root.style.border_color = [ color, darken(color, 50) ]
|
||||
@titlebar.style.background = [ color, darken(color, 50) ]
|
||||
|
||||
background Gosu::Color::GRAY
|
||||
label @options[:message]
|
||||
@@ -12,7 +14,14 @@ module TAC
|
||||
button "Cancel", width: 0.475 do
|
||||
close
|
||||
end
|
||||
|
||||
button "Proceed", width: 0.475, **TAC::THEME_DANGER_BUTTON do
|
||||
try_commit(true)
|
||||
end
|
||||
end
|
||||
|
||||
def try_commit(force = false)
|
||||
if not @options[:dangerous] || force
|
||||
close
|
||||
|
||||
@options[:callback_method].call
|
||||
|
||||
Reference in New Issue
Block a user