Skip to content

Commit

Permalink
Dropdown List: renamed label_right to details and made it align left
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Aug 24, 2016
1 parent 6d39cff commit 9579b89
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
16 changes: 11 additions & 5 deletions data/gui/window/drop_down_list.cfg
Expand Up @@ -42,6 +42,11 @@ min(
id = "tooltip"
[/helptip]

[linked_group]
id = "panel"
fixed_height = "true"
[/linked_group]

[linked_group]
id = "icons"
fixed_width = "true"
Expand All @@ -53,8 +58,8 @@ min(
[/linked_group]

[linked_group]
id = "panel"
fixed_height = "true"
id = "details"
fixed_width = "true"
[/linked_group]

[grid]
Expand Down Expand Up @@ -114,12 +119,13 @@ min(

[column]
grow_factor = 1
border = "all"
border = "right,top,bottom"
border_size = 7
horizontal_alignment = "right"
horizontal_grow = "true"
[label]
id = "label_right"
id = "details"
definition = "default_small"
linked_group = "details"
[/label]
[/column]

Expand Down
6 changes: 3 additions & 3 deletions src/gui/dialogs/drop_down_list.cpp
Expand Up @@ -73,11 +73,11 @@ void tdrop_down_list::pre_show(twindow& window)
data.emplace("label", item);
}

if(entry.has_attribute("label_right")) {
item["label"] = entry["label_right"];
if(entry.has_attribute("details")) {
item["label"] = entry["details"];
item["tooltip"] = entry["tooltip"];
item["use_markup"] = use_markup_ ? "true" : "false";
data.emplace("label_right", item);
data.emplace("details", item);
}

tgrid& new_row = list.add_row(data);
Expand Down
4 changes: 2 additions & 2 deletions src/hotkey/command_executor.cpp
Expand Up @@ -477,7 +477,7 @@ std::vector<config> command_executor::get_menu_images(display& disp, const std::
else {
i = label.find_first_of(1);
if(i != std::string::npos) {
result.back()["label_right"] = label.substr(i + 1);
result.back()["details"] = label.substr(i + 1);
result.back()["image"] = label.substr(1, i - 1);
} else {
result.back()["label"] = label;
Expand All @@ -497,7 +497,7 @@ std::vector<config> command_executor::get_menu_images(display& disp, const std::
}
}
result.back()["label"] = desc;
result.back()["label_right"] = hotkey::get_names(item);
result.back()["details"] = hotkey::get_names(item);
}
}
}
Expand Down

0 comments on commit 9579b89

Please sign in to comment.