|
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 | disableButtonsByName (QList< QString > names) |
| Disables all buttons who's names are in the provided list. | |
| void | resetButtonVisibility () |
| Resets visibility of all buttons. | |
| 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 KoToolBox::Private::addSection(), KoToolBox::Private::buttonGroup, buttonSize(), d, KisPortingUtils::getScreenNumberForWidget(), KoToolBox::Private::iconSize, KoToolBox::Private::layout, and setCompact().
|
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 158 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 113 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 299 of file KoToolBox.cpp.
References button(), KoToolBox::Private::buttons, d, and KoToolBoxButton::setHighlightColor().
Disables all buttons who's names are in the provided list.
Definition at line 405 of file KoToolBox.cpp.
References KoToolBox::Private::buttonsByToolId, and d.
|
slot |
Definition at line 326 of file KoToolBox.cpp.
References d, KoToolBoxLayout::isCompact(), and KoToolBox::Private::layout.
|
overrideprotected |
Definition at line 255 of file KoToolBox.cpp.
References d, KoToolBox::Private::sections, Section::SeparatorLeft, Section::SeparatorNone, Section::separators(), and Section::SeparatorTop.
|
private |
Resets visibility of all buttons.
Definition at line 394 of file KoToolBox.cpp.
References KoToolBox::Private::buttons, and d.
|
slot |
Set the new active button based on the currently active tool.
| canvas | the currently active canvas. |
Definition at line 189 of file KoToolBox.cpp.
References KoToolManager::activeToolId(), button(), KoToolBox::Private::buttonsByToolId, d, KIS_SAFE_ASSERT_RECOVER_NOOP, KoToolBox::Private::selectedButton, KoToolBoxButton::setHighlightColor(), KoCanvasController::toolManager, KoToolBox::Private::toolManager, 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 209 of file KoToolBox.cpp.
References button(), d, disableButtonsByName(), and KoToolBox::Private::visibilityCodes.
|
slot |
Definition at line 321 of file KoToolBox.cpp.
References d, KoToolBox::Private::layout, and KoToolBoxLayout::setCompact().
|
privateslot |
Definition at line 243 of file KoToolBox.cpp.
References button(), d, KoShape::isShapeEditable(), KoShape::isVisible(), and KoToolBox::Private::visibilityCodes.
|
slot |
Definition at line 331 of file KoToolBox.cpp.
References d, KoToolBox::Private::floating, and v.
|
slot |
Set the orientation of the layout to orientation.
Definition at line 312 of file KoToolBox.cpp.
References d, KoToolBox::Private::layout, KoToolBox::Private::sections, Section::setOrientation(), and KoToolBoxLayout::setOrientation().
|
private |
Definition at line 368 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 125 of file KoToolBox.cpp.
References KisKActionCollection::action(), KisViewManager::actionCollection(), addButton(), applyIconSize(), button(), KoToolBox::Private::buttonsByToolId, d, KoToolAction::id(), setActiveTool(), setButtonsVisible(), setCurrentLayer(), KoToolManager::toolActionList, toolAdded(), KisViewManager::toolManager(), and KoToolBox::Private::toolManager.
|
privateslot |
set the icon size for all the buttons
Definition at line 344 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 336 of file KoToolBox.cpp.
References addButton(), and setButtonsVisible().
|
slot |
Definition at line 389 of file KoToolBox.cpp.
References d, and KoToolBox::Private::layout.
|
friend |
Definition at line 108 of file KoToolBox_p.h.
|
private |
Definition at line 112 of file KoToolBox_p.h.