mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 21:32:35 +00:00
Fixed confirm dialog not able to commit
This commit is contained in:
@@ -2,7 +2,11 @@ module TAC
|
||||
class Dialog
|
||||
class ConfirmDialog < Dialog
|
||||
def build
|
||||
color = @options[:dangerous] ? Palette::DANGEROUS : Palette::ALERT
|
||||
@dangerous = @options[:dangerous]
|
||||
@dangerous ||= false
|
||||
|
||||
color = @dangerous ? Palette::DANGEROUS : Palette::ALERT
|
||||
|
||||
|
||||
@dialog_root.style.border_color = [ color, darken(color, 50) ]
|
||||
@titlebar.style.background = [ color, darken(color, 50) ]
|
||||
@@ -21,7 +25,11 @@ module TAC
|
||||
end
|
||||
|
||||
def try_commit(force = false)
|
||||
if not @options[:dangerous] || force
|
||||
if !@dangerous
|
||||
close
|
||||
|
||||
@options[:callback_method].call
|
||||
elsif @dangerous && force
|
||||
close
|
||||
|
||||
@options[:callback_method].call
|
||||
|
||||
Reference in New Issue
Block a user