mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 21:32:35 +00:00
Config is now saved and synced when updated
This commit is contained in:
14
lib/dialogs/alert_dialog.rb
Normal file
14
lib/dialogs/alert_dialog.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
module TAC
|
||||
class Dialog
|
||||
class AlertDialog < Dialog
|
||||
def build
|
||||
background Gosu::Color::GRAY
|
||||
label @options[:message], text_size: 18
|
||||
|
||||
button "Close", width: 1.0, text_size: 18 do
|
||||
close
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3,20 +3,24 @@ module TAC
|
||||
class NamePromptDialog < Dialog
|
||||
def build
|
||||
background Gosu::Color::GRAY
|
||||
label @options[:subtitle]
|
||||
|
||||
flow width: 1.0 do
|
||||
label "Name", width: 0.25
|
||||
edit_line "", width: 0.70
|
||||
label "Name", width: 0.25, text_size: 18
|
||||
@name = edit_line "", width: 0.70, text_size: 18
|
||||
end
|
||||
|
||||
flow width: 1.0 do
|
||||
button "Cancel", width: 0.475 do
|
||||
button "Cancel", width: 0.475, text_size: 18 do
|
||||
close
|
||||
end
|
||||
|
||||
button @options[:submit_label], width: 0.475 do
|
||||
@options[:callback].call(self)
|
||||
button @options[:submit_label], width: 0.475, text_size: 18 do
|
||||
if @name.value.strip.empty?
|
||||
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Name cannot be blank.\nName cannot only be whitespace.")
|
||||
else
|
||||
@options[:callback_method].call(@name.value.strip)
|
||||
|
||||
close
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user