Skip to content

Commit

Permalink
Statistics Dialog: merge unit name and count labels
Browse files Browse the repository at this point in the history
Makes it easier for translators to do something specific with this label if needs
be. I remember the reason the count (NUMx) label was moved prior to the name had
to do with language conventions too, so this should alleviate any other such issues.

Also made the name label default size instead of small.
  • Loading branch information
Vultraz committed Jun 10, 2018
1 parent b5f1e1a commit 142a2f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
15 changes: 1 addition & 14 deletions data/gui/window/statistics_dialog.cfg
Expand Up @@ -264,19 +264,6 @@
[/image]
[/column]

[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_grow = true

[label]
id = "unit_count"
definition = "default"
linked_group = "unit_count"
[/label]
[/column]

[column]
grow_factor = 1
border = "all"
Expand All @@ -285,7 +272,7 @@

[label]
id = "unit_name"
definition = "default_small"
definition = "default"
linked_group = "unit_name"
[/label]
[/column]
Expand Down
7 changes: 3 additions & 4 deletions src/gui/dialogs/statistics_dialog.cpp
Expand Up @@ -17,6 +17,7 @@

#include "font/constants.hpp"
#include "formatter.hpp"
#include "formula/string_utils.hpp"
#include "gettext.hpp"
#include "gui/auxiliary/find_widget.hpp"
#include "gui/widgets/label.hpp"
Expand Down Expand Up @@ -241,12 +242,10 @@ void statistics_dialog::on_primary_list_select(window& window)
item["label"] = (formatter() << type->image() << "~RC(" << type->flag_rgb() << ">" << current_team_.color() << ")").str();
data.emplace("unit_image", item);

item["label"] = type->type_name();
// Note: the x here is a font::unicode_multiplication_sign
item["label"] = VGETTEXT("$count|× $name", {{"count", std::to_string(i.second)}, {"name", type->type_name()}});
data.emplace("unit_name", item);

item["label"] = (formatter() << i.second << font::unicode_multiplication_sign).str();
data.emplace("unit_count", item);

unit_list.add_row(data);
}
}
Expand Down

0 comments on commit 142a2f2

Please sign in to comment.