|
Krita Source Code Documentation
|
Floatable toolbar with auto resize. More...
#include <ktoolbar.h>
Inheritance diagram for KisToolBar:Classes | |
| class | Private |
Public Member Functions | |
| void | addXMLGUIClient (KisKXMLGUIClient *client) |
| void | applySettings (const KConfigGroup &cg) |
| bool | eventFilter (QObject *watched, QEvent *event) override |
| int | iconSizeDefault () const |
| KisToolBar (const QString &objectName, QWidget *parent, bool readConfig=true) | |
| void | loadState (const QDomElement &element) |
| KisKMainWindow * | mainWindow () const |
| void | removeXMLGUIClient (KisKXMLGUIClient *client) |
| void | saveSettings (KConfigGroup &cg) |
| void | saveState (QDomElement &element) const |
| void | setIconDimensions (int size) |
| ~KisToolBar () override | |
Static Public Member Functions | |
| static void | emitToolbarStyleChanged () |
| static void | setToolBarsEditable (bool editable) |
| static void | setToolBarsLocked (bool locked) |
| static bool | toolBarsEditable () |
| static bool | toolBarsLocked () |
| static KisToolBarStateModel * | toolBarStateModel () |
Protected Slots | |
| virtual void | slotMovableChanged (bool movable) |
Protected Member Functions | |
| void | actionEvent (QActionEvent *) override |
| void | contextMenuEvent (QContextMenuEvent *) override |
| void | dragEnterEvent (QDragEnterEvent *) override |
| void | dragLeaveEvent (QDragLeaveEvent *) override |
| void | dragMoveEvent (QDragMoveEvent *) override |
| void | dropEvent (QDropEvent *) override |
| void | mouseMoveEvent (QMouseEvent *) override |
| void | mousePressEvent (QMouseEvent *) override |
| void | mouseReleaseEvent (QMouseEvent *) override |
Private Attributes | |
| Private *const | d |
Floatable toolbar with auto resize.
A KDE-style toolbar.
KisToolBar can be used as a standalone widget, but KisKMainWindow provides easy factories and management of one or more toolbars.
KisToolBar uses a global config group to load toolbar settings on construction. It will reread this config group on a KApplication::appearanceChanged() signal.
Definition at line 46 of file ktoolbar.h.
|
explicit |
Constructor.
This constructor takes care of adding the toolbar to the mainwindow, if parent is a QMainWindow.
Normally KDE applications do not call this directly, they either call KisKMainWindow::toolBar(name), or they use XML-GUI and specify toolbars using XML.
| objectName | The QObject name of this toolbar, required so that QMainWindow can save and load the toolbar position, and so that KisToolBar can find out if it's the main toolbar. |
| parent | The standard toolbar parent (usually a KisKMainWindow) |
| readConfig | whether to apply the configuration (global and application-specific) |
Definition at line 799 of file ktoolbar.cpp.
References d, and KisToolBar::Private::init().
|
override |
Destroys the toolbar.
Definition at line 814 of file ktoolbar.cpp.
References KisToolBar::Private::contextLockAction, and d.
|
overrideprotected |
Definition at line 1341 of file ktoolbar.cpp.
References KisToolBar::Private::adjustSeparatorVisibility(), connect(), KisToolBar::Private::customizeButtonPalette(), and d.
| void KisToolBar::addXMLGUIClient | ( | KisKXMLGUIClient * | client | ) |
Adds an XML gui client that uses this toolbar
Definition at line 845 of file ktoolbar.cpp.
References d, and KisToolBar::Private::xmlguiClients.
| void KisToolBar::applySettings | ( | const KConfigGroup & | cg | ) |
Read the toolbar settings from group configGroup in config and apply them.
Definition at line 1020 of file ktoolbar.cpp.
References KisToolBar::Private::applyCurrentSettings(), d, KisToolBar::Private::iconSizeSettings, Level_UserSettings, KisToolBar::Private::toolButtonStyleFromString(), and KisToolBar::Private::toolButtonStyleSettings.
|
overrideprotected |
Definition at line 855 of file ktoolbar.cpp.
|
overrideprotected |
Definition at line 1055 of file ktoolbar.cpp.
References KisKActionCollection::action(), KisToolBar::Private::actionsBeingDragged, KisKActionCollection::allCollections(), d, KisToolBar::Private::dropIndicatorAction, and toolBarsEditable().
|
overrideprotected |
Definition at line 1136 of file ktoolbar.cpp.
References KisToolBar::Private::actionsBeingDragged, d, KisToolBar::Private::dropIndicatorAction, and toolBarsEditable().
|
overrideprotected |
Definition at line 1097 of file ktoolbar.cpp.
References d, KisToolBar::Private::dropIndicatorAction, and toolBarsEditable().
|
overrideprotected |
Definition at line 1151 of file ktoolbar.cpp.
References KisToolBar::Private::actionsBeingDragged, d, KisToolBar::Private::dropIndicatorAction, and toolBarsEditable().
|
static |
Emits a dbus signal to tell all toolbars in all applications, that the user settings have changed.
Definition at line 1414 of file ktoolbar.cpp.
|
override |
Reimplemented to support context menu activation on disabled tool buttons.
Definition at line 1242 of file ktoolbar.cpp.
References mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and toolBarsEditable().
| int KisToolBar::iconSizeDefault | ( | ) | const |
Returns the default size for this type of toolbar.
Definition at line 1045 of file ktoolbar.cpp.
| void KisToolBar::loadState | ( | const QDomElement & | element | ) |
Load state from an XML element, called by KisKXMLGUIBuilder.
Definition at line 860 of file ktoolbar.cpp.
References KisToolBar::Private::applyCurrentSettings(), d, iconSizeDefault(), KisToolBar::Private::iconSizeSettings, Level_AppXML, Level_UserSettings, mainWindow(), KisToolBar::Private::positionFromString(), KisToolBar::Private::toolButtonStyleFromString(), and KisToolBar::Private::toolButtonStyleSettings.
| KisKMainWindow * KisToolBar::mainWindow | ( | ) | const |
Returns the main window that this toolbar is docked with.
Definition at line 1034 of file ktoolbar.cpp.
|
overrideprotected |
Definition at line 1189 of file ktoolbar.cpp.
References d, KisToolBar::Private::dragAction, KisToolBar::Private::dragStartPosition, and toolBarsEditable().
|
overrideprotected |
Definition at line 1175 of file ktoolbar.cpp.
References d, KisToolBar::Private::dragAction, KisToolBar::Private::dragStartPosition, and toolBarsEditable().
|
overrideprotected |
Definition at line 1230 of file ktoolbar.cpp.
References d, and KisToolBar::Private::dragAction.
| void KisToolBar::removeXMLGUIClient | ( | KisKXMLGUIClient * | client | ) |
Removes an XML gui client that uses this toolbar
Definition at line 850 of file ktoolbar.cpp.
References d, and KisToolBar::Private::xmlguiClients.
| void KisToolBar::saveSettings | ( | KConfigGroup & | cg | ) |
Save the toolbar settings to group configGroup in config.
Definition at line 820 of file ktoolbar.cpp.
References d, KisToolBar::Private::IntSetting::defaultValue(), iconSize(), KisToolBar::Private::iconSizeSettings, Level_UserSettings, KisToolBar::Private::toolButtonStyleSettings, KisToolBar::Private::toolButtonStyleToString(), and Unset.
| void KisToolBar::saveState | ( | QDomElement & | element | ) | const |
Save state into an XML element, called by KisKXMLGUIBuilder.
Definition at line 985 of file ktoolbar.cpp.
References d, KisToolBar::Private::IntSetting::defaultValue(), KisToolBar::Private::getPositionAsString(), iconSize(), KisToolBar::Private::iconSizeSettings, Level_AppXML, KisToolBar::Private::toolButtonStyleSettings, KisToolBar::Private::toolButtonStyleToString(), and Unset.
| void KisToolBar::setIconDimensions | ( | int | size | ) |
Convenience function to set icon size
Definition at line 1039 of file ktoolbar.cpp.
References d, KisToolBar::Private::iconSizeSettings, and Level_UserSettings.
|
static |
Enable or disable toolbar editing via drag & drop of actions. This is called by KisKEditToolbar and should generally be set to disabled whenever KisKEditToolbar is not active.
Definition at line 1397 of file ktoolbar.cpp.
References KisToolBar::Private::s_editable.
|
static |
Allows you to lock and unlock all toolbars (i.e., disallow/allow moving of the toolbars).
Definition at line 1404 of file ktoolbar.cpp.
|
protectedvirtualslot |
Definition at line 1050 of file ktoolbar.cpp.
|
static |
Returns whether the toolbars are currently editable (drag & drop of actions).
Definition at line 1392 of file ktoolbar.cpp.
References KisToolBar::Private::s_editable.
|
static |
Returns whether the toolbars are locked (i.e., moving of the toolbars disallowed).
Definition at line 1409 of file ktoolbar.cpp.
|
static |
Definition at line 1422 of file ktoolbar.cpp.
|
private |
Definition at line 177 of file ktoolbar.h.