Differential D498 Diff 1283 krita/plugins/extensions/dockers/advancedcolorselector/kis_color_selector_container.cpp
Changeset View
Changeset View
Standalone View
Standalone View
krita/plugins/extensions/dockers/advancedcolorselector/kis_color_selector_container.cpp
Show All 33 Lines | |||||
34 | 34 | | |||
35 | #include "KisViewManager.h" | 35 | #include "KisViewManager.h" | ||
36 | #include "kis_canvas2.h" | 36 | #include "kis_canvas2.h" | ||
37 | #include "kis_canvas_resource_provider.h" | 37 | #include "kis_canvas_resource_provider.h" | ||
38 | #include "kis_node_manager.h" | 38 | #include "kis_node_manager.h" | ||
39 | #include "kis_node.h" | 39 | #include "kis_node.h" | ||
40 | #include "kis_paint_device.h" | 40 | #include "kis_paint_device.h" | ||
41 | 41 | | |||
42 | #include "kis_action_registry.h" | ||||
43 | | ||||
42 | KisColorSelectorContainer::KisColorSelectorContainer(QWidget *parent) : | 44 | KisColorSelectorContainer::KisColorSelectorContainer(QWidget *parent) : | ||
43 | QWidget(parent), | 45 | QWidget(parent), | ||
44 | m_colorSelector(new KisColorSelector(this)), | 46 | m_colorSelector(new KisColorSelector(this)), | ||
45 | m_myPaintShadeSelector(new KisMyPaintShadeSelector(this)), | 47 | m_myPaintShadeSelector(new KisMyPaintShadeSelector(this)), | ||
46 | m_minimalShadeSelector(new KisMinimalShadeSelector(this)), | 48 | m_minimalShadeSelector(new KisMinimalShadeSelector(this)), | ||
47 | m_shadeSelector(m_myPaintShadeSelector), | 49 | m_shadeSelector(m_myPaintShadeSelector), | ||
48 | m_colorSelAction(0), | | |||
49 | m_mypaintAction(0), | | |||
50 | m_minimalAction(0), | | |||
51 | m_canvas(0) | 50 | m_canvas(0) | ||
52 | { | 51 | { | ||
53 | m_widgetLayout = new QBoxLayout(QBoxLayout::TopToBottom, this); | 52 | m_widgetLayout = new QBoxLayout(QBoxLayout::TopToBottom, this); | ||
54 | m_widgetLayout->setSpacing(0); | 53 | m_widgetLayout->setSpacing(0); | ||
55 | m_widgetLayout->setMargin(0); | 54 | m_widgetLayout->setMargin(0); | ||
56 | 55 | | |||
57 | m_widgetLayout->addWidget(m_colorSelector); | 56 | m_widgetLayout->addWidget(m_colorSelector); | ||
58 | m_widgetLayout->addWidget(m_myPaintShadeSelector); | 57 | m_widgetLayout->addWidget(m_myPaintShadeSelector); | ||
59 | m_widgetLayout->addWidget(m_minimalShadeSelector); | 58 | m_widgetLayout->addWidget(m_minimalShadeSelector); | ||
60 | 59 | | |||
61 | m_myPaintShadeSelector->hide(); | 60 | m_myPaintShadeSelector->hide(); | ||
62 | m_minimalShadeSelector->hide(); | 61 | m_minimalShadeSelector->hide(); | ||
63 | 62 | | |||
64 | connect(m_colorSelector,SIGNAL(settingsButtonClicked()), SIGNAL(openSettings())); | 63 | connect(m_colorSelector,SIGNAL(settingsButtonClicked()), SIGNAL(openSettings())); | ||
65 | 64 | | |||
66 | connect(this, SIGNAL(settingsChanged()), m_colorSelector, SLOT(updateSettings())); | 65 | connect(this, SIGNAL(settingsChanged()), m_colorSelector, SLOT(updateSettings())); | ||
67 | connect(this, SIGNAL(settingsChanged()), m_myPaintShadeSelector, SLOT(updateSettings())); | 66 | connect(this, SIGNAL(settingsChanged()), m_myPaintShadeSelector, SLOT(updateSettings())); | ||
68 | connect(this, SIGNAL(settingsChanged()), this, SLOT(updateSettings())); | 67 | connect(this, SIGNAL(settingsChanged()), this, SLOT(updateSettings())); | ||
69 | connect(this, SIGNAL(settingsChanged()), m_minimalShadeSelector, SLOT(updateSettings())); | 68 | connect(this, SIGNAL(settingsChanged()), m_minimalShadeSelector, SLOT(updateSettings())); | ||
70 | 69 | | |||
71 | 70 | | |||
72 | m_colorSelAction = new QAction("Show color selector", this); | 71 | m_colorSelAction = KisActionRegistry::instance()->makeQAction("show_color_selector", this); | ||
73 | m_colorSelAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_I)); | | |||
74 | connect(m_colorSelAction, SIGNAL(triggered()), m_colorSelector, SLOT(showPopup()), Qt::UniqueConnection); | 72 | connect(m_colorSelAction, SIGNAL(triggered()), m_colorSelector, SLOT(showPopup()), Qt::UniqueConnection); | ||
75 | 73 | | |||
76 | m_mypaintAction = new QAction("Show MyPaint shade selector", this); | 74 | m_mypaintAction = KisActionRegistry::instance()->makeQAction("show_mypaint_shade_selector", this); | ||
77 | m_mypaintAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_M)); | | |||
78 | connect(m_mypaintAction, SIGNAL(triggered()), m_myPaintShadeSelector, SLOT(showPopup()), Qt::UniqueConnection); | 75 | connect(m_mypaintAction, SIGNAL(triggered()), m_myPaintShadeSelector, SLOT(showPopup()), Qt::UniqueConnection); | ||
79 | 76 | | |||
80 | m_minimalAction = new QAction("Show minimal shade selector", this); | 77 | m_minimalAction = KisActionRegistry::instance()->makeQAction("show_minimal_shade_selector", this); | ||
81 | m_minimalAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_N)); | | |||
82 | connect(m_minimalAction, SIGNAL(triggered()), m_minimalShadeSelector, SLOT(showPopup()), Qt::UniqueConnection); | 78 | connect(m_minimalAction, SIGNAL(triggered()), m_minimalShadeSelector, SLOT(showPopup()), Qt::UniqueConnection); | ||
83 | 79 | | |||
84 | | ||||
85 | } | 80 | } | ||
86 | 81 | | |||
87 | void KisColorSelectorContainer::unsetCanvas() | 82 | void KisColorSelectorContainer::unsetCanvas() | ||
88 | { | 83 | { | ||
89 | m_colorSelector->unsetCanvas(); | 84 | m_colorSelector->unsetCanvas(); | ||
90 | m_myPaintShadeSelector->unsetCanvas(); | 85 | m_myPaintShadeSelector->unsetCanvas(); | ||
91 | m_minimalShadeSelector->unsetCanvas(); | 86 | m_minimalShadeSelector->unsetCanvas(); | ||
92 | m_canvas = 0; | 87 | m_canvas = 0; | ||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |