fix(ui): safe areas, centered top hub, compact settings sheet
This commit is contained in:
1 parent
c6a86d74d9
commit
5402541f59
7 files changed
+95
-58
No files matched your search
+19
-15
@@ -14,8 +14,8 @@ func _ready() -> void:
|
||||
margin.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
margin.add_theme_constant_override("margin_left", UI.MARGIN)
|
||||
margin.add_theme_constant_override("margin_right", UI.MARGIN)
|
||||
margin.add_theme_constant_override("margin_top", 12)
|
||||
margin.add_theme_constant_override("margin_bottom", 14)
|
||||
margin.add_theme_constant_override("margin_top", UI.safe_top())
|
||||
margin.add_theme_constant_override("margin_bottom", UI.safe_bottom())
|
||||
add_child(margin)
|
||||
|
||||
var column := VBoxContainer.new()
|
||||
@@ -23,7 +23,7 @@ func _ready() -> void:
|
||||
margin.add_child(column)
|
||||
|
||||
var hub := HBoxContainer.new()
|
||||
hub.add_theme_constant_override("separation", 8)
|
||||
hub.add_theme_constant_override("separation", 0)
|
||||
column.add_child(hub)
|
||||
|
||||
var avatar := Button.new()
|
||||
@@ -31,30 +31,34 @@ func _ready() -> void:
|
||||
avatar.flat = true
|
||||
avatar.icon = load("res://art/crumb_head.png")
|
||||
avatar.expand_icon = true
|
||||
avatar.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
avatar.alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
avatar.tooltip_text = "Guest Book"
|
||||
avatar.pressed.connect(func() -> void: guest_book_pressed.emit())
|
||||
hub.add_child(avatar)
|
||||
|
||||
var left_space := Control.new()
|
||||
left_space.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
left_space.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
hub.add_child(left_space)
|
||||
var left := CenterContainer.new()
|
||||
left.custom_minimum_size = Vector2(52, 52)
|
||||
left.add_child(avatar)
|
||||
hub.add_child(left)
|
||||
|
||||
var center := CenterContainer.new()
|
||||
center.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
hub.add_child(center)
|
||||
|
||||
progress_pill = UI.button("5 / 25 guests", false, 38)
|
||||
progress_pill.custom_minimum_size = Vector2(130, 38)
|
||||
progress_pill.add_theme_font_size_override("font_size", 13)
|
||||
progress_pill.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
||||
progress_pill.pressed.connect(func() -> void: guest_book_pressed.emit())
|
||||
hub.add_child(progress_pill)
|
||||
|
||||
var right_space := Control.new()
|
||||
right_space.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
right_space.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
hub.add_child(right_space)
|
||||
center.add_child(progress_pill)
|
||||
|
||||
var settings := UI.round_button("res://assets/icons/settings.svg", 48)
|
||||
settings.tooltip_text = "Settings"
|
||||
settings.pressed.connect(func() -> void: settings_pressed.emit())
|
||||
hub.add_child(settings)
|
||||
var right := CenterContainer.new()
|
||||
right.custom_minimum_size = Vector2(52, 52)
|
||||
right.add_child(settings)
|
||||
hub.add_child(right)
|
||||
|
||||
column.add_child(UI.spacer(4))
|
||||
column.add_child(UI.heading("Ratdoku", 46))
|
||||
|
||||
Reference in new issue
Block a user