From 38a83dd385adc1018d11e5a9f0a2e9a30a1c1973 Mon Sep 17 00:00:00 2001 From: Ayla Date: Thu, 14 Apr 2011 19:35:50 +0200 Subject: [PATCH] On the skin menu, the ALTLEFT/ALTRIGHT buttons will now respectively decrease/increase the ARGB values by 10. --- src/menusettingrgba.cpp | 15 +++++++++++++-- src/menusettingrgba.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/menusettingrgba.cpp b/src/menusettingrgba.cpp index e940d20..10ea776 100644 --- a/src/menusettingrgba.cpp +++ b/src/menusettingrgba.cpp @@ -90,6 +90,12 @@ void MenuSettingRGBA::manageInput(bevent_t *event) { case CLEAR: dec(); break; + case ALTLEFT: + update_value(-10); + break; + case ALTRIGHT: + update_value(10); + break; case LEFT: leftComponent(); break; @@ -101,14 +107,19 @@ void MenuSettingRGBA::manageInput(bevent_t *event) { } } +void MenuSettingRGBA::update_value(int value) +{ + setSelPart(constrain(getSelPart() + value, 0, 255)); +} + void MenuSettingRGBA::dec() { - setSelPart(constrain(getSelPart()-1,0,255)); + update_value(-1); } void MenuSettingRGBA::inc() { - setSelPart(constrain(getSelPart()+1,0,255)); + update_value(+1); } void MenuSettingRGBA::leftComponent() diff --git a/src/menusettingrgba.h b/src/menusettingrgba.h index 9c3d0e0..11f8814 100644 --- a/src/menusettingrgba.h +++ b/src/menusettingrgba.h @@ -34,6 +34,7 @@ private: RGBAColor originalValue; RGBAColor *_value; + void update_value(int value); void dec(); void inc(); void leftComponent();