Changeset View
Changeset View
Standalone View
Standalone View
krita/ui/tool/kis_tool.cc
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
61 | #include "kis_config.h" | 61 | #include "kis_config.h" | ||
62 | #include "kis_config_notifier.h" | 62 | #include "kis_config_notifier.h" | ||
63 | #include "kis_cursor.h" | 63 | #include "kis_cursor.h" | ||
64 | #include <recorder/kis_recorded_paint_action.h> | 64 | #include <recorder/kis_recorded_paint_action.h> | ||
65 | #include <kis_selection_mask.h> | 65 | #include <kis_selection_mask.h> | ||
66 | #include "kis_resources_snapshot.h" | 66 | #include "kis_resources_snapshot.h" | ||
67 | #include <KisView.h> | 67 | #include <KisView.h> | ||
68 | 68 | | |||
69 | #include "kis_action_registry.h" | ||||
70 | | ||||
69 | 71 | | |||
70 | 72 | | |||
71 | struct KisTool::Private { | 73 | struct KisTool::Private { | ||
72 | Private() | 74 | Private() | ||
73 | : currentPattern(0), | 75 | : currentPattern(0), | ||
74 | currentGradient(0), | 76 | currentGradient(0), | ||
75 | currentExposure(1.0), | 77 | currentExposure(1.0), | ||
76 | currentGenerator(0), | 78 | currentGenerator(0), | ||
Show All 22 Lines | 99 | { | |||
99 | m_isActive = false; | 101 | m_isActive = false; | ||
100 | 102 | | |||
101 | connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(resetCursorStyle())); | 103 | connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(resetCursorStyle())); | ||
102 | connect(this, SIGNAL(isActiveChanged()), SLOT(resetCursorStyle())); | 104 | connect(this, SIGNAL(isActiveChanged()), SLOT(resetCursorStyle())); | ||
103 | 105 | | |||
104 | KActionCollection *collection = this->canvas()->canvasController()->actionCollection(); | 106 | KActionCollection *collection = this->canvas()->canvasController()->actionCollection(); | ||
105 | 107 | | |||
106 | if (!collection->action("toggle_fg_bg")) { | 108 | if (!collection->action("toggle_fg_bg")) { | ||
107 | QAction *toggleFgBg = new QAction(i18n("Swap Foreground and Background Color"), collection); | 109 | QAction *toggleFgBg = KisActionRegistry::instance()->makeQAction("toggle_fg_bg", collection, "Canvas"); | ||
108 | toggleFgBg->setShortcut(QKeySequence(Qt::Key_X)); | | |||
109 | collection->addAction("toggle_fg_bg", toggleFgBg); | 110 | collection->addAction("toggle_fg_bg", toggleFgBg); | ||
110 | } | 111 | } | ||
111 | 112 | | |||
112 | if (!collection->action("reset_fg_bg")) { | 113 | if (!collection->action("reset_fg_bg")) { | ||
113 | QAction *resetFgBg = new QAction(i18n("Reset Foreground and Background Color"), collection); | 114 | QAction *toggleFgBg = KisActionRegistry::instance()->makeQAction("reset_fg_bg", collection, "Canvas"); | ||
114 | resetFgBg->setShortcut(QKeySequence(Qt::Key_D)); | 115 | collection->addAction("reset_fg_bg", toggleFgBg); | ||
115 | collection->addAction("reset_fg_bg", resetFgBg); | | |||
116 | } | 116 | } | ||
117 | 117 | | |||
118 | addAction("toggle_fg_bg", dynamic_cast<QAction *>(collection->action("toggle_fg_bg"))); | 118 | addAction("toggle_fg_bg", dynamic_cast<QAction *>(collection->action("toggle_fg_bg"))); | ||
119 | addAction("reset_fg_bg", dynamic_cast<QAction *>(collection->action("reset_fg_bg"))); | 119 | addAction("reset_fg_bg", dynamic_cast<QAction *>(collection->action("reset_fg_bg"))); | ||
120 | 120 | | |||
121 | setMode(HOVER_MODE); | 121 | setMode(HOVER_MODE); | ||
122 | } | 122 | } | ||
123 | 123 | | |||
▲ Show 20 Lines • Show All 577 Lines • Show Last 20 Lines |