diff --git a/src/frontends/qt4/GuiToolbar.cpp b/src/frontends/qt4/GuiToolbar.cpp index 119a42f0ee..05e97e912a 100644 --- a/src/frontends/qt4/GuiToolbar.cpp +++ b/src/frontends/qt4/GuiToolbar.cpp @@ -53,8 +53,7 @@ namespace frontend { GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner) : QToolBar(toqstr(tbinfo.gui_name), &owner), visibility_(0), - allowauto_(false), owner_(owner), command_buffer_(0), - tbinfo_(tbinfo), filled_(false) + owner_(owner), command_buffer_(0), tbinfo_(tbinfo), filled_(false) { setIconSize(owner.iconSize()); connect(&owner, SIGNAL(iconSizeChanged(QSize)), this, @@ -91,7 +90,6 @@ void GuiToolbar::showEvent(QShowEvent * ev) void GuiToolbar::setVisibility(int visibility) { visibility_ = visibility; - allowauto_ = visibility_ >= Toolbars::MATH; } @@ -335,7 +333,7 @@ void GuiToolbar::restoreSession() void GuiToolbar::toggle() { docstring state; - if (allowauto_) { + if (visibility_ & Toolbars::ALLOWAUTO) { if (!(visibility_ & Toolbars::AUTO)) { visibility_ |= Toolbars::AUTO; hide(); diff --git a/src/frontends/qt4/GuiToolbar.h b/src/frontends/qt4/GuiToolbar.h index 31146ee399..0745b7dcd2 100644 --- a/src/frontends/qt4/GuiToolbar.h +++ b/src/frontends/qt4/GuiToolbar.h @@ -118,8 +118,6 @@ private: /// initial visibility flags int visibility_; /// - bool allowauto_; - /// GuiView & owner_; /// GuiCommandBuffer * command_buffer_; diff --git a/src/frontends/qt4/Toolbars.h b/src/frontends/qt4/Toolbars.h index 92bd3de78b..5f69802d5c 100644 --- a/src/frontends/qt4/Toolbars.h +++ b/src/frontends/qt4/Toolbars.h @@ -108,6 +108,7 @@ public: TABLE = 256, //< show when in table REVIEW = 512, //< show when change tracking is enabled MATHMACROTEMPLATE = 1024, //< show in math macro template + ALLOWAUTO = MATH | TABLE | REVIEW | MATHMACROTEMPLATE, SAMEROW = 2048 //place to the current row, no new line };