Fix the collapse tooltip (uniform to "sidebar", show hotkey)

Sidebar is used everywhere else, so change "right panel" to "sidebar" in
collapse button.

Also show the hotkey, as done for "Tab"
This commit is contained in:
Yuri D'Elia 2020-09-11 21:17:09 +02:00 committed by Lukas Matena
parent 732f371f4f
commit 2f642ce83c

View file

@ -4075,23 +4075,26 @@ bool Plater::priv::init_collapse_toolbar()
GLToolbarItem::Data item;
item.name = "collapse_sidebar";
item.icon_filename = "collapse.svg";
item.tooltip = wxGetApp().plater()->is_sidebar_collapsed() ? _utf8(L("Expand right panel")) : _utf8(L("Collapse right panel"));
item.sprite_id = 0;
item.left.action_callback = [this, item]() {
std::string new_tooltip = wxGetApp().plater()->is_sidebar_collapsed() ?
_utf8(L("Collapse right panel")) : _utf8(L("Expand right panel"));
auto item_tooltip_update = [this, item](bool flip) {
std::string new_tooltip = wxGetApp().plater()->is_sidebar_collapsed() ^ flip?
_utf8(L("Expand sidebar")) : _utf8(L("Collapse sidebar"));
new_tooltip += " [Shift+Tab]";
int id = collapse_toolbar.get_item_id("collapse_sidebar");
collapse_toolbar.set_tooltip(id, new_tooltip);
};
item.name = "collapse_sidebar";
item.icon_filename = "collapse.svg";
item.sprite_id = 0;
item.left.action_callback = [this, item_tooltip_update]() {
item_tooltip_update(true);
wxGetApp().plater()->collapse_sidebar(!wxGetApp().plater()->is_sidebar_collapsed());
};
if (!collapse_toolbar.add_item(item))
return false;
item_tooltip_update(false);
return true;
}