Dropdown List: renamed label_right to details and made it align left

This commit is contained in:
Charles Dang 2016-08-25 00:39:41 +11:00
parent 6d39cffe14
commit 9579b89522
3 changed files with 16 additions and 10 deletions

View file

@ -42,6 +42,11 @@ min(
id = "tooltip"
[/helptip]
[linked_group]
id = "panel"
fixed_height = "true"
[/linked_group]
[linked_group]
id = "icons"
fixed_width = "true"
@ -53,8 +58,8 @@ min(
[/linked_group]
[linked_group]
id = "panel"
fixed_height = "true"
id = "details"
fixed_width = "true"
[/linked_group]
[grid]
@ -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]

View file

@ -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);

View file

@ -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;
@ -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);
}
}
}