Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/widgets/kis_paintop_presets_popup.cpp
Context not available. | |||||
91 | setObjectName("KisPaintOpPresetsPopup"); | 91 | setObjectName("KisPaintOpPresetsPopup"); | ||
---|---|---|---|---|---|
92 | setFont(KoDockRegistry::dockFont()); | 92 | setFont(KoDockRegistry::dockFont()); | ||
93 | 93 | | |||
94 | KisConfig cfg(true); | ||||
95 | | ||||
94 | current_paintOpId = ""; | 96 | current_paintOpId = ""; | ||
95 | 97 | | |||
96 | m_d->resourceProvider = resourceProvider; | 98 | m_d->resourceProvider = resourceProvider; | ||
Context not available. | |||||
109 | 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.")); | ||
110 | 112 | | |||
111 | 113 | | |||
112 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setToolTip(i18n("Toggle showing presets")); | 114 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setToolTip(i18n("Reload the brush preset")); | ||
115 | | ||||
116 | | ||||
117 | // brush configuration option menu. | ||||
118 | // these options aren't tied to a brush preset, but affect how they behave, or how brushes behave in general | ||||
119 | brushConfigurationMenu = new QMenu(); | ||||
120 | brushConfigurationMenu->setStyleSheet("margin: 6px"); | ||||
121 | | ||||
122 | | ||||
123 | brushConfigAction = brushConfigurationMenu->addAction(i18n("Show Scratchpad")); | ||||
124 | brushConfigAction->setCheckable(true); | ||||
125 | brushConfigAction->setChecked(cfg.scratchpadVisible()); | ||||
126 | connect(brushConfigAction, SIGNAL(toggled(bool)), this, SLOT(slotSwitchScratchpad(bool))); | ||||
127 | | ||||
128 | | ||||
129 | | ||||
130 | brushConfigAction = brushConfigurationMenu->addAction(i18n("Show Brush Presets")); | ||||
131 | brushConfigAction->setCheckable(true); | ||||
132 | connect(brushConfigAction, SIGNAL(toggled(bool)), this, SLOT(slotSwitchShowPresets(bool))); | ||||
133 | brushConfigAction->setChecked(false); | ||||
134 | slotSwitchShowPresets(false); | ||||
135 | | ||||
136 | | ||||
137 | brushConfigurationMenu->addSeparator(); // we are going from showing to confi. so add a separator | ||||
138 | | ||||
139 | | ||||
140 | brushConfigAction = brushConfigurationMenu->addAction(i18n("Eraser Switch Size")); | ||||
141 | connect(brushConfigAction, SIGNAL(toggled(bool)), this, SIGNAL(eraserBrushSizeToggled(bool))); | ||||
142 | brushConfigAction->setCheckable(true); | ||||
143 | brushConfigAction->setChecked(cfg.useEraserBrushSize()); | ||||
144 | eraserBrushSizeToggled(cfg.useEraserBrushSize()); | ||||
145 | | ||||
146 | brushConfigAction = brushConfigurationMenu->addAction(i18n("Eraser Switch Opacity")); | ||||
147 | connect(brushConfigAction, SIGNAL(toggled(bool)),this, SIGNAL(eraserBrushOpacityToggled(bool))); | ||||
148 | brushConfigAction->setCheckable(true); | ||||
149 | brushConfigAction->setChecked(false); | ||||
150 | eraserBrushOpacityToggled(cfg.useEraserBrushOpacity()); | ||||
151 | | ||||
152 | brushConfigAction = brushConfigurationMenu->addAction(i18n("Temporarily Save Brush Presets")); | ||||
153 | connect(brushConfigAction, SIGNAL(toggled(bool)),this, SIGNAL(dirtyPresetToggled(bool))); | ||||
154 | brushConfigAction->setCheckable(true); | ||||
155 | brushConfigAction->setChecked(cfg.useDirtyPresets()); | ||||
156 | dirtyPresetToggled(cfg.useDirtyPresets()); | ||||
157 | | ||||
158 | brushConfigAction = brushConfigurationMenu->addAction(i18n("Rename Brush Preset")); | ||||
159 | brushConfigAction->setCheckable(false); | ||||
160 | connect (brushConfigAction, SIGNAL(triggered(bool)), this, SLOT(slotRenameBrushActivated())); | ||||
161 | | ||||
162 | brushConfigurationMenu->addSeparator(); // we are going from showing to confi. so add a separator | ||||
163 | | ||||
164 | // section for customizing/showing live brush preview | ||||
165 | brushConfigAction = brushConfigurationMenu->addAction(i18n("Show Brush Preview Area")); | ||||
166 | brushConfigAction->setCheckable(true); | ||||
167 | brushConfigAction->setChecked(true); | ||||
168 | connect(brushConfigAction, SIGNAL(toggled(bool)),this, SLOT(slotShowBrushPreviewArea(bool))); | ||||
113 | 169 | | |||
114 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setToolTip(i18n("Toggle showing scratchpad")); | | |||
115 | 170 | | |||
116 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setToolTip(i18n("Reload the brush preset")); | 171 | | ||
117 | m_d->uiWdgPaintOpPresetSettings.renameBrushPresetButton->setToolTip(i18n("Rename the brush preset")); | 172 | // Change live preview size | ||
173 | QSlider* livePreviewSizeSlider = new QSlider(this); | ||||
174 | livePreviewSizeSlider->setOrientation(Qt::Horizontal); | ||||
175 | livePreviewSizeSlider->setRange(30, 90); | ||||
176 | livePreviewSizeSlider->setValue(50); | ||||
177 | livePreviewSizeSlider->setMinimumHeight(30); | ||||
178 | livePreviewSizeSlider->setMinimumWidth(90); | ||||
179 | livePreviewSizeSlider->setTickInterval(5); | ||||
180 | | ||||
181 | | ||||
182 | QWidgetAction *livePreviewSliderAction= new QWidgetAction(this); | ||||
183 | livePreviewSliderAction->setDefaultWidget(livePreviewSizeSlider); | ||||
184 | connect(livePreviewSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(slotLivePreviewSizeChanged(int))); | ||||
185 | | ||||
186 | brushConfigurationMenu->addSection(i18n("Brush Preview Size:")); | ||||
187 | brushConfigurationMenu->addAction(livePreviewSliderAction); | ||||
188 | | ||||
189 | | ||||
190 | | ||||
191 | | ||||
192 | | ||||
193 | | ||||
194 | | ||||
195 | | ||||
196 | | ||||
197 | | ||||
198 | | ||||
199 | | ||||
200 | | ||||
201 | | ||||
202 | m_d->uiWdgPaintOpPresetSettings.configureBrushesToolButton->setMenu(brushConfigurationMenu); | ||||
203 | m_d->uiWdgPaintOpPresetSettings.configureBrushesToolButton->setIcon(KisIconUtils::loadIcon("configure")); | ||||
204 | m_d->uiWdgPaintOpPresetSettings.configureBrushesToolButton->setPopupMode(QToolButton::InstantPopup); | ||||
118 | 205 | | |||
119 | 206 | | |||
120 | // creating a new preset from scratch. Part of the brush presets area | 207 | // creating a new preset from scratch. Part of the brush presets area | ||
Context not available. | |||||
172 | 259 | | |||
173 | // configure the button and assign menu | 260 | // configure the button and assign menu | ||
174 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setMenu(menu); | 261 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setMenu(menu); | ||
175 | 262 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setIcon(KisIconUtils::loadIcon("view-list-details")); | |||
176 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setPopupMode(QToolButton::InstantPopup); | 263 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setPopupMode(QToolButton::InstantPopup); | ||
177 | 264 | | |||
178 | 265 | | |||
Context not available. | |||||
181 | 268 | | |||
182 | 269 | | |||
183 | // show/hide buttons | 270 | // show/hide buttons | ||
184 | 271 | slotSwitchScratchpad(cfg.scratchpadVisible()); | |||
185 | KisConfig cfg(true); | | |||
186 | | ||||
187 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setCheckable(true); | | |||
188 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setChecked(cfg.scratchpadVisible()); | | |||
189 | | ||||
190 | if (cfg.scratchpadVisible()) { | | |||
191 | slotSwitchScratchpad(true); // show scratchpad | | |||
192 | } else { | | |||
193 | slotSwitchScratchpad(false); | | |||
194 | } | | |||
195 | | ||||
196 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setCheckable(true); | | |||
197 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setChecked(false); | | |||
198 | slotSwitchShowPresets(false); // hide presets by default | | |||
199 | | ||||
200 | 272 | | |||
201 | // Connections | 273 | // Connections | ||
202 | connect(m_d->uiWdgPaintOpPresetSettings.paintPresetIcon, SIGNAL(clicked()), | 274 | connect(m_d->uiWdgPaintOpPresetSettings.paintPresetIcon, SIGNAL(clicked()), | ||
Context not available. | |||||
204 | 276 | | |||
205 | connect(saveDialog, SIGNAL(resourceSelected(KoResource*)), this, SLOT(resourceSelected(KoResource*))); | 277 | connect(saveDialog, SIGNAL(resourceSelected(KoResource*)), this, SLOT(resourceSelected(KoResource*))); | ||
206 | 278 | | |||
207 | connect (m_d->uiWdgPaintOpPresetSettings.renameBrushPresetButton, SIGNAL(clicked(bool)), | 279 | | ||
208 | this, SLOT(slotRenameBrushActivated())); | | |||
209 | 280 | | |||
210 | connect (m_d->uiWdgPaintOpPresetSettings.cancelBrushNameUpdateButton, SIGNAL(clicked(bool)), | 281 | connect (m_d->uiWdgPaintOpPresetSettings.cancelBrushNameUpdateButton, SIGNAL(clicked(bool)), | ||
211 | this, SLOT(slotRenameBrushDeactivated())); | 282 | this, SLOT(slotRenameBrushDeactivated())); | ||
Context not available. | |||||
222 | connect(iconSizeSlider, SIGNAL(sliderReleased()), | 293 | connect(iconSizeSlider, SIGNAL(sliderReleased()), | ||
223 | m_d->uiWdgPaintOpPresetSettings.presetWidget, SLOT(slotSaveIconSize())); | 294 | m_d->uiWdgPaintOpPresetSettings.presetWidget, SLOT(slotSaveIconSize())); | ||
224 | 295 | | |||
225 | | ||||
226 | connect(m_d->uiWdgPaintOpPresetSettings.showScratchpadButton, SIGNAL(clicked(bool)), | | |||
227 | this, SLOT(slotSwitchScratchpad(bool))); | | |||
228 | | ||||
229 | | ||||
230 | connect(m_d->uiWdgPaintOpPresetSettings.showPresetsButton, SIGNAL(clicked(bool)), this, SLOT(slotSwitchShowPresets(bool))); | | |||
231 | | ||||
232 | connect(m_d->uiWdgPaintOpPresetSettings.eraseScratchPad, SIGNAL(clicked()), | 296 | connect(m_d->uiWdgPaintOpPresetSettings.eraseScratchPad, SIGNAL(clicked()), | ||
233 | m_d->uiWdgPaintOpPresetSettings.scratchPad, SLOT(fillDefault())); | 297 | m_d->uiWdgPaintOpPresetSettings.scratchPad, SLOT(fillDefault())); | ||
234 | 298 | | |||
Context not available. | |||||
254 | connect(m_d->uiWdgPaintOpPresetSettings.reloadPresetButton, SIGNAL(clicked()), | 318 | connect(m_d->uiWdgPaintOpPresetSettings.reloadPresetButton, SIGNAL(clicked()), | ||
255 | this, SIGNAL(reloadPresetClicked())); | 319 | this, SIGNAL(reloadPresetClicked())); | ||
256 | 320 | | |||
257 | connect(m_d->uiWdgPaintOpPresetSettings.dirtyPresetCheckBox, SIGNAL(toggled(bool)), | | |||
258 | this, SIGNAL(dirtyPresetToggled(bool))); | | |||
259 | | ||||
260 | connect(m_d->uiWdgPaintOpPresetSettings.eraserBrushSizeCheckBox, SIGNAL(toggled(bool)), | | |||
261 | this, SIGNAL(eraserBrushSizeToggled(bool))); | | |||
262 | | ||||
263 | connect(m_d->uiWdgPaintOpPresetSettings.eraserBrushOpacityCheckBox, SIGNAL(toggled(bool)), | | |||
264 | this, SIGNAL(eraserBrushOpacityToggled(bool))); | | |||
265 | | ||||
266 | 321 | | |||
267 | // preset widget connections | 322 | // preset widget connections | ||
268 | connect(m_d->uiWdgPaintOpPresetSettings.presetWidget->smallPresetChooser, SIGNAL(resourceSelected(KoResource*)), | 323 | connect(m_d->uiWdgPaintOpPresetSettings.presetWidget->smallPresetChooser, SIGNAL(resourceSelected(KoResource*)), | ||
Context not available. | |||||
280 | m_d->minimumSettingsWidgetSize = QSize(0, 0); | 335 | m_d->minimumSettingsWidgetSize = QSize(0, 0); | ||
281 | 336 | | |||
282 | m_d->detachedGeometry = QRect(100, 100, 0, 0); | 337 | m_d->detachedGeometry = QRect(100, 100, 0, 0); | ||
283 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetCheckBox->setChecked(cfg.useDirtyPresets()); | | |||
284 | m_d->uiWdgPaintOpPresetSettings.eraserBrushSizeCheckBox->setChecked(cfg.useEraserBrushSize()); | | |||
285 | m_d->uiWdgPaintOpPresetSettings.eraserBrushOpacityCheckBox->setChecked(cfg.useEraserBrushOpacity()); | | |||
286 | 338 | | |||
287 | m_d->uiWdgPaintOpPresetSettings.wdgLodAvailability->setCanvasResourceManager(resourceProvider->resourceManager()); | 339 | m_d->uiWdgPaintOpPresetSettings.wdgLodAvailability->setCanvasResourceManager(resourceProvider->resourceManager()); | ||
288 | 340 | | |||
Context not available. | |||||
318 | 370 | | |||
319 | } | 371 | } | ||
320 | 372 | | |||
373 | void KisPaintOpPresetsPopup::slotLivePreviewSizeChanged(int previewSize) | ||||
374 | { | ||||
375 | m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView->setMinimumHeight(previewSize); | ||||
376 | m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView->setMaximumHeight(previewSize); | ||||
377 | | ||||
378 | // re-generates canvas and config | ||||
379 | m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView->setup(); | ||||
380 | m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView->updateStroke(); | ||||
381 | } | ||||
382 | | ||||
321 | void KisPaintOpPresetsPopup::slotBlackListCurrentPreset() | 383 | void KisPaintOpPresetsPopup::slotBlackListCurrentPreset() | ||
322 | { | 384 | { | ||
323 | KisPaintOpPresetResourceServer * rServer = KisResourceServerProvider::instance()->paintOpPresetServer(); | 385 | KisPaintOpPresetResourceServer * rServer = KisResourceServerProvider::instance()->paintOpPresetServer(); | ||
Context not available. | |||||
328 | } | 390 | } | ||
329 | } | 391 | } | ||
330 | 392 | | |||
393 | void KisPaintOpPresetsPopup::slotShowBrushPreviewArea(bool showLiveBrushPreview) | ||||
394 | { | ||||
395 | m_d->uiWdgPaintOpPresetSettings.liveBrushPreviewView->setVisible(showLiveBrushPreview); | ||||
396 | } | ||||
331 | 397 | | |||
332 | void KisPaintOpPresetsPopup::slotRenameBrushActivated() | 398 | void KisPaintOpPresetsPopup::slotRenameBrushActivated() | ||
333 | { | 399 | { | ||
Context not available. | |||||
349 | 415 | | |||
350 | // hide these below areas while renaming | 416 | // hide these below areas while renaming | ||
351 | m_d->uiWdgPaintOpPresetSettings.currentBrushNameLabel->setVisible(!isRenaming); | 417 | m_d->uiWdgPaintOpPresetSettings.currentBrushNameLabel->setVisible(!isRenaming); | ||
352 | m_d->uiWdgPaintOpPresetSettings.renameBrushPresetButton->setVisible(!isRenaming); | | |||
353 | m_d->uiWdgPaintOpPresetSettings.saveBrushPresetButton->setEnabled(!isRenaming); | 418 | m_d->uiWdgPaintOpPresetSettings.saveBrushPresetButton->setEnabled(!isRenaming); | ||
354 | m_d->uiWdgPaintOpPresetSettings.saveBrushPresetButton->setVisible(!isRenaming); | 419 | m_d->uiWdgPaintOpPresetSettings.saveBrushPresetButton->setVisible(!isRenaming); | ||
355 | m_d->uiWdgPaintOpPresetSettings.saveNewBrushPresetButton->setEnabled(!isRenaming); | 420 | m_d->uiWdgPaintOpPresetSettings.saveNewBrushPresetButton->setEnabled(!isRenaming); | ||
Context not available. | |||||
446 | } | 511 | } | ||
447 | delete m_d; | 512 | delete m_d; | ||
448 | delete newPresetBrushEnginesMenu; | 513 | delete newPresetBrushEnginesMenu; | ||
514 | delete brushConfigurationMenu; | ||||
449 | } | 515 | } | ||
450 | 516 | | |||
451 | void KisPaintOpPresetsPopup::setPaintOpSettingsWidget(QWidget * widget) | 517 | void KisPaintOpPresetsPopup::setPaintOpSettingsWidget(QWidget * widget) | ||
Context not available. | |||||
454 | m_d->layout->removeWidget(m_d->settingsWidget); | 520 | m_d->layout->removeWidget(m_d->settingsWidget); | ||
455 | m_d->uiWdgPaintOpPresetSettings.frmOptionWidgetContainer->updateGeometry(); | 521 | m_d->uiWdgPaintOpPresetSettings.frmOptionWidgetContainer->updateGeometry(); | ||
456 | } | 522 | } | ||
523 | | ||||
457 | m_d->layout->update(); | 524 | m_d->layout->update(); | ||
458 | updateGeometry(); | 525 | updateGeometry(); | ||
459 | 526 | | |||
Context not available. | |||||
477 | 544 | | |||
478 | widget->setFont(m_d->smallFont); | 545 | widget->setFont(m_d->smallFont); | ||
479 | 546 | | |||
547 | | ||||
480 | QSize hint = widget->sizeHint(); | 548 | QSize hint = widget->sizeHint(); | ||
481 | m_d->minimumSettingsWidgetSize = QSize(qMax(hint.width(), m_d->minimumSettingsWidgetSize.width()), | 549 | m_d->minimumSettingsWidgetSize = QSize(qMax(hint.width(), m_d->minimumSettingsWidgetSize.width()), | ||
482 | qMax(hint.height(), m_d->minimumSettingsWidgetSize.height())); | 550 | qMax(hint.height(), m_d->minimumSettingsWidgetSize.height())); | ||
483 | widget->setMinimumSize(m_d->minimumSettingsWidgetSize); | 551 | widget->setMinimumSize(m_d->minimumSettingsWidgetSize); | ||
552 | /**/ | ||||
553 | // manually control the brush settings size for now to help see what is taking up the most space | ||||
554 | //widget->setMaximumHeight(640); | ||||
555 | //widget->setMaximumWidth(600); | ||||
556 | | ||||
484 | m_d->layout->addWidget(widget); | 557 | m_d->layout->addWidget(widget); | ||
485 | 558 | | |||
486 | // hook up connections that will monitor if our preset is dirty or not. Show a notification if it is | 559 | // hook up connections that will monitor if our preset is dirty or not. Show a notification if it is | ||
Context not available. | |||||
686 | void KisPaintOpPresetsPopup::slotSwitchScratchpad(bool visible) | 759 | void KisPaintOpPresetsPopup::slotSwitchScratchpad(bool visible) | ||
687 | { | 760 | { | ||
688 | // hide all the internal controls except the toggle button | 761 | // hide all the internal controls except the toggle button | ||
762 | /* | ||||
689 | m_d->uiWdgPaintOpPresetSettings.scratchPad->setVisible(visible); | 763 | m_d->uiWdgPaintOpPresetSettings.scratchPad->setVisible(visible); | ||
690 | m_d->uiWdgPaintOpPresetSettings.paintPresetIcon->setVisible(visible); | 764 | m_d->uiWdgPaintOpPresetSettings.paintPresetIcon->setVisible(visible); | ||
691 | m_d->uiWdgPaintOpPresetSettings.fillGradient->setVisible(visible); | 765 | m_d->uiWdgPaintOpPresetSettings.fillGradient->setVisible(visible); | ||
Context not available. | |||||
693 | m_d->uiWdgPaintOpPresetSettings.fillSolid->setVisible(visible); | 767 | m_d->uiWdgPaintOpPresetSettings.fillSolid->setVisible(visible); | ||
694 | m_d->uiWdgPaintOpPresetSettings.eraseScratchPad->setVisible(visible); | 768 | m_d->uiWdgPaintOpPresetSettings.eraseScratchPad->setVisible(visible); | ||
695 | m_d->uiWdgPaintOpPresetSettings.scratchpadSidebarLabel->setVisible(visible); | 769 | m_d->uiWdgPaintOpPresetSettings.scratchpadSidebarLabel->setVisible(visible); | ||
770 | */ | ||||
696 | 771 | | |||
697 | if (visible) { | 772 | m_d->uiWdgPaintOpPresetSettings.scratchpadControls->setVisible(visible); | ||
698 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setIcon(KisIconUtils::loadIcon("arrow-left")); | | |||
699 | } else { | | |||
700 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setIcon(KisIconUtils::loadIcon("arrow-right")); | | |||
701 | } | | |||
702 | 773 | | |||
703 | KisConfig cfg(false); | 774 | KisConfig cfg(false); | ||
704 | cfg.setScratchpadVisible(visible); | 775 | cfg.setScratchpadVisible(visible); | ||
705 | } | 776 | } | ||
706 | 777 | | |||
707 | void KisPaintOpPresetsPopup::slotSwitchShowEditor(bool visible) { | 778 | void KisPaintOpPresetsPopup::slotSwitchShowEditor(bool visible) { | ||
708 | m_d->uiWdgPaintOpPresetSettings.brushEditorSettingsControls->setVisible(visible); | 779 | // m_d->uiWdgPaintOpPresetSettings.brushEditorSettingsControls->setVisible(visible); | ||
709 | } | 780 | } | ||
710 | 781 | | |||
711 | void KisPaintOpPresetsPopup::slotSwitchShowPresets(bool visible) { | 782 | void KisPaintOpPresetsPopup::slotSwitchShowPresets(bool visible) { | ||
712 | 783 | | |||
784 | /* | ||||
713 | m_d->uiWdgPaintOpPresetSettings.presetWidget->setVisible(visible); | 785 | m_d->uiWdgPaintOpPresetSettings.presetWidget->setVisible(visible); | ||
714 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setVisible(visible); | 786 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setVisible(visible); | ||
715 | m_d->uiWdgPaintOpPresetSettings.brushEgineComboBox->setVisible(visible); | 787 | m_d->uiWdgPaintOpPresetSettings.brushEgineComboBox->setVisible(visible); | ||
Context not available. | |||||
717 | m_d->uiWdgPaintOpPresetSettings.presetsSidebarLabel->setVisible(visible); | 789 | m_d->uiWdgPaintOpPresetSettings.presetsSidebarLabel->setVisible(visible); | ||
718 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setVisible(visible); | 790 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setVisible(visible); | ||
719 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setVisible(visible); | 791 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setVisible(visible); | ||
792 | */ | ||||
793 | | ||||
794 | m_d->uiWdgPaintOpPresetSettings.presetsContainer->setVisible(visible); | ||||
720 | 795 | | |||
721 | // we only want a spacer to work when the toggle icon is present. Otherwise the list of presets will shrink | | |||
722 | // which is something we don't want | | |||
723 | if (visible) { | | |||
724 | m_d->uiWdgPaintOpPresetSettings.presetsSpacer->changeSize(0,0, QSizePolicy::Ignored,QSizePolicy::Ignored); | | |||
725 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setIcon(KisIconUtils::loadIcon("arrow-right")); | | |||
726 | } else { | | |||
727 | m_d->uiWdgPaintOpPresetSettings.presetsSpacer->changeSize(0,0, QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding); | | |||
728 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setIcon(KisIconUtils::loadIcon("arrow-left")); | | |||
729 | } | | |||
730 | 796 | | |||
731 | } | 797 | } | ||
732 | 798 | | |||
Context not available. | |||||
789 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setIcon(KisIconUtils::loadIcon("addlayer")); | 855 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setIcon(KisIconUtils::loadIcon("addlayer")); | ||
790 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setIcon(KisIconUtils::loadIcon("deletelayer")); | 856 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setIcon(KisIconUtils::loadIcon("deletelayer")); | ||
791 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setIcon(KisIconUtils::loadIcon("updateColorize")); // refresh icon | 857 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setIcon(KisIconUtils::loadIcon("updateColorize")); // refresh icon | ||
792 | m_d->uiWdgPaintOpPresetSettings.renameBrushPresetButton->setIcon(KisIconUtils::loadIcon("dirty-preset")); // edit icon | | |||
793 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setIcon(KisIconUtils::loadIcon("warning")); | 858 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setIcon(KisIconUtils::loadIcon("warning")); | ||
794 | 859 | | |||
795 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setIcon(KisIconUtils::loadIcon("addlayer")); | 860 | m_d->uiWdgPaintOpPresetSettings.newPresetEngineButton->setIcon(KisIconUtils::loadIcon("addlayer")); | ||
796 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setIcon(KisIconUtils::loadIcon("deletelayer")); | 861 | m_d->uiWdgPaintOpPresetSettings.bnBlacklistPreset->setIcon(KisIconUtils::loadIcon("deletelayer")); | ||
797 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setIcon(KisIconUtils::loadIcon("configure")); | 862 | m_d->uiWdgPaintOpPresetSettings.presetChangeViewToolButton->setIcon(KisIconUtils::loadIcon("configure")); | ||
798 | 863 | m_d->uiWdgPaintOpPresetSettings.configureBrushesToolButton->setIcon(KisIconUtils::loadIcon("configure")); | |||
799 | // if we cannot see the "Preset label", we know it is not visible | | |||
800 | // maybe this can also be stored in the config like the scratchpad? | | |||
801 | if (m_d->uiWdgPaintOpPresetSettings.presetsSidebarLabel->isVisible()) { | | |||
802 | m_d->uiWdgPaintOpPresetSettings.presetsSpacer->changeSize(0,0, QSizePolicy::Ignored,QSizePolicy::Ignored); | | |||
803 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setIcon(KisIconUtils::loadIcon("arrow-right")); | | |||
804 | } else { | | |||
805 | m_d->uiWdgPaintOpPresetSettings.presetsSpacer->changeSize(0,0, QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding); | | |||
806 | m_d->uiWdgPaintOpPresetSettings.showPresetsButton->setIcon(KisIconUtils::loadIcon("arrow-left")); | | |||
807 | } | | |||
808 | | ||||
809 | // we store whether the scratchpad if visible in the config. | | |||
810 | KisConfig cfg(true); | | |||
811 | if (cfg.scratchpadVisible()) { | | |||
812 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setIcon(KisIconUtils::loadIcon("arrow-left")); | | |||
813 | } else { | | |||
814 | m_d->uiWdgPaintOpPresetSettings.showScratchpadButton->setIcon(KisIconUtils::loadIcon("arrow-right")); | | |||
815 | } | | |||
816 | } | 864 | } | ||
817 | 865 | | |||
818 | void KisPaintOpPresetsPopup::slotUpdatePresetSettings() | 866 | void KisPaintOpPresetsPopup::slotUpdatePresetSettings() | ||
Context not available. | |||||
830 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setVisible(false); | 878 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setVisible(false); | ||
831 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setVisible(false); | 879 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setVisible(false); | ||
832 | m_d->uiWdgPaintOpPresetSettings.saveBrushPresetButton->setVisible(false); | 880 | m_d->uiWdgPaintOpPresetSettings.saveBrushPresetButton->setVisible(false); | ||
833 | m_d->uiWdgPaintOpPresetSettings.renameBrushPresetButton->setVisible(false); | | |||
834 | } else { | 881 | } else { | ||
835 | bool isPresetDirty = m_d->resourceProvider->currentPreset()->isPresetDirty(); | 882 | bool isPresetDirty = m_d->resourceProvider->currentPreset()->isPresetDirty(); | ||
836 | 883 | | |||
Context not available. | |||||
838 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setVisible(isPresetDirty); | 885 | m_d->uiWdgPaintOpPresetSettings.dirtyPresetIndicatorButton->setVisible(isPresetDirty); | ||
839 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setVisible(isPresetDirty); | 886 | m_d->uiWdgPaintOpPresetSettings.reloadPresetButton->setVisible(isPresetDirty); | ||
840 | m_d->uiWdgPaintOpPresetSettings.saveBrushPresetButton->setEnabled(isPresetDirty); | 887 | m_d->uiWdgPaintOpPresetSettings.saveBrushPresetButton->setEnabled(isPresetDirty); | ||
841 | m_d->uiWdgPaintOpPresetSettings.renameBrushPresetButton->setVisible(true); | | |||
842 | } | 888 | } | ||
843 | 889 | | |||
844 | // update live preview area in here... | 890 | // update live preview area in here... | ||
Context not available. |