mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 13:52:34 +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:
@@ -23,20 +23,23 @@ module TAC
|
||||
accept_label = @options[:accept_label] if @options[:accept_label]
|
||||
|
||||
button accept_label, width: 0.475 do
|
||||
unless valid?
|
||||
else
|
||||
if @options[:renaming]
|
||||
@options[:callback_method].call(@options[:renaming], @name.value.strip)
|
||||
else
|
||||
@options[:callback_method].call(@name.value.strip)
|
||||
end
|
||||
|
||||
close
|
||||
end
|
||||
try_commit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def try_commit
|
||||
if valid?
|
||||
if @options[:renaming]
|
||||
@options[:callback_method].call(@options[:renaming], @name.value.strip)
|
||||
else
|
||||
@options[:callback_method].call(@name.value.strip)
|
||||
end
|
||||
|
||||
close
|
||||
end
|
||||
end
|
||||
|
||||
def valid?
|
||||
name = @name.value.strip
|
||||
|
||||
|
||||
Reference in New Issue
Block a user