Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/kis_paintop_box.cc
Context not available. | |||||
454 | connect(m_presetsPopup , SIGNAL(eraserBrushSizeToggled(bool)) , SLOT(slotEraserBrushSizeToggled(bool))); | 454 | connect(m_presetsPopup , SIGNAL(eraserBrushSizeToggled(bool)) , SLOT(slotEraserBrushSizeToggled(bool))); | ||
---|---|---|---|---|---|
455 | connect(m_presetsPopup , SIGNAL(eraserBrushOpacityToggled(bool)) , SLOT(slotEraserBrushOpacityToggled(bool))); | 455 | connect(m_presetsPopup , SIGNAL(eraserBrushOpacityToggled(bool)) , SLOT(slotEraserBrushOpacityToggled(bool))); | ||
456 | 456 | | |||
457 | connect(m_presetsPopup, SIGNAL(createPresetFromScratch(QString)), this, SLOT(slotCreatePresetFromScratch(QString))); | ||||
458 | | ||||
457 | connect(m_presetsChooserPopup, SIGNAL(resourceSelected(KoResource*)) , SLOT(resourceSelected(KoResource*))); | 459 | connect(m_presetsChooserPopup, SIGNAL(resourceSelected(KoResource*)) , SLOT(resourceSelected(KoResource*))); | ||
458 | connect(m_presetsChooserPopup, SIGNAL(resourceClicked(KoResource*)) , SLOT(resourceSelected(KoResource*))); | 460 | connect(m_presetsChooserPopup, SIGNAL(resourceClicked(KoResource*)) , SLOT(resourceSelected(KoResource*))); | ||
459 | 461 | | |||
Context not available. | |||||
546 | 548 | | |||
547 | void KisPaintopBox::resourceSelected(KoResource* resource) | 549 | void KisPaintopBox::resourceSelected(KoResource* resource) | ||
548 | { | 550 | { | ||
551 | m_presetsPopup->setCreatingBrushFromScratch(false); // show normal UI elements when we are not creating | ||||
552 | | ||||
549 | KisPaintOpPreset* preset = dynamic_cast<KisPaintOpPreset*>(resource); | 553 | KisPaintOpPreset* preset = dynamic_cast<KisPaintOpPreset*>(resource); | ||
550 | if (preset && preset != m_resourceProvider->currentPreset()) { | 554 | if (preset && preset != m_resourceProvider->currentPreset()) { | ||
551 | if (!preset->settings()->isLoadable()) | 555 | if (!preset->settings()->isLoadable()) | ||
Context not available. | |||||
563 | m_presetsPopup->setPresetImage(preset->image()); | 567 | m_presetsPopup->setPresetImage(preset->image()); | ||
564 | m_presetsPopup->resourceSelected(resource); | 568 | m_presetsPopup->resourceSelected(resource); | ||
565 | } | 569 | } | ||
570 | | ||||
571 | | ||||
566 | } | 572 | } | ||
567 | 573 | | |||
568 | void KisPaintopBox::setCurrentPaintop(const KoID& paintop) | 574 | void KisPaintopBox::setCurrentPaintop(const KoID& paintop) | ||
Context not available. | |||||
795 | } | 801 | } | ||
796 | } | 802 | } | ||
797 | 803 | | |||
804 | void KisPaintopBox::slotCreatePresetFromScratch(QString paintop) | ||||
805 | { | ||||
806 | slotSetPaintop(paintop); // change the paintop settings area and update the UI | ||||
807 | m_presetsPopup->setCreatingBrushFromScratch(true); // disable UI elements while creating from scratch | ||||
808 | | ||||
809 | KisPaintOpPresetSP preset = m_resourceProvider->currentPreset(); | ||||
810 | m_presetsPopup->resourceSelected(preset.data()); // this helps update the UI on the brush editor | ||||
811 | } | ||||
812 | | ||||
798 | void KisPaintopBox::slotCanvasResourceChanged(int key, const QVariant &value) | 813 | void KisPaintopBox::slotCanvasResourceChanged(int key, const QVariant &value) | ||
799 | { | 814 | { | ||
800 | if (m_viewManager) { | 815 | if (m_viewManager) { | ||
Context not available. | |||||
843 | } | 858 | } | ||
844 | } | 859 | } | ||
845 | 860 | | |||
846 | | ||||
847 | void KisPaintopBox::slotUpdatePreset() | 861 | void KisPaintopBox::slotUpdatePreset() | ||
848 | { | 862 | { | ||
849 | if (!m_resourceProvider->currentPreset()) return; | 863 | if (!m_resourceProvider->currentPreset()) return; | ||
Context not available. |