|
Krita Source Code Documentation
|
#include <KoToolBox_p.h>
Inheritance diagram for KoToolBox:Classes | |
| class | Private |
Public Slots | |
| bool | isCompact () |
| void | setActiveTool (KoCanvasController *canvas) |
| void | setButtonsVisible (const QList< QString > &codes) |
| void | setCompact (bool) |
| 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 86 of file KoToolBox.cpp.
References addButton(), KoToolBox::Private::addSection(), applyIconSize(), KoToolBox::Private::buttonGroup, buttonSize(), d, KisPortingUtils::getScreenNumberForWidget(), KoToolBox::Private::iconSize, KoToolManager::instance(), KoToolBox::Private::layout, setActiveTool(), setButtonsVisible(), setCompact(), 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 157 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 131 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 288 of file KoToolBox.cpp.
References button(), KoToolBox::Private::buttons, d, and KoToolBoxButton::setHighlightColor().
|
slot |
Definition at line 315 of file KoToolBox.cpp.
References d, KoToolBoxLayout::isCompact(), and KoToolBox::Private::layout.
|
overrideprotected |
Definition at line 244 of file KoToolBox.cpp.
References d, palette, KoToolBox::Private::sections, Section::SeparatorLeft, Section::SeparatorNone, 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 188 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 207 of file KoToolBox.cpp.
References button(), d, and KoToolBox::Private::visibilityCodes.
|
slot |
Definition at line 310 of file KoToolBox.cpp.
References d, KoToolBox::Private::layout, and KoToolBoxLayout::setCompact().
|
privateslot |
Definition at line 232 of file KoToolBox.cpp.
References button(), d, KoShape::isShapeEditable(), KoShape::isVisible(), and KoToolBox::Private::visibilityCodes.
|
slot |
Definition at line 320 of file KoToolBox.cpp.
References d, KoToolBox::Private::floating, and v.
|
slot |
Set the orientation of the layout to orientation.
Definition at line 301 of file KoToolBox.cpp.
References d, KoToolBox::Private::layout, KoToolBox::Private::sections, Section::setOrientation(), and KoToolBoxLayout::setOrientation().
|
private |
Definition at line 357 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 143 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 333 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 325 of file KoToolBox.cpp.
References addButton(), and setButtonsVisible().
|
slot |
Definition at line 378 of file KoToolBox.cpp.
References d, and KoToolBox::Private::layout.
|
friend |
Definition at line 103 of file KoToolBox_p.h.
|
private |
Definition at line 107 of file KoToolBox_p.h.