Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/widgets/kis_paintop_presets_popup.cpp
Context not available. | |||||
105 | 105 | | |||
---|---|---|---|---|---|
106 | m_d->uiWdgPaintOpPresetSettings.scratchPad->setupScratchPad(resourceProvider, Qt::white); | 106 | m_d->uiWdgPaintOpPresetSettings.scratchPad->setupScratchPad(resourceProvider, Qt::white); | ||
107 | m_d->uiWdgPaintOpPresetSettings.scratchPad->setCutoutOverlayRect(QRect(25, 25, 200, 200)); | 107 | m_d->uiWdgPaintOpPresetSettings.scratchPad->setCutoutOverlayRect(QRect(25, 25, 200, 200)); | ||
108 | m_d->uiWdgPaintOpPresetSettings.paintPresetIcon->setIcon(KisIconUtils::loadIcon("krita_tool_freehand")); | | |||
109 | 108 | | |||
110 | m_d->uiWdgPaintOpPresetSettings.fillLayer->setIcon(KisIconUtils::loadIcon("document-new")); | | |||
111 | m_d->uiWdgPaintOpPresetSettings.fillLayer->hide(); | | |||
112 | m_d->uiWdgPaintOpPresetSettings.fillGradient->setIcon(KisIconUtils::loadIcon("krita_tool_gradient")); | | |||
113 | m_d->uiWdgPaintOpPresetSettings.fillSolid->setIcon(KisIconUtils::loadIcon("krita_tool_color_fill")); | | |||
114 | m_d->uiWdgPaintOpPresetSettings.eraseScratchPad->setIcon(KisIconUtils::loadIcon("edit-delete")); | | |||
115 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setIcon(KisIconUtils::loadIcon("updateColorize")); // refresh icon | | |||
116 | m_d->uiWdgPaintOpPresetSettings.renameBrushPresetButton->setIcon(KisIconUtils::loadIcon("dirty-preset")); // edit icon | | |||
117 | 109 | | |||
118 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setIcon(KisIconUtils::loadIcon("warning")); | 110 | | ||
119 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setToolTip(i18n("The settings for this preset have changed from their default.")); | 111 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setToolTip(i18n("The settings for this preset have changed from their default.")); | ||
120 | 112 | | |||
121 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setIcon(KisIconUtils::loadIcon("paintop_settings_02")); | 113 | | ||
122 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setToolTip(i18n("Toggle showing presets")); | 114 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setToolTip(i18n("Toggle showing presets")); | ||
123 | 115 | | |||
124 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setToolTip(i18n("Toggle showing scratchpad")); | 116 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setToolTip(i18n("Toggle showing scratchpad")); | ||
Context not available. | |||||
182 | 174 | | |||
183 | // configure the button and assign menu | 175 | // configure the button and assign menu | ||
184 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setMenu(menu); | 176 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setMenu(menu); | ||
185 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setIcon(KisIconUtils::loadIcon("view-choose")); | 177 | | ||
186 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setPopupMode(QToolButton::InstantPopup); | 178 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setPopupMode(QToolButton::InstantPopup); | ||
187 | 179 | | |||
188 | 180 | | |||
189 | // loading preset from scratch option | 181 | // loading preset from scratch option | ||
190 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setPopupMode(QToolButton::InstantPopup); | 182 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setPopupMode(QToolButton::InstantPopup); | ||
191 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setIcon(KisIconUtils::loadIcon("addlayer")); | 183 | | ||
192 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setIcon(KisIconUtils::loadIcon("deletelayer")); | | |||
193 | 184 | | |||
194 | // show/hide buttons | 185 | // show/hide buttons | ||
195 | 186 | | |||
Context not available. | |||||
322 | 313 | | |||
323 | connect(m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset, SIGNAL(clicked()), this, SLOT(slotBlackListCurrentPreset())); | 314 | connect(m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset, SIGNAL(clicked()), this, SLOT(slotBlackListCurrentPreset())); | ||
324 | 315 | | |||
316 | updateThemedIcons(); | ||||
325 | 317 | | |||
326 | // setup things like the scene construct images, layers, etc that is a one-time thing | 318 | // setup things like the scene construct images, layers, etc that is a one-time thing | ||
327 | m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView->setup(); | 319 | m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView->setup(); | ||
Context not available. | |||||
808 | 800 | | |||
809 | void KisPaintOpPresetsPopup::updateThemedIcons() | 801 | void KisPaintOpPresetsPopup::updateThemedIcons() | ||
810 | { | 802 | { | ||
803 | m_d->uiWdgPaintOpPresetSettings.paintPresetIcon->setIcon(KisIconUtils::loadIcon("krita_tool_freehand")); | ||||
811 | m_d->uiWdgPaintOpPresetSettings.fillLayer->setIcon(KisIconUtils::loadIcon("document-new")); | 804 | m_d->uiWdgPaintOpPresetSettings.fillLayer->setIcon(KisIconUtils::loadIcon("document-new")); | ||
812 | m_d->uiWdgPaintOpPresetSettings.fillLayer->hide(); | 805 | m_d->uiWdgPaintOpPresetSettings.fillLayer->hide(); | ||
813 | m_d->uiWdgPaintOpPresetSettings.fillGradient->setIcon(KisIconUtils::loadIcon("krita_tool_gradient")); | 806 | m_d->uiWdgPaintOpPresetSettings.fillGradient->setIcon(KisIconUtils::loadIcon("krita_tool_gradient")); | ||
814 | m_d->uiWdgPaintOpPresetSettings.fillSolid->setIcon(KisIconUtils::loadIcon("krita_tool_color_fill")); | 807 | m_d->uiWdgPaintOpPresetSettings.fillSolid->setIcon(KisIconUtils::loadIcon("krita_tool_color_fill")); | ||
815 | m_d->uiWdgPaintOpPresetSettings.eraseScratchPad->setIcon(KisIconUtils::loadIcon("edit-delete")); | 808 | m_d->uiWdgPaintOpPresetSettings.eraseScratchPad->setIcon(KisIconUtils::loadIcon("edit-delete")); | ||
816 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setIcon(KisIconUtils::loadIcon("view-choose")); | 809 | | ||
810 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setIcon(KisIconUtils::loadIcon("addlayer")); | ||||
811 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setIcon(KisIconUtils::loadIcon("deletelayer")); | ||||
812 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setIcon(KisIconUtils::loadIcon("updateColorize")); // refresh icon | ||||
813 | m_d->uiWdgPaintOpPresetSettings.renameBrushPresetButton->setIcon(KisIconUtils::loadIcon("dirty-preset")); // edit icon | ||||
814 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setIcon(KisIconUtils::loadIcon("warning")); | ||||
815 | | ||||
817 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setIcon(KisIconUtils::loadIcon("addlayer")); | 816 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setIcon(KisIconUtils::loadIcon("addlayer")); | ||
818 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setIcon(KisIconUtils::loadIcon("deletelayer")); | 817 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setIcon(KisIconUtils::loadIcon("deletelayer")); | ||
818 | | ||||
819 | | ||||
820 | | ||||
821 | // if we cannot see the "Preset label", we know it is not visible | ||||
822 | // maybe this can also be stored in the config like the scratchpad? | ||||
823 | if (m_d->uiWdgPaintOpPresetSettings.presetsSidebarLabel->isVisible()) { | ||||
824 | m_d->uiWdgPaintOpPresetSettings.presetsSpacer->changeSize(0,0, QSizePolicy::Ignored,QSizePolicy::Ignored); | ||||
825 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setIcon(KisIconUtils::loadIcon("arrow-right")); | ||||
826 | } else { | ||||
827 | m_d->uiWdgPaintOpPresetSettings.presetsSpacer->changeSize(0,0, QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding); | ||||
828 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setIcon(KisIconUtils::loadIcon("arrow-left")); | ||||
829 | } | ||||
830 | | ||||
831 | // we store whether the scratchpad if visible in the config. | ||||
832 | KisConfig cfg; | ||||
833 | if (cfg.scratchpadVisible()) { | ||||
834 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setIcon(KisIconUtils::loadIcon("arrow-left")); | ||||
835 | } else { | ||||
836 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setIcon(KisIconUtils::loadIcon("arrow-right")); | ||||
837 | } | ||||
838 | | ||||
839 | | ||||
840 | | ||||
841 | | ||||
842 | | ||||
843 | | ||||
819 | } | 844 | } | ||
820 | 845 | | |||
821 | void KisPaintOpPresetsPopup::slotUpdatePresetSettings() | 846 | void KisPaintOpPresetsPopup::slotUpdatePresetSettings() | ||
Context not available. |