|
Krita Source Code Documentation
|
#include <KoToolBox_p.h>
Inheritance diagram for KoToolBox:Classes | |
| class | Private |
Public Slots | |
| void | setActiveTool (KoCanvasController *canvas) |
| void | setButtonsVisible (const QList< QString > &codes) |
| void | setFloating (bool v) |
| void | setOrientation (Qt::Orientation orientation) |
Set the orientation of the layout to orientation. | |
| KoToolBoxLayout * | toolBoxLayout () const |
Public Member Functions | |
| void | applyIconSize () |
| KoToolBox () | |
| constructor | |
| void | setViewManager (KisViewManager *viewManager) |
| ~KoToolBox () override | |
Protected Member Functions | |
| void | changeEvent (QEvent *event) override |
| void | paintEvent (QPaintEvent *event) override |
Private Slots | |
| void | setCurrentLayer (const KoCanvasController *canvas, const KoShapeLayer *newLayer) |
| void | slotContextIconSize () |
| set the icon size for all the buttons | |
| void | toolAdded (KoToolAction *toolAction, KoCanvasController *canvas) |
| add a tool post-initialization. The tool will also be activated. | |
Private Member Functions | |
| void | addButton (KoToolAction *toolAction) |
| void | setupIconSizeMenu (QMenu *menu) |
Private Attributes | |
| Private *const | d |
Friends | |
| class | KoToolBoxDocker |
KoToolBox is a dock widget that can order tools according to type and priority.
The ToolBox is a container for tool buttons which are themselves divided into sections.
Adding buttons using addButton() will allow you to show those buttons. You should connect the button to your handling method yourself.
The unique property of this toolbox is that it can be shown horizontal as well as vertical, rotating in a smart way to show the buttons optimally.
Definition at line 39 of file KoToolBox_p.h.
|
explicit |
constructor
Definition at line 87 of file KoToolBox.cpp.
References addButton(), KoToolBox::Private::addSection(), applyIconSize(), KoToolBox::Private::buttonGroup, buttonSize(), connect(), d, KisPortingUtils::getScreenNumberForWidget(), KoToolBox::Private::iconSize, KoToolManager::instance(), KoToolBox::Private::layout, setActiveTool(), setButtonsVisible(), setCurrentLayer(), and toolAdded().
|
override |
|
private |
Add a button to the toolbox. The buttons should all be added before the first showing since adding will not really add them to the UI until setup() is called.
| toolAction | the action of the tool |
Definition at line 156 of file KoToolBox.cpp.
References Section::addButton(), KoToolBox::Private::addSection(), button(), KoToolBox::Private::buttonGroup, KoToolBox::Private::buttons, KoToolBox::Private::buttonsByToolId, d, KoToolAction::id(), KoToolAction::priority(), KoToolAction::section(), KoToolBox::Private::sections, KoToolAction::visibilityCode(), and KoToolBox::Private::visibilityCodes.
| void KoToolBox::applyIconSize | ( | ) |
Definition at line 130 of file KoToolBox.cpp.
References button(), BUTTON_MARGIN, KoToolBox::Private::buttons, d, KoToolBox::Private::iconSize, KoToolBox::Private::sections, and Section::setButtonSize().
|
overrideprotected |
Definition at line 286 of file KoToolBox.cpp.
References button(), KoToolBox::Private::buttons, d, and KoToolBoxButton::setHighlightColor().
|
overrideprotected |
Definition at line 243 of file KoToolBox.cpp.
References d, palette, KoToolBox::Private::sections, Section::SeparatorLeft, Section::separators(), and Section::SeparatorTop.
|
slot |
Set the new active button based on the currently active tool.
| canvas | the currently active canvas. |
Definition at line 187 of file KoToolBox.cpp.
References KoToolManager::activeToolId(), button(), KoToolBox::Private::buttonsByToolId, d, KoToolManager::instance(), KoToolBox::Private::selectedButton, KoToolBoxButton::setHighlightColor(), and warnWidgets.
Show only the dynamic buttons that have a code from parameter codes. The toolbox allows buttons to be optionally registered with a visibilityCode. This code can be passed here and all buttons that have that code are shown. All buttons that have another visibility code registered are hidden.
| codes | a list of all the codes to show. |
Definition at line 206 of file KoToolBox.cpp.
References button(), d, and KoToolBox::Private::visibilityCodes.
|
privateslot |
Definition at line 231 of file KoToolBox.cpp.
References button(), d, KoShape::isShapeEditable(), KoShape::isVisible(), and KoToolBox::Private::visibilityCodes.
|
slot |
Definition at line 309 of file KoToolBox.cpp.
References d, KoToolBox::Private::floating, and v.
|
slot |
Set the orientation of the layout to orientation.
Definition at line 299 of file KoToolBox.cpp.
References d, KoToolBox::Private::layout, KoToolBox::Private::orientation, KoToolBox::Private::sections, Section::setOrientation(), and KoToolBoxLayout::setOrientation().
|
private |
Definition at line 346 of file KoToolBox.cpp.
References KoToolBox::Private::contextIconSizes, d, KoToolBox::Private::defaultIconSizeAction, KoToolBox::Private::iconSize, and slotContextIconSize().
| void KoToolBox::setViewManager | ( | KisViewManager * | viewManager | ) |
Definition at line 142 of file KoToolBox.cpp.
References KisKActionCollection::action(), KisViewManager::actionCollection(), button(), KoToolBox::Private::buttonsByToolId, d, KoToolAction::id(), and KoToolManager::instance().
|
privateslot |
set the icon size for all the buttons
Definition at line 322 of file KoToolBox.cpp.
References applyIconSize(), buttonSize(), KoToolBox::Private::contextIconSizes, d, KoToolBox::Private::defaultIconSizeAction, KisPortingUtils::getScreenNumberForWidget(), KoToolBox::Private::iconSize, iconSize(), and KIS_SAFE_ASSERT_RECOVER.
|
privateslot |
add a tool post-initialization. The tool will also be activated.
Definition at line 314 of file KoToolBox.cpp.
References addButton(), and setButtonsVisible().
|
slot |
Definition at line 367 of file KoToolBox.cpp.
References d, and KoToolBox::Private::layout.
|
friend |
Definition at line 100 of file KoToolBox_p.h.
|
private |
Definition at line 104 of file KoToolBox_p.h.