From a77ae98fd0ea0c2efe86be048885387848eb4550 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 5 Feb 2016 14:41:35 -0300 Subject: [PATCH 1/2] Add keyboard shortcuts to change the color selector type (spectrum/color wheel) --- data/gui.xml | 8 +++++++- src/app/commands/cmd_set_color_selector.cpp | 22 ++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/data/gui.xml b/data/gui.xml index 1c81437e3..07f1d71ad 100644 --- a/data/gui.xml +++ b/data/gui.xml @@ -1,6 +1,6 @@ - + @@ -377,6 +377,12 @@ + + + + + + diff --git a/src/app/commands/cmd_set_color_selector.cpp b/src/app/commands/cmd_set_color_selector.cpp index 63fa0e12b..6f9e2ccee 100644 --- a/src/app/commands/cmd_set_color_selector.cpp +++ b/src/app/commands/cmd_set_color_selector.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2001-2015 David Capello +// Copyright (C) 2016 David Capello // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -25,6 +25,7 @@ protected: void onLoadParams(const Params& params) override; bool onChecked(Context* context) override; void onExecute(Context* context) override; + std::string onGetFriendlyName() const override; private: ColorBar::ColorSelector m_type; @@ -60,6 +61,25 @@ void SetColorSelectorCommand::onExecute(Context* context) ColorBar::instance()->setColorSelector(m_type); } +std::string SetColorSelectorCommand::onGetFriendlyName() const +{ + std::string result = "Set Color Selector: "; + + switch (m_type) { + case ColorBar::ColorSelector::SPECTRUM: + result += "Color Spectrum"; + break; + case ColorBar::ColorSelector::WHEEL: + result += "Color Wheel"; + break; + default: + result += "Unknown"; + break; + } + + return result; +} + Command* CommandFactory::createSetColorSelectorCommand() { return new SetColorSelectorCommand; From c1ae065c2c4cef76beca473d46df61c83b74fd83 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 12 Feb 2016 10:49:33 -0300 Subject: [PATCH 2/2] Add RYB color wheel (related to #707) --- data/gui.xml | 12 ++- data/pref.xml | 3 +- src/app/commands/cmd_set_color_selector.cpp | 15 +++- src/app/ui/color_bar.cpp | 9 ++- src/app/ui/color_bar.h | 5 +- src/app/ui/color_wheel.cpp | 81 +++++++++++++++++++-- src/app/ui/color_wheel.h | 14 +++- 7 files changed, 119 insertions(+), 20 deletions(-) diff --git a/data/gui.xml b/data/gui.xml index 07f1d71ad..61b8e33e1 100644 --- a/data/gui.xml +++ b/data/gui.xml @@ -381,7 +381,10 @@ - + + + + @@ -855,8 +858,11 @@ - - + + + + + diff --git a/data/pref.xml b/data/pref.xml index 5510a4661..8eaa1bbe2 100644 --- a/data/pref.xml +++ b/data/pref.xml @@ -1,6 +1,6 @@ - + @@ -114,6 +114,7 @@