diff --git a/libs/global/CMakeLists.txt b/libs/global/CMakeLists.txt --- a/libs/global/CMakeLists.txt +++ b/libs/global/CMakeLists.txt @@ -29,6 +29,7 @@ KisSharedRunnable.cpp KisRollingMeanAccumulatorWrapper.cpp KisLoggingManager.cpp + kis_config_notifier.cpp ) add_library(kritaglobal SHARED ${kritaglobal_LIB_SRCS} ) diff --git a/libs/ui/kis_config_notifier.h b/libs/global/kis_config_notifier.h rename from libs/ui/kis_config_notifier.h rename to libs/global/kis_config_notifier.h --- a/libs/ui/kis_config_notifier.h +++ b/libs/global/kis_config_notifier.h @@ -21,13 +21,13 @@ #include #include -#include "kritaui_export.h" +#include "kritaglobal_export.h" /** * An object that emits a signal to inform interested parties that the * configuration settings have changed. */ -class KRITAUI_EXPORT KisConfigNotifier : public QObject +class KRITAGLOBAL_EXPORT KisConfigNotifier : public QObject { Q_OBJECT public: diff --git a/libs/ui/kis_config_notifier.cpp b/libs/global/kis_config_notifier.cpp rename from libs/ui/kis_config_notifier.cpp rename to libs/global/kis_config_notifier.cpp diff --git a/libs/pigment/resources/KoColorSetEntry.h b/libs/pigment/resources/KoColorSetEntry.h --- a/libs/pigment/resources/KoColorSetEntry.h +++ b/libs/pigment/resources/KoColorSetEntry.h @@ -1,5 +1,7 @@ /* - * Copyright (c) 2018 Michael Zhou + * This file is part of the KDE project + * Copyright (c) 2005 Boudewijn Rempt + * Copyright (c) 2016 L. E. Segovia * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,10 +35,13 @@ public: QString name() const { return m_name; } void setName(const QString &name) { m_name = name; } + QString id() const { return m_id; } void setId(const QString &id) { m_id = id; } + KoColor color() const { return m_color; } void setColor(const KoColor &color) { m_color = color; } + bool spotColor() const { return m_spotColor; } void setSpotColor(bool spotColor) { m_spotColor = spotColor; } diff --git a/libs/pigment/resources/KoColorSetEntry.cpp b/libs/pigment/resources/KoColorSetEntry.cpp --- a/libs/pigment/resources/KoColorSetEntry.cpp +++ b/libs/pigment/resources/KoColorSetEntry.cpp @@ -1,5 +1,7 @@ /* - * Copyright (c) 2018 Michael Zhou + * This file is part of the KDE project + * Copyright (c) 2005 Boudewijn Rempt + * Copyright (c) 2016 L. E. Segovia * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/libs/ui/CMakeLists.txt b/libs/ui/CMakeLists.txt --- a/libs/ui/CMakeLists.txt +++ b/libs/ui/CMakeLists.txt @@ -61,7 +61,6 @@ dialogs/kis_dlg_png_import.cpp dialogs/kis_dlg_import_image_sequence.cpp dialogs/kis_delayed_save_dialog.cpp - dialogs/kis_dlg_internal_color_selector.cpp dialogs/KisSessionManagerDialog.cpp dialogs/KisNewWindowLayoutDialog.cpp flake/kis_node_dummies_graph.cpp @@ -95,7 +94,6 @@ kis_categorized_item_delegate.cpp kis_clipboard.cc kis_config.cc - kis_config_notifier.cpp kis_control_frame.cpp kis_composite_ops_model.cc kis_paint_ops_model.cpp @@ -227,7 +225,6 @@ widgets/kis_paintop_preset_icon_library.cpp widgets/kis_pattern_chooser.cc - widgets/kis_popup_button.cc widgets/kis_preset_chooser.cpp widgets/kis_progress_widget.cpp widgets/kis_selection_options.cc @@ -249,17 +246,9 @@ widgets/kis_color_filter_combo.cpp widgets/kis_elided_label.cpp widgets/kis_stopgradient_slider_widget.cpp - widgets/kis_spinbox_color_selector.cpp - widgets/kis_screen_color_picker.cpp widgets/kis_preset_live_preview_view.cpp + widgets/KisScreenColorPicker.cpp widgets/KoDualColorButton.cpp - widgets/kis_color_input.cpp - widgets/kis_color_button.cpp - widgets/KisVisualColorSelector.cpp - widgets/KisVisualColorSelectorShape.cpp - widgets/KisVisualEllipticalSelectorShape.cpp - widgets/KisVisualRectangleSelectorShape.cpp - widgets/KisVisualTriangleSelectorShape.cpp widgets/KoStrokeConfigWidget.cpp widgets/KoFillConfigWidget.cpp @@ -373,10 +362,6 @@ KisMultiFeedRSSModel.cpp KisRemoteFileFetcher.cpp - KisPaletteModel.cpp - kis_palette_delegate.cpp - kis_palette_view.cpp - KisColorsetChooser.cpp KisSaveGroupVisitor.cpp KisWindowLayoutResource.cpp KisWindowLayoutManager.cpp @@ -496,7 +481,6 @@ forms/wdgsessionmanager.ui forms/wdgnewwindowlayout.ui brushhud/kis_dlg_brush_hud_config.ui - forms/wdgdlginternalcolorselector.ui dialogs/kis_delayed_save_dialog.ui input/config/kis_input_configuration_page.ui input/config/kis_edit_profiles_dialog.ui @@ -522,7 +506,6 @@ wdgsplash.ui input/wintab/kis_screen_size_choice_dialog.ui input/wintab/drawpile_tablettester/tablettest.ui - ) diff --git a/libs/ui/kis_config.h b/libs/ui/kis_config.h --- a/libs/ui/kis_config.h +++ b/libs/ui/kis_config.h @@ -461,9 +461,6 @@ bool lineSmoothingStabilizeSensors(bool defaultValue = false) const; void setLineSmoothingStabilizeSensors(bool value); - int paletteDockerPaletteViewSectionSize(bool defaultValue = false) const; - void setPaletteDockerPaletteViewSectionSize(int value) const; - int tabletEventsDelay(bool defaultValue = false) const; void setTabletEventsDelay(int value); diff --git a/libs/ui/kis_config.cc b/libs/ui/kis_config.cc --- a/libs/ui/kis_config.cc +++ b/libs/ui/kis_config.cc @@ -1651,16 +1651,6 @@ m_cfg.writeEntry("LineSmoothingStabilizeSensors", value); } -int KisConfig::paletteDockerPaletteViewSectionSize(bool defaultValue) const -{ - return (defaultValue ? 12 : m_cfg.readEntry("paletteDockerPaletteViewSectionSize", 12)); -} - -void KisConfig::setPaletteDockerPaletteViewSectionSize(int value) const -{ - m_cfg.writeEntry("paletteDockerPaletteViewSectionSize", value); -} - int KisConfig::tabletEventsDelay(bool defaultValue) const { return (defaultValue ? 10 : m_cfg.readEntry("tabletEventsDelay", 10)); diff --git a/libs/ui/kis_paintop_box.cc b/libs/ui/kis_paintop_box.cc --- a/libs/ui/kis_paintop_box.cc +++ b/libs/ui/kis_paintop_box.cc @@ -69,7 +69,7 @@ #include "kis_favorite_resource_manager.h" #include "kis_config.h" -#include "widgets/kis_popup_button.h" +#include "kis_popup_button.h" #include "widgets/kis_iconwidget.h" #include "widgets/kis_tool_options_popup.h" #include "widgets/kis_paintop_presets_popup.h" diff --git a/libs/ui/widgets/kis_screen_color_picker.h b/libs/ui/widgets/KisScreenColorPicker.h rename from libs/ui/widgets/kis_screen_color_picker.h rename to libs/ui/widgets/KisScreenColorPicker.h --- a/libs/ui/widgets/kis_screen_color_picker.h +++ b/libs/ui/widgets/KisScreenColorPicker.h @@ -23,6 +23,7 @@ #include #include "KoColor.h" +#include #include "kritaui_export.h" @@ -31,7 +32,7 @@ * Based on the original QColorDialog's screen color picker, this class provides a button * that can be used to activate a colorpicker that can pick from anywhere on the screen. */ -class KRITAUI_EXPORT KisScreenColorPicker : public QWidget +class KRITAUI_EXPORT KisScreenColorPicker : public KisScreenColorPickerBase { Q_OBJECT public: @@ -45,7 +46,9 @@ bool handleColorPickingKeyPress(QKeyEvent *e); /// reloads icon(s) when theme is updated - void updateIcons(); + void updateIcons() override; + + static KisScreenColorPicker *createScreenColorPicker(QWidget *parent = 0) {return new KisScreenColorPicker(parent);} Q_SIGNALS: void sigNewColorPicked(KoColor c); diff --git a/libs/ui/widgets/kis_screen_color_picker.cpp b/libs/ui/widgets/KisScreenColorPicker.cpp rename from libs/ui/widgets/kis_screen_color_picker.cpp rename to libs/ui/widgets/KisScreenColorPicker.cpp --- a/libs/ui/widgets/kis_screen_color_picker.cpp +++ b/libs/ui/widgets/KisScreenColorPicker.cpp @@ -27,12 +27,15 @@ #include #include -#include "kis_icon.h" -#include "kis_screen_color_picker.h" -#include "KisMainWindow.h" #include + +#include "kis_shared_ptr.h" +#include "kis_icon.h" +#include "kis_image.h" #include "kis_wrapped_rect.h" #include "KisPart.h" +#include "KisScreenColorPicker.h" +#include "KisDlgInternalColorSelector.h" struct KisScreenColorPicker::Private { @@ -51,7 +54,7 @@ #endif }; -KisScreenColorPicker::KisScreenColorPicker(QWidget *parent) : QWidget(parent), m_d(new Private) +KisScreenColorPicker::KisScreenColorPicker(QWidget *parent) : KisScreenColorPickerBase(parent), m_d(new Private) { QVBoxLayout *layout = new QVBoxLayout(); this->setLayout(layout); @@ -79,7 +82,7 @@ void KisScreenColorPicker::updateIcons() { - m_d->screenColorPickerButton->setIcon(kisIcon("krita_tool_color_picker")); + m_d->screenColorPickerButton->setIcon(kisIcon("krita_tool_color_picker")); } KoColor KisScreenColorPicker::currentColor() @@ -269,6 +272,6 @@ return false; } +std::function KisDlgInternalColorSelector::s_screenColorPickerFactory = KisScreenColorPicker::createScreenColorPicker; - -#include "kis_screen_color_picker.moc" +#include "KisScreenColorPicker.moc" diff --git a/libs/ui/widgets/KoDualColorButton.cpp b/libs/ui/widgets/KoDualColorButton.cpp --- a/libs/ui/widgets/KoDualColorButton.cpp +++ b/libs/ui/widgets/KoDualColorButton.cpp @@ -25,7 +25,7 @@ #include "dcolorreset.xpm" #include -#include "dialogs/kis_dlg_internal_color_selector.h" +#include "KisDlgInternalColorSelector.h" #include "kis_signals_blocker.h" diff --git a/libs/ui/widgets/kis_iconwidget.h b/libs/ui/widgets/kis_iconwidget.h --- a/libs/ui/widgets/kis_iconwidget.h +++ b/libs/ui/widgets/kis_iconwidget.h @@ -20,7 +20,7 @@ #ifndef KIS_ICONWIDGET_H_ #define KIS_ICONWIDGET_H_ -#include +#include class KoResource; class KoAbstractResourceServerAdapter; diff --git a/libs/ui/widgets/kis_paintop_presets_popup.h b/libs/ui/widgets/kis_paintop_presets_popup.h --- a/libs/ui/widgets/kis_paintop_presets_popup.h +++ b/libs/ui/widgets/kis_paintop_presets_popup.h @@ -112,7 +112,6 @@ void dirtyPresetToggled(bool value); void eraserBrushSizeToggled(bool value); void eraserBrushOpacityToggled(bool value); - void sizeChanged(); void brushEditorShown(); void createPresetFromScratch(const QString& paintOpName); diff --git a/libs/ui/widgets/kis_paintop_presets_popup.cpp b/libs/ui/widgets/kis_paintop_presets_popup.cpp --- a/libs/ui/widgets/kis_paintop_presets_popup.cpp +++ b/libs/ui/widgets/kis_paintop_presets_popup.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -56,12 +57,10 @@ #include "kis_signal_auto_connection.h" #include - // ones from brush engine selector #include #include - struct KisPaintOpPresetsPopup::Private { @@ -673,7 +672,12 @@ void KisPaintOpPresetsPopup::resizeEvent(QResizeEvent* event) { QWidget::resizeEvent(event); - emit sizeChanged(); + if (parentWidget()) { + // Make sure resizing doesn't push this widget out of the screen + QRect screenRect = QApplication::desktop()->availableGeometry(this); + QRect newPositionRect = kisEnsureInRect(parentWidget()->geometry(), screenRect); + parentWidget()->setGeometry(newPositionRect); + } } bool KisPaintOpPresetsPopup::detached() const diff --git a/libs/widgets/CMakeLists.txt b/libs/widgets/CMakeLists.txt --- a/libs/widgets/CMakeLists.txt +++ b/libs/widgets/CMakeLists.txt @@ -55,7 +55,10 @@ KoToolBoxDocker.cpp KoToolBoxFactory.cpp KoToolDocker.cpp - + + KisPaletteModel.cpp + kis_palette_delegate.cpp + kis_palette_view.cpp KoPageLayoutWidget.cpp KoPageLayoutDialog.cpp @@ -82,6 +85,23 @@ KisGradientSlider.cpp KisGradientSliderWidget.cpp + + kis_color_input.cpp + + kis_spinbox_color_selector.cpp + + KisDlgInternalColorSelector.cpp + + KisVisualColorSelector.cpp + KisVisualColorSelectorShape.cpp + KisVisualEllipticalSelectorShape.cpp + KisVisualRectangleSelectorShape.cpp + KisVisualTriangleSelectorShape.cpp + kis_popup_button.cc + kis_color_button.cpp + KisScreenColorPickerBase.cpp + + KisColorsetChooser.cpp ) ki18n_wrap_ui( kritawidgets_LIB_SRCS @@ -92,11 +112,25 @@ wdg_file_name_requester.ui KoPageLayoutWidget.ui KoShadowConfigWidget.ui + WdgDlgInternalColorSelector.ui ) add_library(kritawidgets SHARED ${kritawidgets_LIB_SRCS}) generate_export_header(kritawidgets BASE_NAME kritawidgets) -target_link_libraries(kritawidgets kritaodf kritaflake kritapigment kritawidgetutils Qt5::PrintSupport KF5::CoreAddons KF5::ConfigGui KF5::GuiAddons KF5::WidgetsAddons KF5::ConfigCore KF5::Completion) +target_link_libraries(kritawidgets + kritaodf + kritaglobal + kritaflake + kritapigment + kritawidgetutils + Qt5::PrintSupport + KF5::CoreAddons + KF5::ConfigGui + KF5::GuiAddons + KF5::WidgetsAddons + KF5::ConfigCore + KF5::Completion +) if(X11_FOUND) target_link_libraries(kritawidgets Qt5::X11Extras ${X11_LIBRARIES}) diff --git a/libs/ui/widgets/KisColorSelectorConfiguration.h b/libs/widgets/KisColorSelectorConfiguration.h rename from libs/ui/widgets/KisColorSelectorConfiguration.h rename to libs/widgets/KisColorSelectorConfiguration.h --- a/libs/ui/widgets/KisColorSelectorConfiguration.h +++ b/libs/widgets/KisColorSelectorConfiguration.h @@ -21,9 +21,9 @@ #include #include -#include "kritaui_export.h" +#include "kritawidgets_export.h" -class KRITAUI_EXPORT KisColorSelectorConfiguration { +class KRITAWIDGETS_EXPORT KisColorSelectorConfiguration { public: diff --git a/libs/ui/KisColorsetChooser.h b/libs/widgets/KisColorsetChooser.h rename from libs/ui/KisColorsetChooser.h rename to libs/widgets/KisColorsetChooser.h --- a/libs/ui/KisColorsetChooser.h +++ b/libs/widgets/KisColorsetChooser.h @@ -29,10 +29,10 @@ class KoResourceItemChooser; class KoResource; -#include "kritaui_export.h" +#include "kritawidgets_export.h" -class KRITAUI_EXPORT KisColorsetChooser : public QWidget +class KRITAWIDGETS_EXPORT KisColorsetChooser : public QWidget { Q_OBJECT public: diff --git a/libs/ui/KisColorsetChooser.cpp b/libs/widgets/KisColorsetChooser.cpp rename from libs/ui/KisColorsetChooser.cpp rename to libs/widgets/KisColorsetChooser.cpp --- a/libs/ui/KisColorsetChooser.cpp +++ b/libs/widgets/KisColorsetChooser.cpp @@ -34,15 +34,11 @@ #include #include -#include "KisResourceServerProvider.h" -#include "KisViewManager.h" #include #include #include #include -#include - #include "kis_int_parse_spin_box.h" class ColorSetDelegate : public QAbstractItemDelegate @@ -98,10 +94,10 @@ connect(m_itemChooser, SIGNAL(resourceSelected(KoResource*)), this, SLOT(resourceSelected(KoResource*))); - KisConfig cfg; - m_itemChooser->configureKineticScrolling(cfg.kineticScrollingGesture(), - cfg.kineticScrollingSensitivity(), - cfg.kineticScrollingScrollbar()); + KConfigGroup cfg = KSharedConfig::openConfig()->group(""); + m_itemChooser->configureKineticScrolling(cfg.readEntry("KineticScrollingGesture", 0), + cfg.readEntry("KineticScrollingSensitivity", 75), + cfg.readEntry("KineticScrollingScrollbar", true)); QPushButton* saveButton = new QPushButton(i18n("Save")); connect(saveButton, SIGNAL(clicked(bool)), this, SLOT(slotSave())); diff --git a/libs/ui/dialogs/kis_dlg_internal_color_selector.h b/libs/widgets/KisDlgInternalColorSelector.h rename from libs/ui/dialogs/kis_dlg_internal_color_selector.h rename to libs/widgets/KisDlgInternalColorSelector.h --- a/libs/ui/dialogs/kis_dlg_internal_color_selector.h +++ b/libs/widgets/KisDlgInternalColorSelector.h @@ -16,10 +16,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KISINTERNALCOLORSELECTOR_H -#define KISINTERNALCOLORSELECTOR_H +#ifndef KISDLGINTERNALCOLORSELECTOR_H +#define KISDLGINTERNALCOLORSELECTOR_H -#include "kritaui_export.h" +#include "kritawidgets_export.h" #include "KoColor.h" #include "KoColorSpace.h" #include "KoColorDisplayRendererInterface.h" @@ -27,16 +27,21 @@ #include -#include "ui_wdgdlginternalcolorselector.h" +#include "KisScreenColorPickerBase.h" +#include "ui_WdgDlgInternalColorSelector.h" /** * @brief The KisInternalColorSelector class * * A non-modal color selector dialog that is not a plugin and can thus be used for filters. */ -class KRITAUI_EXPORT KisDlgInternalColorSelector : public QDialog +class KRITAWIDGETS_EXPORT KisDlgInternalColorSelector : public QDialog { Q_OBJECT + +private: + static std::function s_screenColorPickerFactory; + public: struct Config { @@ -170,16 +175,10 @@ protected: - void showEvent(QShowEvent *event); private: - Ui_WdgDlgInternalColorSelector *m_ui; //the UI - struct Private; //The private struct - const QScopedPointer m_d; //the private pointer - - - + void focusInEvent(QFocusEvent *) override; /** * @brief updateAllElements * Updates each widget with the new element, and if it's responsible for the update sents @@ -187,7 +186,10 @@ */ void updateAllElements(QObject *source); - void focusInEvent(QFocusEvent *) override; +private: + Ui_WdgDlgInternalColorSelector *m_ui; + struct Private; //The private struct + const QScopedPointer m_d; //the private pointer }; -#endif // KISINTERNALCOLORSELECTOR_H +#endif // KISDLGINTERNALCOLORSELECTOR_H diff --git a/libs/ui/dialogs/kis_dlg_internal_color_selector.cpp b/libs/widgets/KisDlgInternalColorSelector.cpp rename from libs/ui/dialogs/kis_dlg_internal_color_selector.cpp rename to libs/widgets/KisDlgInternalColorSelector.cpp --- a/libs/ui/dialogs/kis_dlg_internal_color_selector.cpp +++ b/libs/widgets/KisDlgInternalColorSelector.cpp @@ -23,6 +23,10 @@ #include #include +#include + +#include + #include "KoColorSpaceRegistry.h" #include #include @@ -32,19 +36,19 @@ #include #include "kis_signal_compressor.h" -#include "KisViewManager.h" #include "KoColorDisplayRendererInterface.h" #include "kis_spinbox_color_selector.h" -#include "kis_dlg_internal_color_selector.h" -#include "ui_wdgdlginternalcolorselector.h" -#include "kis_config.h" +#include "KisDlgInternalColorSelector.h" +#include "ui_WdgDlgInternalColorSelector.h" #include "kis_config_notifier.h" #include "kis_color_input.h" #include "kis_icon_utils.h" #include "squeezedcombobox.h" +std::function KisDlgInternalColorSelector::s_screenColorPickerFactory = 0; + struct KisDlgInternalColorSelector::Private { bool allowUpdates = true; @@ -59,6 +63,7 @@ KisHexColorInput *hexColorInput = 0; KisPaletteModel *paletteModel = 0; KisColorsetChooser *colorSetChooser = 0; + KisScreenColorPickerBase *screenColorPicker = 0; }; KisDlgInternalColorSelector::KisDlgInternalColorSelector(QWidget *parent, KoColor color, Config config, const QString &caption, const KoColorDisplayRendererInterface *displayRenderer) @@ -88,21 +93,16 @@ } else { m_ui->visualSelector->hide(); } - if (config.screenColorPicker) { - connect(m_ui->screenColorPicker, SIGNAL(sigNewColorPicked(KoColor)),this, SLOT(slotColorUpdated(KoColor))); - } else { - m_ui->screenColorPicker->hide(); - } if (!m_d->paletteModel) { m_d->paletteModel = new KisPaletteModel(this); m_ui->paletteBox->setPaletteModel(m_d->paletteModel); } - m_ui->paletteList->setIcon(KisIconUtils::loadIcon("hi16-palette_library")); + m_ui->bnColorsetChooser->setIcon(KisIconUtils::loadIcon("hi16-palette_library")); // For some bizare reason, the modal dialog doesn't like having the colorset set, so let's not. if (config.paletteBox) { //TODO: Add disable signal as well. Might be not necessary...? - KisConfig cfg; + KConfigGroup cfg(KSharedConfig::openConfig()->group("")); QString paletteName = cfg.readEntry("internal_selector_active_color_set", QString()); KoResourceServer* rServer = KoResourceServerProvider::instance()->paletteServer(); KoColorSet *savedPal = rServer->resourceByName(paletteName); @@ -124,12 +124,12 @@ m_d->colorSetChooser = new KisColorsetChooser(this); connect(m_d->colorSetChooser, SIGNAL(paletteSelected(KoColorSet*)), this, SLOT(slotChangePalette(KoColorSet*))); - m_ui->paletteList->setPopupWidget(m_d->colorSetChooser); + m_ui->bnColorsetChooser->setPopupWidget(m_d->colorSetChooser); } else { m_ui->paletteBox->setEnabled(false); m_ui->cmbNameList->setEnabled(false); - m_ui->paletteList->setEnabled(false); + m_ui->bnColorsetChooser->setEnabled(false); } if (config.prevNextButtons) { @@ -152,6 +152,18 @@ m_d->hexColorInput->setToolTip(i18n("This is a hexcode input, for webcolors. It can only get colors in the sRGB space.")); } + // screen color picker is in kritaui, so a dependency inversion is used to get it + m_ui->screenColorPickerWidget->setLayout(new QHBoxLayout(m_ui->screenColorPickerWidget)); + if (s_screenColorPickerFactory) { + m_d->screenColorPicker = s_screenColorPickerFactory(m_ui->screenColorPickerWidget); + m_ui->screenColorPickerWidget->layout()->addWidget(m_d->screenColorPicker); + if (config.screenColorPicker) { + connect(m_d->screenColorPicker, SIGNAL(sigNewColorPicked(KoColor)),this, SLOT(slotColorUpdated(KoColor))); + } else { + m_d->screenColorPicker->hide(); + } + } + connect(this, SIGNAL(signalForegroundColorChosen(KoColor)), this, SLOT(slotLockSelector())); m_d->compressColorChanges = new KisSignalCompressor(100 /* ms */, KisSignalCompressor::POSTPONE, this); connect(m_d->compressColorChanges, SIGNAL(timeout()), this, SLOT(endUpdateWithNewColor())); @@ -282,7 +294,9 @@ m_d->compressColorChanges->start(); } - m_ui->screenColorPicker->updateIcons(); + if (m_d->screenColorPicker) { + m_d->screenColorPicker->updateIcons(); + } } @@ -299,7 +313,7 @@ void KisDlgInternalColorSelector::slotFinishUp() { setPreviousColor(m_d->currentColor); - KisConfig cfg; + KConfigGroup cfg(KSharedConfig::openConfig()->group("")); if (m_d->paletteModel) { if (m_d->paletteModel->colorSet()) { cfg.writeEntry("internal_selector_active_color_set", m_d->paletteModel->colorSet()->name()); diff --git a/libs/ui/KisPaletteModel.h b/libs/widgets/KisPaletteModel.h rename from libs/ui/KisPaletteModel.h rename to libs/widgets/KisPaletteModel.h --- a/libs/ui/KisPaletteModel.h +++ b/libs/widgets/KisPaletteModel.h @@ -25,8 +25,7 @@ #include -#include -#include "kritaui_export.h" +#include "kritawidgets_export.h" #include #include @@ -36,7 +35,7 @@ * @brief The KisPaletteModel class * This, together with kis_palette_view and kis_palette_delegate forms a mvc way to access kocolorsets. */ -class KRITAUI_EXPORT KisPaletteModel : public QAbstractTableModel +class KRITAWIDGETS_EXPORT KisPaletteModel : public QAbstractTableModel { Q_OBJECT public: diff --git a/libs/ui/KisPaletteModel.cpp b/libs/widgets/KisPaletteModel.cpp rename from libs/ui/KisPaletteModel.cpp rename to libs/widgets/KisPaletteModel.cpp --- a/libs/ui/KisPaletteModel.cpp +++ b/libs/widgets/KisPaletteModel.cpp @@ -26,12 +26,10 @@ #include #include +#include #include #include -#include -#include - KisPaletteModel::KisPaletteModel(QObject* parent) : QAbstractTableModel(parent), m_colorSet(0), diff --git a/libs/widgets/KisScreenColorPickerBase.h b/libs/widgets/KisScreenColorPickerBase.h new file mode 100644 --- /dev/null +++ b/libs/widgets/KisScreenColorPickerBase.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) Wolthera van Hovell tot Westerflier , (C) 2016 + * Copyright (C) Michael Zhou , (C) 2018 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef KISSCREENCOLORPICKERBASE_H +#define KISSCREENCOLORPICKERBASE_H +#include +#include "kritawidgets_export.h" + +class KoColor; + +class KRITAWIDGETS_EXPORT KisScreenColorPickerBase : public QWidget +{ + Q_OBJECT +public: + KisScreenColorPickerBase(QWidget *parent = 0) : QWidget(parent) { } + virtual ~KisScreenColorPickerBase() { } + /// reloads icon(s) when theme is updated + virtual void updateIcons() = 0; +Q_SIGNALS: + void sigNewColorPicked(KoColor); +}; + +#endif // KISSCREENCOLORPICKERBASE_H diff --git a/libs/widgets/KisScreenColorPickerBase.cpp b/libs/widgets/KisScreenColorPickerBase.cpp new file mode 100644 --- /dev/null +++ b/libs/widgets/KisScreenColorPickerBase.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) Wolthera van Hovell tot Westerflier , (C) 2016 + * Copyright (C) Michael Zhou , (C) 2018 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include diff --git a/libs/ui/widgets/KisVisualColorSelector.h b/libs/widgets/KisVisualColorSelector.h rename from libs/ui/widgets/KisVisualColorSelector.h rename to libs/widgets/KisVisualColorSelector.h --- a/libs/ui/widgets/KisVisualColorSelector.h +++ b/libs/widgets/KisVisualColorSelector.h @@ -30,7 +30,7 @@ #include "KisColorSelectorConfiguration.h" #include "KisColorSelectorInterface.h" -#include "kritaui_export.h" +#include "kritawidgets_export.h" /** * @brief The KisVisualColorSelector class @@ -40,7 +40,7 @@ * Unlike other color selectors, this one draws the full gamut of the given * colorspace. */ -class KRITAUI_EXPORT KisVisualColorSelector : public KisColorSelectorInterface +class KRITAWIDGETS_EXPORT KisVisualColorSelector : public KisColorSelectorInterface { Q_OBJECT public: diff --git a/libs/ui/widgets/KisVisualColorSelector.cpp b/libs/widgets/KisVisualColorSelector.cpp rename from libs/ui/widgets/KisVisualColorSelector.cpp rename to libs/widgets/KisVisualColorSelector.cpp diff --git a/libs/ui/widgets/KisVisualColorSelectorShape.h b/libs/widgets/KisVisualColorSelectorShape.h rename from libs/ui/widgets/KisVisualColorSelectorShape.h rename to libs/widgets/KisVisualColorSelectorShape.h --- a/libs/ui/widgets/KisVisualColorSelectorShape.h +++ b/libs/widgets/KisVisualColorSelectorShape.h @@ -31,8 +31,6 @@ #include "KisVisualColorSelector.h" #include "KisColorSelectorConfiguration.h" -#include "kritaui_export.h" - /** * @brief The KisVisualColorSelectorShape class * A 2d widget can represent at maximum 2 coordinates. diff --git a/libs/ui/widgets/KisVisualColorSelectorShape.cpp b/libs/widgets/KisVisualColorSelectorShape.cpp rename from libs/ui/widgets/KisVisualColorSelectorShape.cpp rename to libs/widgets/KisVisualColorSelectorShape.cpp diff --git a/libs/ui/widgets/KisVisualEllipticalSelectorShape.h b/libs/widgets/KisVisualEllipticalSelectorShape.h rename from libs/ui/widgets/KisVisualEllipticalSelectorShape.h rename to libs/widgets/KisVisualEllipticalSelectorShape.h --- a/libs/ui/widgets/KisVisualEllipticalSelectorShape.h +++ b/libs/widgets/KisVisualEllipticalSelectorShape.h @@ -31,8 +31,6 @@ #include "KisColorSelectorConfiguration.h" #include "KisVisualColorSelectorShape.h" -#include "kritaui_export.h" - class KisVisualEllipticalSelectorShape : public KisVisualColorSelectorShape { Q_OBJECT diff --git a/libs/ui/widgets/KisVisualEllipticalSelectorShape.cpp b/libs/widgets/KisVisualEllipticalSelectorShape.cpp rename from libs/ui/widgets/KisVisualEllipticalSelectorShape.cpp rename to libs/widgets/KisVisualEllipticalSelectorShape.cpp diff --git a/libs/ui/widgets/KisVisualRectangleSelectorShape.h b/libs/widgets/KisVisualRectangleSelectorShape.h rename from libs/ui/widgets/KisVisualRectangleSelectorShape.h rename to libs/widgets/KisVisualRectangleSelectorShape.h --- a/libs/ui/widgets/KisVisualRectangleSelectorShape.h +++ b/libs/widgets/KisVisualRectangleSelectorShape.h @@ -31,8 +31,6 @@ #include "KisColorSelectorConfiguration.h" #include "KisVisualColorSelectorShape.h" -#include "kritaui_export.h" - class KisVisualRectangleSelectorShape : public KisVisualColorSelectorShape { Q_OBJECT diff --git a/libs/ui/widgets/KisVisualRectangleSelectorShape.cpp b/libs/widgets/KisVisualRectangleSelectorShape.cpp rename from libs/ui/widgets/KisVisualRectangleSelectorShape.cpp rename to libs/widgets/KisVisualRectangleSelectorShape.cpp diff --git a/libs/ui/widgets/KisVisualTriangleSelectorShape.h b/libs/widgets/KisVisualTriangleSelectorShape.h rename from libs/ui/widgets/KisVisualTriangleSelectorShape.h rename to libs/widgets/KisVisualTriangleSelectorShape.h --- a/libs/ui/widgets/KisVisualTriangleSelectorShape.h +++ b/libs/widgets/KisVisualTriangleSelectorShape.h @@ -31,8 +31,6 @@ #include "KisColorSelectorConfiguration.h" #include "KisVisualColorSelectorShape.h" -#include "kritaui_export.h" - class KisVisualTriangleSelectorShape : public KisVisualColorSelectorShape { Q_OBJECT diff --git a/libs/ui/widgets/KisVisualTriangleSelectorShape.cpp b/libs/widgets/KisVisualTriangleSelectorShape.cpp rename from libs/ui/widgets/KisVisualTriangleSelectorShape.cpp rename to libs/widgets/KisVisualTriangleSelectorShape.cpp diff --git a/libs/ui/forms/wdgdlginternalcolorselector.ui b/libs/widgets/WdgDlgInternalColorSelector.ui rename from libs/ui/forms/wdgdlginternalcolorselector.ui rename to libs/widgets/WdgDlgInternalColorSelector.ui --- a/libs/ui/forms/wdgdlginternalcolorselector.ui +++ b/libs/widgets/WdgDlgInternalColorSelector.ui @@ -141,7 +141,7 @@ 0 - + 0 @@ -175,7 +175,7 @@ - + 0 @@ -228,12 +228,6 @@
kis_spinbox_color_selector.h
1 - - KisScreenColorPicker - QWidget -
kis_screen_color_picker.h
- 1 -
KisVisualColorSelector QWidget diff --git a/libs/ui/widgets/kis_color_button.h b/libs/widgets/kis_color_button.h rename from libs/ui/widgets/kis_color_button.h rename to libs/widgets/kis_color_button.h --- a/libs/ui/widgets/kis_color_button.h +++ b/libs/widgets/kis_color_button.h @@ -21,7 +21,7 @@ #ifndef KisColorButton_H #define KisColorButton_H -#include +#include #include #include @@ -36,7 +36,7 @@ * * \image html KisColorButton.png "KDE Color Button" */ -class KRITAUI_EXPORT KisColorButton : public QPushButton +class KRITAWIDGETS_EXPORT KisColorButton : public QPushButton { Q_OBJECT diff --git a/libs/ui/widgets/kis_color_button.cpp b/libs/widgets/kis_color_button.cpp rename from libs/ui/widgets/kis_color_button.cpp rename to libs/widgets/kis_color_button.cpp --- a/libs/ui/widgets/kis_color_button.cpp +++ b/libs/widgets/kis_color_button.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include class KisColorButton::KisColorButtonPrivate { diff --git a/libs/ui/widgets/kis_color_input.h b/libs/widgets/kis_color_input.h rename from libs/ui/widgets/kis_color_input.h rename to libs/widgets/kis_color_input.h --- a/libs/ui/widgets/kis_color_input.h +++ b/libs/widgets/kis_color_input.h @@ -31,9 +31,9 @@ class QLineEdit; #include -#include "kritaui_export.h" +#include "kritawidgetutils_export.h" -class KRITAUI_EXPORT KisColorInput : public QWidget +class KRITAWIDGETUTILS_EXPORT KisColorInput : public QWidget { Q_OBJECT public: @@ -57,7 +57,7 @@ bool m_usePercentage; }; -class KRITAUI_EXPORT KisIntegerColorInput : public KisColorInput +class KRITAWIDGETUTILS_EXPORT KisIntegerColorInput : public KisColorInput { Q_OBJECT public: @@ -75,7 +75,7 @@ }; -class KRITAUI_EXPORT KisFloatColorInput : public KisColorInput +class KRITAWIDGETUTILS_EXPORT KisFloatColorInput : public KisColorInput { Q_OBJECT public: @@ -92,7 +92,7 @@ qreal m_maxValue; }; -class KRITAUI_EXPORT KisHexColorInput : public KisColorInput +class KRITAWIDGETUTILS_EXPORT KisHexColorInput : public KisColorInput { Q_OBJECT public: diff --git a/libs/ui/widgets/kis_color_input.cpp b/libs/widgets/kis_color_input.cpp rename from libs/ui/widgets/kis_color_input.cpp rename to libs/widgets/kis_color_input.cpp diff --git a/libs/ui/kis_palette_delegate.h b/libs/widgets/kis_palette_delegate.h rename from libs/ui/kis_palette_delegate.h rename to libs/widgets/kis_palette_delegate.h --- a/libs/ui/kis_palette_delegate.h +++ b/libs/widgets/kis_palette_delegate.h @@ -21,10 +21,10 @@ #include -#include "kritaui_export.h" +#include "kritawidgets_export.h" -class KRITAUI_EXPORT KisPaletteDelegate : public QAbstractItemDelegate +class KRITAWIDGETS_EXPORT KisPaletteDelegate : public QAbstractItemDelegate { public: KisPaletteDelegate(QObject * parent = 0); diff --git a/libs/ui/kis_palette_delegate.cpp b/libs/widgets/kis_palette_delegate.cpp rename from libs/ui/kis_palette_delegate.cpp rename to libs/widgets/kis_palette_delegate.cpp diff --git a/libs/ui/kis_palette_view.h b/libs/widgets/kis_palette_view.h rename from libs/ui/kis_palette_view.h rename to libs/widgets/kis_palette_view.h --- a/libs/ui/kis_palette_view.h +++ b/libs/widgets/kis_palette_view.h @@ -21,15 +21,21 @@ #define __KIS_PALETTE_VIEW_H #include + +#include +#include +#include +#include + #include #include -#include "kritaui_export.h" +#include "kritawidgets_export.h" class KisPaletteModel; class QWheelEvent; -class KRITAUI_EXPORT KisPaletteView : public KoTableView +class KRITAWIDGETS_EXPORT KisPaletteView : public KoTableView { Q_OBJECT public: diff --git a/libs/ui/kis_palette_view.cpp b/libs/widgets/kis_palette_view.cpp rename from libs/ui/kis_palette_view.cpp rename to libs/widgets/kis_palette_view.cpp --- a/libs/ui/kis_palette_view.cpp +++ b/libs/widgets/kis_palette_view.cpp @@ -20,20 +20,22 @@ #include #include - -#include "kis_palette_delegate.h" -#include "KisPaletteModel.h" -#include "kis_config.h" -#include -#include #include #include #include -#include #include #include #include +#include +#include +#include + +#include + +#include "kis_palette_delegate.h" +#include "KisPaletteModel.h" +#include "kis_color_button.h" struct KisPaletteView::Private { @@ -41,7 +43,6 @@ bool allowPaletteModification = true; }; - KisPaletteView::KisPaletteView(QWidget *parent) : KoTableView(parent) , m_d(new Private) @@ -55,13 +56,13 @@ // setDragDropMode(QAbstractItemView::InternalMove); setDropIndicatorShown(true); - KisConfig cfg; + KConfigGroup cfg(KSharedConfig::openConfig()->group("")); //QPalette pal(palette()); //pal.setColor(QPalette::Base, cfg.getMDIBackgroundColor()); //setAutoFillBackground(true); //setPalette(pal); - int defaultSectionSize = cfg.paletteDockerPaletteViewSectionSize(); + int defaultSectionSize = cfg.readEntry("paletteDockerPaletteViewSectionSize", 12); horizontalHeader()->setDefaultSectionSize(defaultSectionSize); verticalHeader()->setDefaultSectionSize(defaultSectionSize); connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(modifyEntry(QModelIndex))); @@ -82,19 +83,18 @@ bool KisPaletteView::addEntryWithDialog(KoColor color) { - KoDialog *window = new KoDialog(); + KoDialog *window = new KoDialog(this); window->setWindowTitle(i18nc("@title:window", "Add a new Colorset Entry")); - QFormLayout *editableItems = new QFormLayout(); + QFormLayout *editableItems = new QFormLayout(window); window->mainWidget()->setLayout(editableItems); - QComboBox *cmbGroups = new QComboBox(); + QComboBox *cmbGroups = new QComboBox(window); QString defaultGroupName = i18nc("Name for default group", "Default"); cmbGroups->addItem(defaultGroupName); cmbGroups->addItems(m_d->model->colorSet()->getGroupNames()); - QLineEdit *lnIDName = new QLineEdit(); - QLineEdit *lnName = new QLineEdit(); - KisColorButton *bnColor = new KisColorButton(); - bnColor->setPaletteViewEnabled(false); - QCheckBox *chkSpot = new QCheckBox(); + QLineEdit *lnIDName = new QLineEdit(window); + QLineEdit *lnName = new QLineEdit(window); + KisColorButton *bnColor = new KisColorButton(window); + QCheckBox *chkSpot = new QCheckBox(window); chkSpot->setToolTip(i18nc("@info:tooltip", "A spot color is a color that the printer is able to print without mixing the paints it has available to it. The opposite is called a process color.")); editableItems->addRow(i18n("Group"), cmbGroups); editableItems->addRow(i18n("ID"), lnIDName); @@ -107,7 +107,6 @@ bnColor->setColor(color); chkSpot->setChecked(false); - // if (window->exec() == KoDialog::Accepted) { QString groupName = cmbGroups->currentText(); if (groupName == defaultGroupName) { @@ -264,8 +263,8 @@ } else { horizontalHeader()->setDefaultSectionSize(setSize); verticalHeader()->setDefaultSectionSize(setSize); - KisConfig cfg; - cfg.setPaletteDockerPaletteViewSectionSize(setSize); + KConfigGroup cfg(KSharedConfig::openConfig()->group("")); + cfg.writeEntry("paletteDockerPaletteViewSectionSize", setSize); } event->accept(); @@ -300,14 +299,13 @@ void KisPaletteView::modifyEntry(QModelIndex index) { if (m_d->allowPaletteModification) { - KoDialog *group = new KoDialog(); - QFormLayout *editableItems = new QFormLayout(); + KoDialog *group = new KoDialog(this); + QFormLayout *editableItems = new QFormLayout(group); group->mainWidget()->setLayout(editableItems); - QLineEdit *lnIDName = new QLineEdit(); - QLineEdit *lnGroupName = new QLineEdit(); - KisColorButton *bnColor = new KisColorButton(); - bnColor->setPaletteViewEnabled(false); - QCheckBox *chkSpot = new QCheckBox(); + QLineEdit *lnIDName = new QLineEdit(group); + QLineEdit *lnGroupName = new QLineEdit(group); + KisColorButton *bnColor = new KisColorButton(group); + QCheckBox *chkSpot = new QCheckBox(group); if (qvariant_cast(index.data(KisPaletteModel::IsHeaderRole))) { QString groupName = qvariant_cast(index.data(Qt::DisplayRole)); diff --git a/libs/ui/widgets/kis_popup_button.h b/libs/widgets/kis_popup_button.h rename from libs/ui/widgets/kis_popup_button.h rename to libs/widgets/kis_popup_button.h --- a/libs/ui/widgets/kis_popup_button.h +++ b/libs/widgets/kis_popup_button.h @@ -22,13 +22,13 @@ #include -#include +#include /** * This class is a convenience class for a button that * when clicked displays a popup widget. */ -class KRITAUI_EXPORT KisPopupButton : public QPushButton +class KRITAWIDGETS_EXPORT KisPopupButton : public QPushButton { Q_OBJECT @@ -57,13 +57,19 @@ */ void setPopupWidgetWidth(int w); + /** + * @brief adjustPosition + * adjusts the position of the popup widget based on the position + * of this button and the size of the widget + */ + void adjustPosition(); + public Q_SLOTS: void showPopupWidget(); void hidePopupWidget(); - void adjustPosition(); protected: void paintEvent(QPaintEvent* event) override; diff --git a/libs/ui/widgets/kis_popup_button.cc b/libs/widgets/kis_popup_button.cc rename from libs/ui/widgets/kis_popup_button.cc rename to libs/widgets/kis_popup_button.cc --- a/libs/ui/widgets/kis_popup_button.cc +++ b/libs/widgets/kis_popup_button.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include "widgets/kis_popup_button.h" +#include "kis_popup_button.h" #include #include @@ -30,8 +30,6 @@ #include "kis_global.h" #include -#include - struct KisPopupButton::Private { Private() @@ -85,13 +83,6 @@ m_d->popupWidget = widget; m_d->popupWidget->setParent(m_d->frame.data()); m_d->frameLayout->addWidget(m_d->popupWidget); - - // Workaround for bug 279740, preset popup widget resizes after it's shown for the first time - // so we catch that and correct the position - KisPaintOpPresetsPopup* presetPopup = dynamic_cast(widget); - if (presetPopup) { - connect(presetPopup, SIGNAL(sizeChanged()), this, SLOT(adjustPosition())); - } } } @@ -140,11 +131,6 @@ void KisPopupButton::adjustPosition() { - KisPaintOpPresetsPopup* presetPopup = dynamic_cast(m_d->popupWidget.data()); - if (presetPopup && presetPopup->detached()) { - return; - } - QSize popSize = m_d->popupWidget->size(); QRect popupRect(this->mapToGlobal(QPoint(0, this->size().height())), popSize); diff --git a/libs/ui/widgets/kis_spinbox_color_selector.h b/libs/widgets/kis_spinbox_color_selector.h rename from libs/ui/widgets/kis_spinbox_color_selector.h rename to libs/widgets/kis_spinbox_color_selector.h --- a/libs/ui/widgets/kis_spinbox_color_selector.h +++ b/libs/widgets/kis_spinbox_color_selector.h @@ -20,7 +20,7 @@ #define KISSPINBOXCOLORSELECTOR_H #include -#include "kritaui_export.h" +#include "kritawidgets_export.h" #include #include "KoColor.h" #include "KoColorSpace.h" @@ -30,7 +30,7 @@ * This will give a widget with spinboxes depending on the color space * Take responsibility for changing the color space. */ -class KRITAUI_EXPORT KisSpinboxColorSelector : public QWidget +class KRITAWIDGETS_EXPORT KisSpinboxColorSelector : public QWidget { Q_OBJECT public: diff --git a/libs/ui/widgets/kis_spinbox_color_selector.cpp b/libs/widgets/kis_spinbox_color_selector.cpp rename from libs/ui/widgets/kis_spinbox_color_selector.cpp rename to libs/widgets/kis_spinbox_color_selector.cpp diff --git a/plugins/dockers/palettedocker/palettedocker_dock.h b/plugins/dockers/palettedocker/palettedocker_dock.h --- a/plugins/dockers/palettedocker/palettedocker_dock.h +++ b/plugins/dockers/palettedocker/palettedocker_dock.h @@ -77,7 +77,7 @@ KisPaletteModel *m_model; QSharedPointer m_serverAdapter; KoColorSet *m_currentColorSet; - KisColorsetChooser *m_colorSetChooser; + KisColorsetChooser *m_paletteChooser; KisCanvasResourceProvider *m_resourceProvider; QPointer m_canvas; }; diff --git a/plugins/dockers/palettedocker/palettedocker_dock.cpp b/plugins/dockers/palettedocker/palettedocker_dock.cpp --- a/plugins/dockers/palettedocker/palettedocker_dock.cpp +++ b/plugins/dockers/palettedocker/palettedocker_dock.cpp @@ -52,10 +52,10 @@ #include #include "KisPaletteModel.h" -#include "KisColorsetChooser.h" #include "ui_wdgpalettedock.h" #include "kis_palette_delegate.h" #include "kis_palette_view.h" +#include PaletteDockerDock::PaletteDockerDock( ) : QDockWidget(i18n("Palette")) @@ -93,12 +93,12 @@ m_serverAdapter->connectToResourceServer(); rServer->addObserver(this); - m_colorSetChooser = new KisColorsetChooser(this); - connect(m_colorSetChooser, SIGNAL(paletteSelected(KoColorSet*)), this, SLOT(setColorSet(KoColorSet*))); + m_paletteChooser = new KisColorsetChooser(this); + connect(m_paletteChooser, SIGNAL(paletteSelected(KoColorSet*)), this, SLOT(setColorSet(KoColorSet*))); m_wdgPaletteDock->bnColorSets->setIcon(KisIconUtils::loadIcon("hi16-palette_library")); m_wdgPaletteDock->bnColorSets->setToolTip(i18n("Choose palette")); - m_wdgPaletteDock->bnColorSets->setPopupWidget(m_colorSetChooser); + m_wdgPaletteDock->bnColorSets->setPopupWidget(m_paletteChooser); connect(m_wdgPaletteDock->cmbNameList, SIGNAL(currentIndexChanged(int)), this, SLOT(setColorFromNameList(int))); KisConfig cfg; diff --git a/plugins/paintops/particle/kis_particle_paintop_settings_widget.h b/plugins/paintops/particle/kis_particle_paintop_settings_widget.h --- a/plugins/paintops/particle/kis_particle_paintop_settings_widget.h +++ b/plugins/paintops/particle/kis_particle_paintop_settings_widget.h @@ -22,7 +22,7 @@ #include #include "ui_wdgparticleoptions.h" -#include "widgets/kis_popup_button.h" +#include "kis_popup_button.h" class KisPaintActionTypeOption; class KisParticleOpOption;