void GuiToolbar::setVisible(bool visible)
{
// This is a hack to find out which toolbars have been restored by
- // MainWindow::restoreState and which toolbars should be initialized
+ // MainWindow::restoreState and which toolbars should be initialized
// by us (i.e., new toolbars)
restored_ = true;
QToolBar::setVisible(visible);
ToolbarInfo::item_iterator it = tbinfo_.items.begin();
ToolbarInfo::item_iterator end = tbinfo_.items.end();
for (; it != end; ++it)
- add(*it);
+ add(*it);
filled_ = true;
}
}
};
-}
+} // namespace
MenuButton::MenuButton(GuiToolbar * bar, ToolbarItem const & item, bool const sticky)
}
-void GuiToolbar::saveSession() const
+void GuiToolbar::saveSession(QSettings & settings) const
{
- QSettings settings;
settings.setValue(sessionKey() + "/visibility", visibility_);
settings.setValue(sessionKey() + "/movability", isMovable());
}
if (visibility == error_val || visibility == 0) {
// This should not happen, but in case we use the defaults
LYXERR(Debug::GUI, "Session settings could not be found! Defaults are used instead.");
- visibility =
+ visibility =
guiApp->toolbars().defaultVisibility(fromqstr(objectName()));
}
setVisibility(visibility);
// toggle movability
setMovable(!isMovable());
- // manual repaint avoids bug in qt that the drag handle is not removed
+ // manual update avoids bug in qt that the drag handle is not removed
// properly, e.g. in Windows
- if (isVisible())
- repaint();
+ Q_EMIT update();
// silence for toggling of many toolbars for performance
if (!silent) {
docstring state;
- if (isMovable()) {
+ if (isMovable())
state = _("movable");
- } else {
+ else
state = _("immovable");
- }
owner_.message(bformat(_("Toolbar \"%1$s\" state set to %2$s"),
qstring_to_ucs4(windowTitle()), state));
}