mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue