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