Dialog's no longer need a fixed height, misc. dialog tweaks.

This commit is contained in:
2020-09-09 09:52:44 -05:00
parent b811a83c60
commit df0d0df223
9 changed files with 42 additions and 35 deletions

View File

@@ -5,18 +5,16 @@ module TAC
def build
background Gosu::Color::GRAY
flow width: 1.0 do
label "Name", width: 0.25
@name = edit_line @options[:renaming] ? @options[:renaming].name : "", filter: method(:filter), width: 0.70
end
label "Name", width: 1.0, text_align: :center
@name_error = label "", color: TAC::Palette::TACNET_CONNECTION_ERROR
@name_error.hide
@name = edit_line @options[:renaming] ? @options[:renaming].name : "", filter: method(:name_filter), width: 1.0
@name.subscribe(:changed) do |sender, value|
valid?
end
flow width: 1.0 do
flow width: 1.0, margin_top: THEME_DIALOG_BUTTON_PADDING do
button "Cancel", width: 0.475 do
close
end
@@ -67,10 +65,6 @@ module TAC
return true
end
end
def filter(text)
text.match(/[A-Za-z0-9._\- ]/) ? text : ""
end
end
end
end