X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiToolbar.h;h=23ee9610d14b39deeee9e251080fdc3eeecc68c3;hb=29a8097c3c14aad871c7e396a59542fe47e39ea1;hp=8f4d4d927fa317bdbea753269d070c58ba8aa12a;hpb=d82adc625b13ae2f752492e598ac2a8aaad2690c;p=lyx.git diff --git a/src/frontends/qt/GuiToolbar.h b/src/frontends/qt/GuiToolbar.h index 8f4d4d927f..23ee9610d1 100644 --- a/src/frontends/qt/GuiToolbar.h +++ b/src/frontends/qt/GuiToolbar.h @@ -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; @@ -101,6 +96,8 @@ public: ~DynamicMenuButton(); /// static bool isMenuType(std::string const & s); + /// + static void resetIconCache(); protected: /// void initialize() override; @@ -112,6 +109,12 @@ protected: protected Q_SLOTS: /// 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_; }; @@ -146,30 +149,39 @@ 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: /// void updated(); +private Q_SLOTS: + void showContextMenu(QPoint pos); + private: // load flags with saved values void initFlags();