diff options
author | Jacek Antonelli | 2010-02-04 19:55:07 -0600 |
---|---|---|
committer | Jacek Antonelli | 2010-02-04 20:54:34 -0600 |
commit | d414063e6c590728348fb1127da4c90a9896d691 (patch) | |
tree | 4e25233de2c3c50d3dba27892b43b80df97c6094 /linden | |
parent | Slider widgets can now be controlled with mouse wheel. (diff) | |
download | meta-impy-d414063e6c590728348fb1127da4c90a9896d691.zip meta-impy-d414063e6c590728348fb1127da4c90a9896d691.tar.gz meta-impy-d414063e6c590728348fb1127da4c90a9896d691.tar.bz2 meta-impy-d414063e6c590728348fb1127da4c90a9896d691.tar.xz |
Added SliderScrollWheelMultiplier setting.
Affects the direction sliders move from mouse scroll wheel.
Also added LLSlider::getScrollWheelMultiplier() and
LLSlider::setScrollWheelMultiplier().
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/llslider.cpp | 21 | ||||
-rw-r--r-- | linden/indra/llui/llslider.h | 5 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 3 | ||||
-rw-r--r-- | linden/indra/newview/llviewercontrol.cpp | 9 |
5 files changed, 48 insertions, 1 deletions
diff --git a/linden/indra/llui/llslider.cpp b/linden/indra/llui/llslider.cpp index 83b4d65..5c17baa 100644 --- a/linden/indra/llui/llslider.cpp +++ b/linden/indra/llui/llslider.cpp | |||
@@ -46,6 +46,10 @@ static LLRegisterWidget<LLSlider> r1("slider_bar"); | |||
46 | static LLRegisterWidget<LLSlider> r2("volume_slider"); | 46 | static LLRegisterWidget<LLSlider> r2("volume_slider"); |
47 | 47 | ||
48 | 48 | ||
49 | // This is overridden based on user's settings. | ||
50 | S32 LLSlider::sScrollWheelMultiplier = 1; | ||
51 | |||
52 | |||
49 | LLSlider::LLSlider( | 53 | LLSlider::LLSlider( |
50 | const std::string& name, | 54 | const std::string& name, |
51 | const LLRect& rect, | 55 | const LLRect& rect, |
@@ -222,12 +226,27 @@ BOOL LLSlider::handleMouseDown(S32 x, S32 y, MASK mask) | |||
222 | return TRUE; | 226 | return TRUE; |
223 | } | 227 | } |
224 | 228 | ||
229 | |||
230 | // static | ||
231 | void LLSlider::setScrollWheelMultiplier( S32 mult ) | ||
232 | { | ||
233 | sScrollWheelMultiplier = mult; | ||
234 | } | ||
235 | |||
236 | // static | ||
237 | S32 LLSlider::getScrollWheelMultiplier() | ||
238 | { | ||
239 | return sScrollWheelMultiplier; | ||
240 | } | ||
241 | |||
225 | BOOL LLSlider::handleScrollWheel(S32 x, S32 y, S32 clicks) | 242 | BOOL LLSlider::handleScrollWheel(S32 x, S32 y, S32 clicks) |
226 | { | 243 | { |
227 | setValueAndCommit(getValueF32() - ( getIncrement()* (F32)clicks )); | 244 | S32 mult = LLSlider::getScrollWheelMultiplier(); |
245 | setValueAndCommit(getValueF32() - (getIncrement() * (F32)clicks * mult)); | ||
228 | return TRUE; | 246 | return TRUE; |
229 | } | 247 | } |
230 | 248 | ||
249 | |||
231 | BOOL LLSlider::handleKeyHere(KEY key, MASK mask) | 250 | BOOL LLSlider::handleKeyHere(KEY key, MASK mask) |
232 | { | 251 | { |
233 | BOOL handled = FALSE; | 252 | BOOL handled = FALSE; |
diff --git a/linden/indra/llui/llslider.h b/linden/indra/llui/llslider.h index 9fc85f2..d558ce2 100644 --- a/linden/indra/llui/llslider.h +++ b/linden/indra/llui/llslider.h | |||
@@ -56,6 +56,9 @@ public: | |||
56 | virtual LLXMLNodePtr getXML(bool save_children = true) const; | 56 | virtual LLXMLNodePtr getXML(bool save_children = true) const; |
57 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); | 57 | static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); |
58 | 58 | ||
59 | static void setScrollWheelMultiplier( S32 mult ); | ||
60 | static S32 getScrollWheelMultiplier(); | ||
61 | |||
59 | void setValue( F32 value, BOOL from_event = FALSE ); | 62 | void setValue( F32 value, BOOL from_event = FALSE ); |
60 | F32 getValueF32() const { return mValue; } | 63 | F32 getValueF32() const { return mValue; } |
61 | 64 | ||
@@ -107,6 +110,8 @@ private: | |||
107 | 110 | ||
108 | void (*mMouseDownCallback)(LLUICtrl* ctrl, void* userdata); | 111 | void (*mMouseDownCallback)(LLUICtrl* ctrl, void* userdata); |
109 | void (*mMouseUpCallback)(LLUICtrl* ctrl, void* userdata); | 112 | void (*mMouseUpCallback)(LLUICtrl* ctrl, void* userdata); |
113 | |||
114 | static S32 sScrollWheelMultiplier; | ||
110 | }; | 115 | }; |
111 | 116 | ||
112 | #endif // LL_LLSLIDER_H | 117 | #endif // LL_LLSLIDER_H |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 76183ef..f8594ad 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -9458,6 +9458,17 @@ | |||
9458 | <integer>29</integer> | 9458 | <integer>29</integer> |
9459 | </array> | 9459 | </array> |
9460 | </map> | 9460 | </map> |
9461 | <key>SliderScrollWheelMultiplier</key> | ||
9462 | <map> | ||
9463 | <key>Comment</key> | ||
9464 | <string>Multiplier for the amount the mouse scroll wheel affects slider widgets in the UI. E.g. -1 makes sliders move the opposite way when scrolled.</string> | ||
9465 | <key>Persist</key> | ||
9466 | <integer>1</integer> | ||
9467 | <key>Type</key> | ||
9468 | <string>S32</string> | ||
9469 | <key>Value</key> | ||
9470 | <integer>1</integer> | ||
9471 | </map> | ||
9461 | <key>SmallAvatarNames</key> | 9472 | <key>SmallAvatarNames</key> |
9462 | <map> | 9473 | <map> |
9463 | <key>Comment</key> | 9474 | <key>Comment</key> |
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index f1c6064..a57050d 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -146,6 +146,7 @@ | |||
146 | #include "llvovolume.h" | 146 | #include "llvovolume.h" |
147 | #include "llflexibleobject.h" | 147 | #include "llflexibleobject.h" |
148 | #include "llvosurfacepatch.h" | 148 | #include "llvosurfacepatch.h" |
149 | #include "llslider.h" | ||
149 | 150 | ||
150 | // includes for idle() idleShutdown() | 151 | // includes for idle() idleShutdown() |
151 | #include "llviewercontrol.h" | 152 | #include "llviewercontrol.h" |
@@ -422,6 +423,8 @@ static void settings_to_globals() | |||
422 | LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); | 423 | LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); |
423 | 424 | ||
424 | LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); | 425 | LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); |
426 | |||
427 | LLSlider::setScrollWheelMultiplier( gSavedSettings.getS32("SliderScrollWheelMultiplier") ); | ||
425 | } | 428 | } |
426 | 429 | ||
427 | static void settings_modify() | 430 | static void settings_modify() |
diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp index b9db346..08e9d45 100644 --- a/linden/indra/newview/llviewercontrol.cpp +++ b/linden/indra/newview/llviewercontrol.cpp | |||
@@ -71,6 +71,8 @@ | |||
71 | #include "llvowlsky.h" | 71 | #include "llvowlsky.h" |
72 | #include "llrender.h" | 72 | #include "llrender.h" |
73 | #include "llmediamanager.h" | 73 | #include "llmediamanager.h" |
74 | #include "llslider.h" | ||
75 | |||
74 | 76 | ||
75 | #ifdef TOGGLE_HACKED_GODLIKE_VIEWER | 77 | #ifdef TOGGLE_HACKED_GODLIKE_VIEWER |
76 | BOOL gHackGodmode = FALSE; | 78 | BOOL gHackGodmode = FALSE; |
@@ -462,6 +464,12 @@ bool handleMediaDebugLevelChanged(const LLSD& newvalue) | |||
462 | return true; | 464 | return true; |
463 | } | 465 | } |
464 | 466 | ||
467 | bool handleSliderScrollWheelMultiplierChanged(const LLSD& newvalue) | ||
468 | { | ||
469 | LLSlider::setScrollWheelMultiplier( newvalue.asInteger() ); | ||
470 | return true; | ||
471 | } | ||
472 | |||
465 | //////////////////////////////////////////////////////////////////////////// | 473 | //////////////////////////////////////////////////////////////////////////// |
466 | 474 | ||
467 | void settings_setup_listeners() | 475 | void settings_setup_listeners() |
@@ -592,6 +600,7 @@ void settings_setup_listeners() | |||
592 | gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); | 600 | gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); |
593 | gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); | 601 | gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); |
594 | gSavedSettings.getControl("MediaDebugLevel")->getSignal()->connect(boost::bind(&handleMediaDebugLevelChanged, _1)); | 602 | gSavedSettings.getControl("MediaDebugLevel")->getSignal()->connect(boost::bind(&handleMediaDebugLevelChanged, _1)); |
603 | gSavedSettings.getControl("SliderScrollWheelMultiplier")->getSignal()->connect(boost::bind(&handleSliderScrollWheelMultiplierChanged, _1)); | ||
595 | 604 | ||
596 | // [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.1h | 605 | // [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.1h |
597 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) | 606 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) |