Make the sync result look right with any number of columns
- Visible columns share the width equally, whether one or five are shown - Long soundtrack names and errors wrap inside their column instead of widening the window, which pushed the title and Restart button out of view and cut off text - Separators only go between columns; the extra one before the first column is gone - Wider, centred panel with inner margins, and spacing above the Restart button - The Re-added header no longer reads ReAdded
This commit is contained in:
1 parent
212eda96e2
commit
196a7abc35
4 files changed
+68
-31
No files matched your search
+4
-12
@@ -60,9 +60,6 @@ var sync_timer: Timer = %SyncTimer
|
||||
@onready
|
||||
var restart_sync_button: Button = %RestartSyncButton
|
||||
|
||||
@onready
|
||||
var first_separator: VSeparator = %VSeparator6
|
||||
|
||||
var changes: bool = false
|
||||
|
||||
var has_synced: bool = false
|
||||
@@ -120,7 +117,7 @@ func on_sync_finished(data_received: Dictionary) -> void:
|
||||
if show_section_if_has_data(data_received.soundtracks_added, soundtracks_added_vbox, soundtracks_added_separator, "Added"):
|
||||
changes = true
|
||||
|
||||
if show_section_if_has_data(data_received.soundtracks_re_added, soundtracks_readded_vbox, soundtracks_readded_separator, "ReAdded"):
|
||||
if show_section_if_has_data(data_received.soundtracks_re_added, soundtracks_readded_vbox, soundtracks_readded_separator, "Re-added"):
|
||||
changes = true
|
||||
|
||||
if data_received.soundtracks_changed_title != null && data_received.soundtracks_changed_title.size() > 0:
|
||||
@@ -146,9 +143,7 @@ func on_sync_finished(data_received: Dictionary) -> void:
|
||||
catched_errors_vbox.visible = true
|
||||
make_list(data_received.catched_errors, catched_errors_vbox, "Errors")
|
||||
|
||||
# Hide separators that don't have a visible section after them
|
||||
# The structure is: RestartSyncButton -> VSeparator6 -> VBox -> Separator -> VBox -> Separator -> ...
|
||||
# Hide VSeparator6 if there are no visible sections
|
||||
# Separators go only between visible columns, not after the last one
|
||||
var visible_sections: Array = []
|
||||
if soundtracks_added_vbox.visible:
|
||||
visible_sections.append("added")
|
||||
@@ -161,8 +156,6 @@ func on_sync_finished(data_received: Dictionary) -> void:
|
||||
if soundtracks_removed_vbox.visible:
|
||||
visible_sections.append("removed")
|
||||
|
||||
first_separator.visible = visible_sections.size() > 1
|
||||
|
||||
# Show section separators only if there's a visible section after them
|
||||
for i in range(visible_sections.size()):
|
||||
var section = visible_sections[i]
|
||||
@@ -205,7 +198,8 @@ func make_soundtrack_label(text: String) -> Label:
|
||||
var label: Label = Label.new()
|
||||
label.add_theme_font_size_override("font_size", 18)
|
||||
label.text = text
|
||||
label.autowrap_mode = TextServer.AUTOWRAP_OFF
|
||||
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
return label
|
||||
|
||||
func reset_sync_result() -> void:
|
||||
@@ -224,7 +218,6 @@ func reset_sync_result() -> void:
|
||||
soundtracks_removed_vbox.visible = false
|
||||
soundtracks_removed_separator.visible = false
|
||||
catched_errors_vbox.visible = false
|
||||
first_separator.visible = false
|
||||
|
||||
func make_list(list: Array, vbox: VBoxContainer, text: String) -> void:
|
||||
Settings.delete_children(vbox)
|
||||
@@ -250,4 +243,3 @@ func show_sync_progress() -> void:
|
||||
sync_hbox.visible = false
|
||||
catched_errors_vbox.visible = false
|
||||
restart_sync_button.visible = false
|
||||
first_separator.visible = false
|
||||
Reference in new issue
Block a user