mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
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:
parent
732f371f4f
commit
2f642ce83c
1 changed files with 11 additions and 8 deletions
|
@ -4075,23 +4075,26 @@ bool Plater::priv::init_collapse_toolbar()
|
||||||
|
|
||||||
GLToolbarItem::Data item;
|
GLToolbarItem::Data item;
|
||||||
|
|
||||||
item.name = "collapse_sidebar";
|
auto item_tooltip_update = [this, item](bool flip) {
|
||||||
item.icon_filename = "collapse.svg";
|
std::string new_tooltip = wxGetApp().plater()->is_sidebar_collapsed() ^ flip?
|
||||||
item.tooltip = wxGetApp().plater()->is_sidebar_collapsed() ? _utf8(L("Expand right panel")) : _utf8(L("Collapse right panel"));
|
_utf8(L("Expand sidebar")) : _utf8(L("Collapse sidebar"));
|
||||||
item.sprite_id = 0;
|
new_tooltip += " [Shift+Tab]";
|
||||||
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"));
|
|
||||||
|
|
||||||
int id = collapse_toolbar.get_item_id("collapse_sidebar");
|
int id = collapse_toolbar.get_item_id("collapse_sidebar");
|
||||||
collapse_toolbar.set_tooltip(id, new_tooltip);
|
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());
|
wxGetApp().plater()->collapse_sidebar(!wxGetApp().plater()->is_sidebar_collapsed());
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!collapse_toolbar.add_item(item))
|
if (!collapse_toolbar.add_item(item))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
item_tooltip_update(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue