From 1653ba55046c9e34c4093e06a0e2d248b2a31fde Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Fri, 11 Sep 2020 21:17:09 +0200 Subject: [PATCH] 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" --- src/slic3r/GUI/Plater.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 498824d4e5c..880eddafbf6 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -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; }