gui2/network_transmission: Modernize appearance

Following the previous commit altering the progress bar's styling, we
now rearrange the dialog to completely eliminate visual gaps during
add-ons server connection by having the status display share a row with
the Cancel button so as to not force extreme layout recalculations. The
status display is also smaller corresponding with its lesser importance
compared to the progress bar itself, which has now become the absolute
centerpiece of the dialog by taking up almost all of its horizontal
space even when the descriptive text is short.

There's an engine change in this, recommended by Vultraz to avoid
recalculating the UI unnecessarily during network transfers. It
necessitates a minor hack in the WML to ensure that the status label has
a non-0 initial size, but it's nothing too major.
This commit is contained in:
Iris Morelle 2019-11-17 00:46:15 -03:00
parent 335e5ccdf3
commit 34d45d3ee5
2 changed files with 18 additions and 23 deletions

View file

@ -78,39 +78,36 @@
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[label]
id = "numeric_progress"
definition = "default"
[/label]
[/column]
[/row]
[row]
[column]
horizontal_alignment = "right"
horizontal_grow = true
[grid]
[row]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_grow = true
[label]
id = "numeric_progress"
definition = "gold_small"
# NOTE: needed to avoid explicit calls to invalidate_layout()
# in network_transmission::pump_monitor::process()
label = " "
[/label]
[/column]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "right"
[button]
id = "cancel"
definition = "default"
label = _ "Cancel"
[/button]

View file

@ -83,8 +83,6 @@ void network_transmission::pump_monitor::process(events::pump_info&)
find_widget<label>(&(window_.get()), "numeric_progress", false)
.set_label(ss.str());
window_->invalidate_layout();
}
}