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:
committed by
Lukas Matena
parent
5691813510
commit
1653ba5504
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user