[aseprite] 205/308: Add keyboard shortcuts to change the color selector type (spectrum/color wheel)
Tobias Hansen
thansen at moszumanska.debian.org
Tue Mar 8 02:45:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit a77ae98fd0ea0c2efe86be048885387848eb4550
Author: David Capello <davidcapello at gmail.com>
Date: Fri Feb 5 14:41:35 2016 -0300
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 1c81437..07f1d71 100644
--- a/data/gui.xml
+++ b/data/gui.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Aseprite -->
-<!-- Copyright (C) 2001-2015 by David Capello -->
+<!-- Copyright (C) 2001-2016 by David Capello -->
<gui version="1.1.2-dev">
<!-- Keyboard shortcuts -->
<keyboard version="1">
@@ -377,6 +377,12 @@
<key command="SetInkType"><param name="type" value="lock-alpha" /></key>
<key command="SetInkType"><param name="type" value="shading" /></key>
<key command="SetSameInk" />
+ <key command="SetColorSelector">
+ <param name="type" value="spectrum" />
+ </key>
+ <key command="SetColorSelector">
+ <param name="type" value="wheel" />
+ </key>
</commands>
<!-- Keyboard shortcuts to select tools -->
diff --git a/src/app/commands/cmd_set_color_selector.cpp b/src/app/commands/cmd_set_color_selector.cpp
index 63fa0e1..6f9e2cc 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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list