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,
void GuiToolbar::setVisibility(int visibility)
{
visibility_ = visibility;
- allowauto_ = visibility_ >= Toolbars::MATH;
}
void GuiToolbar::toggle()
{
docstring state;
- if (allowauto_) {
+ if (visibility_ & Toolbars::ALLOWAUTO) {
if (!(visibility_ & Toolbars::AUTO)) {
visibility_ |= Toolbars::AUTO;
hide();
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
};