Dock the question toolbar in line with the brand row
The toolbar had followed the progress group down into the row below the branding after it moved there - readers expect actions docked to the top brand row, not hanging off the question count.
This commit is contained in:
@@ -102,6 +102,7 @@ var theme_button: Button
|
|||||||
var question_toolbar: HFlowContainer
|
var question_toolbar: HFlowContainer
|
||||||
var header_stack: VBoxContainer
|
var header_stack: VBoxContainer
|
||||||
var header_row: HBoxContainer
|
var header_row: HBoxContainer
|
||||||
|
var header_brand: HBoxContainer
|
||||||
var header_toolbar_host: HBoxContainer
|
var header_toolbar_host: HBoxContainer
|
||||||
var nav_palette: GridContainer
|
var nav_palette: GridContainer
|
||||||
var navigator_popup: PopupPanel
|
var navigator_popup: PopupPanel
|
||||||
@@ -222,7 +223,7 @@ func _ready() -> void:
|
|||||||
header_stack.add_theme_constant_override("separation", 8)
|
header_stack.add_theme_constant_override("separation", 8)
|
||||||
card_content.add_child(header_stack)
|
card_content.add_child(header_stack)
|
||||||
|
|
||||||
var header_brand := HBoxContainer.new()
|
header_brand = HBoxContainer.new()
|
||||||
header_brand.add_theme_constant_override("separation", 8)
|
header_brand.add_theme_constant_override("separation", 8)
|
||||||
header_stack.add_child(header_brand)
|
header_stack.add_child(header_brand)
|
||||||
var header_brand_mark := TextureRect.new()
|
var header_brand_mark := TextureRect.new()
|
||||||
@@ -237,6 +238,10 @@ func _ready() -> void:
|
|||||||
header_wordmark_label.add_theme_font_size_override("font_size", 18)
|
header_wordmark_label.add_theme_font_size_override("font_size", 18)
|
||||||
header_brand.add_child(header_wordmark_label)
|
header_brand.add_child(header_wordmark_label)
|
||||||
|
|
||||||
|
var header_brand_spacer := Control.new()
|
||||||
|
header_brand_spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
|
header_brand.add_child(header_brand_spacer)
|
||||||
|
|
||||||
header_row = HBoxContainer.new()
|
header_row = HBoxContainer.new()
|
||||||
header_row.add_theme_constant_override("separation", 16)
|
header_row.add_theme_constant_override("separation", 16)
|
||||||
header_stack.add_child(header_row)
|
header_stack.add_child(header_row)
|
||||||
@@ -271,10 +276,6 @@ func _ready() -> void:
|
|||||||
_set_scaled_label(progress_percent_label, 13, Brand.SLATE)
|
_set_scaled_label(progress_percent_label, 13, Brand.SLATE)
|
||||||
progress_bar_row.add_child(progress_percent_label)
|
progress_bar_row.add_child(progress_percent_label)
|
||||||
|
|
||||||
var header_spacer := Control.new()
|
|
||||||
header_spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
|
||||||
header_row.add_child(header_spacer)
|
|
||||||
|
|
||||||
timer_label = Label.new()
|
timer_label = Label.new()
|
||||||
_set_scaled_label(timer_label, 14, Brand.SLATE)
|
_set_scaled_label(timer_label, 14, Brand.SLATE)
|
||||||
timer_label.visible = false
|
timer_label.visible = false
|
||||||
@@ -423,7 +424,7 @@ func _ready() -> void:
|
|||||||
header_toolbar_host = HBoxContainer.new()
|
header_toolbar_host = HBoxContainer.new()
|
||||||
header_toolbar_host.alignment = BoxContainer.ALIGNMENT_END
|
header_toolbar_host.alignment = BoxContainer.ALIGNMENT_END
|
||||||
header_toolbar_host.add_child(question_toolbar)
|
header_toolbar_host.add_child(question_toolbar)
|
||||||
header_row.add_child(header_toolbar_host)
|
header_brand.add_child(header_toolbar_host)
|
||||||
|
|
||||||
navigator_popup = PopupPanel.new()
|
navigator_popup = PopupPanel.new()
|
||||||
navigator_popup.name = "QuestionNavigator"
|
navigator_popup.name = "QuestionNavigator"
|
||||||
@@ -776,10 +777,10 @@ func _fit_modal_panels() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _refresh_responsive_layout() -> void:
|
func _refresh_responsive_layout() -> void:
|
||||||
if header_toolbar_host == null or header_row == null or header_stack == null:
|
if header_toolbar_host == null or header_brand == null or header_stack == null:
|
||||||
return
|
return
|
||||||
var compact := size.x < 1120.0
|
var compact := size.x < 1120.0
|
||||||
var target_parent: Control = header_row
|
var target_parent: Control = header_brand
|
||||||
if compact:
|
if compact:
|
||||||
target_parent = header_stack
|
target_parent = header_stack
|
||||||
if header_toolbar_host.get_parent() != target_parent:
|
if header_toolbar_host.get_parent() != target_parent:
|
||||||
|
|||||||
Reference in New Issue
Block a user