]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt/GuiToolbar.h
Fix broken Apple speller interface
[features.git] / src / frontends / qt / GuiToolbar.h
index bd4ef8f86277ef588fb20135aad3f254065b0552..6b3581c2d2dbb9c249a7d63e84bcdffaf26842ba 100644 (file)
@@ -26,17 +26,12 @@ class QSettings;
 
 namespace lyx {
 
-class DocumentClass;
-class Inset;
-
 namespace frontend {
 
 class Action;
 class GuiCommandBuffer;
-class GuiLayoutFilterModel;
 class GuiToolbar;
 class GuiView;
-class LayoutBox;
 class ToolbarInfo;
 class ToolbarItem;
 
@@ -73,11 +68,11 @@ public:
 
 protected:
        ///
-       void initialize();
+       void initialize() override;
 
 protected Q_SLOTS:
        ///
-       void updateTriggered();
+       void updateTriggered() override;
 };
 
 
@@ -101,9 +96,11 @@ public:
        ~DynamicMenuButton();
        ///
        static bool isMenuType(std::string const & s);
+       ///
+       static void resetIconCache();
 protected:
        ///
-       void initialize();
+       void initialize() override;
        ///
        void loadFlexInsets();
        /// pimpl so we don't have to include big files
@@ -111,7 +108,13 @@ protected:
        Private * d;
 protected Q_SLOTS:
        ///
-       void updateTriggered();
+       void updateTriggered() override;
+private:
+       /// These icons are needed at each updateTriggered() call, and
+       /// therefore we have to cache them.
+       static QIcon icon_textstyle_apply_;
+       static QIcon icon_undo_;
+       static QIcon icon_paste_;
 };
 
 
@@ -124,7 +127,7 @@ public:
 
        /// Reimplemented from QToolbar to detect whether the
        /// toolbar is restored with MainWindow::restoreState().
-       void setVisible(bool visible);
+       void setVisible(bool visible) override;
 
        ///
        void setVisibility(int visibility);
@@ -146,25 +149,31 @@ public:
        bool isRestored() const;
 
        ///
-       bool isVisibiltyOn() const;
+       bool isVisibilityOn() const;
        int visibility() const { return visibility_; }
 
        /// Refresh the contents of the bar.
        void update(int context = 0);
 
+       ///
+       void setState(std::string const state);
        ///
        void toggle();
 
+       ///
+       void refill();
+
        /// toggles movability
        void movable(bool silent = false);
 
        ///
        GuiCommandBuffer * commandBuffer() { return command_buffer_; }
 
+       /// add item to toolbar.
+       /// \param menu : when true, the item is for a menu entry, not a button.
+       Action * addItem(ToolbarItem const & item, bool menu = false);
        ///
-       Action * addItem(ToolbarItem const & item);
-    ///
-    GuiView const & owner() { return owner_; }
+       GuiView const & owner() { return owner_; }
 
 Q_SIGNALS:
        ///
@@ -176,9 +185,7 @@ private:
        ///
        void fill();
        ///
-       void showEvent(QShowEvent *);
-       ///
-       bool eventFilter(QObject * obj, QEvent * ev);
+       void showEvent(QShowEvent *) override;
 
        ///
        QList<Action *> actions_;