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:
2021-02-10 22:21:53 -06:00
parent 9999026969
commit 3cc4c204a7
12 changed files with 94 additions and 44 deletions

View File

@@ -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