|
Krita Source Code Documentation
|
#include <KisGradientChooser.h>
Inheritance diagram for KisGradientChooser:Classes | |
| struct | ViewOptions |
Public Types | |
| enum | ItemSize { ItemSize_Small , ItemSize_Medium , ItemSize_Large , ItemSize_Custom } |
| Item sizes. More... | |
| enum | ViewMode { ViewMode_Icon , ViewMode_List } |
| View modes. More... | |
Public Slots | |
| void | addGradient (KoAbstractGradientSP gradient, bool editGradient=false) |
| void | addSegmentedGradient () |
| void | addStopGradient () |
| void | editGradient () |
| void | on_actionGroupItemSize_triggered (QAction *triggeredAction) |
| void | on_actionGroupViewMode_triggered (QAction *triggeredAction) |
| void | on_sliderItemSizeCustom_valueChanged (int newValue) |
| void | setEditOptionsVisible (bool newEditOptionsVisible) |
| Set if the widgets with options to edit the gradient are visible. | |
| void | setItemSize (ItemSize newItemSize) |
| Set the size of the gradient preset chooser items. | |
| void | setItemSizeCustom (int newSize) |
| Set the size (height) in pixels used when KisGradientChooser::ItemSize_Custom is used as the item size. | |
| void | setNameLabelVisible (bool newNameLabelVisible) |
| Set if the label showing the gradient name is visible. | |
| void | setViewMode (ViewMode newViewMode) |
| Set if the gradient preset chooser must show the items as a grid of icons or as a list. | |
| void | slotUpdateIcons () |
| void | update (KoResourceSP resource) |
Signals | |
| void | gradientEdited (KoAbstractGradientSP resource) |
| Emitted when a resource was changed or added. | |
| void | resourceClicked (KoResourceSP resource) |
| Emitted when a resource was clicked. | |
| void | resourceSelected (KoResourceSP resource) |
| Emitted when a resource was selected. | |
Public Member Functions | |
| bool | areEditOptionsVisible () const |
| Get if the widgets with options to edit the gradient are visible. | |
| KoCanvasResourcesInterfaceSP | canvasResourcesInterface () const |
| KoResourceSP | currentResource (bool includeHidden=false) |
| bool | isNameLabelVisible () const |
| Get if the label showing the gradient name is visible. | |
| ItemSize | itemSize () const |
| Tell the size of the gradient preset chooser items. | |
| int | itemSizeCustom () const |
| Tell the size (height) in pixels used when KisGradientChooser::ItemSize_Custom is used as the item size. | |
| KisGradientChooser (QWidget *parent=0, const char *name=0, bool useGlobalViewOptions=true) | |
| void | loadViewSettings (const QString &prefix=QString()) |
| Load the view settings from the configuration. | |
| KisResourceItemChooser * | resourceItemChooser () const |
| Get a pointer to the item chooser being used. | |
| void | saveViewSettings (const QString &prefix=QString()) |
| Save the view settings to the configuration. | |
| void | setCanvasResourcesInterface (KoCanvasResourcesInterfaceSP canvasResourcesInterface) |
| void | setCurrentItem (int row) |
| void | setCurrentResource (KoResourceSP resource) |
| void | updateContainerSliderItemSizeCustom () |
| void | updatePresetChooser (bool globalUpdate=true) |
| void | updatePresetChooserIcons () |
| ViewMode | viewMode () const |
| Tell if the gradient preset chooser is showing the items as a grid of icons or as a list. | |
| ~KisGradientChooser () override | |
Public Attributes | |
| QAction * | actionItemSizeCustom |
| QAction * | actionItemSizeLarge |
| QAction * | actionItemSizeMedium |
| QAction * | actionItemSizeSmall |
| QAction * | actionViewModeIcon |
| QAction * | actionViewModeList |
| bool | areEditOptionsVisible |
| QToolButton * | buttonAddGradient |
| QPushButton * | buttonEditGradient |
| KoCanvasResourcesInterfaceSP | canvasResourcesInterface |
| QWidget * | containerEditWidgets |
| QWidget * | containerSliderItemSizeCustom |
| bool | isNameLabelVisible |
| KisResourceItemChooser * | itemChooser |
| KSqueezedTextLabel * | labelName |
| KisGradientChooser * | q |
| QSlider * | sliderItemSizeCustom |
| bool | useGlobalViewOptions |
| ViewOptions * | viewOptions |
Static Public Attributes | |
| static QSet< KisGradientChooser * > | globalChoosers |
| static ViewOptions | globalViewOptions |
Private Member Functions | |
| bool | event (QEvent *e) override |
Private Attributes | |
| QScopedPointer< Private > | m_d |
Definition at line 93 of file KisGradientChooser.cpp.
Item sizes.
| Enumerator | |
|---|---|
| ItemSize_Small | Show small items. |
| ItemSize_Medium | Show medium size items. |
| ItemSize_Large | Show large items. |
| ItemSize_Custom | Show items with a custom size. |
Definition at line 44 of file KisGradientChooser.h.
View modes.
| Enumerator | |
|---|---|
| ViewMode_Icon | Show the items as a grid of icons. |
| ViewMode_List | Show the items as a list. |
Definition at line 29 of file KisGradientChooser.h.
| KisGradientChooser::KisGradientChooser | ( | QWidget * | parent = 0, |
| const char * | name = 0, | ||
| bool | useGlobalViewOptions = true ) |
Definition at line 155 of file KisGradientChooser.cpp.
References addSegmentedGradient(), addStopGradient(), connect(), editGradient(), ResourceType::Gradients, loadViewSettings(), m_d, on_actionGroupItemSize_triggered(), on_actionGroupViewMode_triggered(), on_sliderItemSizeCustom_valueChanged(), resourceClicked(), resourceSelected(), KisPopupButton::setPopupWidget(), slotUpdateIcons(), update(), and useGlobalViewOptions.
|
override |
Definition at line 308 of file KisGradientChooser.cpp.
References m_d, and saveViewSettings().
|
slot |
|
slot |
|
slot |
| bool KisGradientChooser::areEditOptionsVisible | ( | ) | const |
Get if the widgets with options to edit the gradient are visible.
| KoCanvasResourcesInterfaceSP KisGradientChooser::canvasResourcesInterface | ( | ) | const |
| KoResourceSP KisGradientChooser::currentResource | ( | bool | includeHidden = false | ) |
Gets the currently selected resource
Definition at line 330 of file KisGradientChooser.cpp.
References m_d.
|
slot |
|
overrideprivate |
Definition at line 467 of file KisGradientChooser.cpp.
References m_d.
|
signal |
Emitted when a resource was changed or added.
| bool KisGradientChooser::isNameLabelVisible | ( | ) | const |
Get if the label showing the gradient name is visible.
| KisGradientChooser::ItemSize KisGradientChooser::itemSize | ( | ) | const |
Tell the size of the gradient preset chooser items.
Definition at line 400 of file KisGradientChooser.cpp.
References m_d.
| int KisGradientChooser::itemSizeCustom | ( | ) | const |
Tell the size (height) in pixels used when KisGradientChooser::ItemSize_Custom is used as the item size.
The default value is 32
Definition at line 405 of file KisGradientChooser.cpp.
References m_d.
| void KisGradientChooser::loadViewSettings | ( | const QString & | prefix = QString() | ) |
Load the view settings from the configuration.
| prefix | string prepended to the settings names |
Definition at line 347 of file KisGradientChooser.cpp.
References ItemSize_Custom, ItemSize_Large, ItemSize_Medium, ItemSize_Small, m_d, ViewMode_Icon, and ViewMode_List.
|
slot |
|
slot |
|
slot |
|
signal |
Emitted when a resource was clicked.
| KisResourceItemChooser * KisGradientChooser::resourceItemChooser | ( | ) | const |
Get a pointer to the item chooser being used.
Definition at line 410 of file KisGradientChooser.cpp.
References m_d.
|
signal |
Emitted when a resource was selected.
| void KisGradientChooser::saveViewSettings | ( | const QString & | prefix = QString() | ) |
Save the view settings to the configuration.
| prefix | string prepended to the settings names |
Definition at line 373 of file KisGradientChooser.cpp.
References ItemSize_Large, ItemSize_Medium, ItemSize_Small, m_d, and ViewMode_Icon.
| void KisGradientChooser::setCanvasResourcesInterface | ( | KoCanvasResourcesInterfaceSP | canvasResourcesInterface | ) |
Definition at line 320 of file KisGradientChooser.cpp.
References canvasResourcesInterface, and m_d.
| void KisGradientChooser::setCurrentItem | ( | int | row | ) |
Definition at line 340 of file KisGradientChooser.cpp.
References currentResource(), and m_d.
| void KisGradientChooser::setCurrentResource | ( | KoResourceSP | resource | ) |
Definition at line 335 of file KisGradientChooser.cpp.
References m_d.
|
slot |
Set if the widgets with options to edit the gradient are visible.
| newNameLabelVisible | true if the edit widgets must be visible, false otherwise |
Definition at line 453 of file KisGradientChooser.cpp.
References m_d.
Set the size of the gradient preset chooser items.
| newItemSize | ItemSize field indicating the size of the gradient preset chooser items |
Definition at line 431 of file KisGradientChooser.cpp.
References m_d.
|
slot |
Set the size (height) in pixels used when KisGradientChooser::ItemSize_Custom is used as the item size.
| newSize | the new custom size |
Definition at line 437 of file KisGradientChooser.cpp.
References m_d.
|
slot |
Set if the label showing the gradient name is visible.
| newNameLabelVisible | true if the label must be visible, false otherwise |
Definition at line 447 of file KisGradientChooser.cpp.
References m_d.
Set if the gradient preset chooser must show the items as a grid of icons or as a list.
| newViewMode | ViewMode field indicating if the gradient preset chooser must show the items as a grid of icons or as a list |
Definition at line 425 of file KisGradientChooser.cpp.
References m_d.
|
slot |
Definition at line 460 of file KisGradientChooser.cpp.
References KisIconUtils::loadIcon(), and m_d.
|
slot |
| void KisGradientChooser::updateContainerSliderItemSizeCustom | ( | ) |
| void KisGradientChooser::updatePresetChooser | ( | bool | globalUpdate = true | ) |
| void KisGradientChooser::updatePresetChooserIcons | ( | ) |
| KisGradientChooser::ViewMode KisGradientChooser::viewMode | ( | ) | const |
Tell if the gradient preset chooser is showing the items as a grid of icons or as a list.
Definition at line 395 of file KisGradientChooser.cpp.
References m_d.
| QAction* KisGradientChooser::actionItemSizeCustom |
Definition at line 124 of file KisGradientChooser.cpp.
| QAction* KisGradientChooser::actionItemSizeLarge |
Definition at line 123 of file KisGradientChooser.cpp.
| QAction* KisGradientChooser::actionItemSizeMedium |
Definition at line 122 of file KisGradientChooser.cpp.
| QAction* KisGradientChooser::actionItemSizeSmall |
Definition at line 121 of file KisGradientChooser.cpp.
| QAction* KisGradientChooser::actionViewModeIcon |
Definition at line 119 of file KisGradientChooser.cpp.
| QAction* KisGradientChooser::actionViewModeList |
Definition at line 120 of file KisGradientChooser.cpp.
| bool KisGradientChooser::areEditOptionsVisible |
Definition at line 134 of file KisGradientChooser.cpp.
| QToolButton* KisGradientChooser::buttonAddGradient |
Definition at line 116 of file KisGradientChooser.cpp.
| QPushButton* KisGradientChooser::buttonEditGradient |
Definition at line 117 of file KisGradientChooser.cpp.
| KoCanvasResourcesInterfaceSP KisGradientChooser::canvasResourcesInterface |
Definition at line 113 of file KisGradientChooser.cpp.
| QWidget* KisGradientChooser::containerEditWidgets |
Definition at line 115 of file KisGradientChooser.cpp.
| QWidget* KisGradientChooser::containerSliderItemSizeCustom |
Definition at line 126 of file KisGradientChooser.cpp.
|
static |
Definition at line 130 of file KisGradientChooser.cpp.
|
static |
Definition at line 129 of file KisGradientChooser.cpp.
| bool KisGradientChooser::isNameLabelVisible |
Definition at line 133 of file KisGradientChooser.cpp.
| KisResourceItemChooser* KisGradientChooser::itemChooser |
Definition at line 111 of file KisGradientChooser.cpp.
| KSqueezedTextLabel* KisGradientChooser::labelName |
Definition at line 110 of file KisGradientChooser.cpp.
|
private |
Definition at line 202 of file KisGradientChooser.h.
| KisGradientChooser* KisGradientChooser::q |
Definition at line 109 of file KisGradientChooser.cpp.
| QSlider* KisGradientChooser::sliderItemSizeCustom |
Definition at line 125 of file KisGradientChooser.cpp.
| bool KisGradientChooser::useGlobalViewOptions |
Definition at line 128 of file KisGradientChooser.cpp.
| ViewOptions* KisGradientChooser::viewOptions |
Definition at line 131 of file KisGradientChooser.cpp.