Skip to content
Browse files

CGUIDialogSettings: fix OnSliderChanged not doing anything on popup s…

…liders

The problem is that setting->type is SettingInfo::BUTTON for any popup slider
and not SettingInfo::SLIDER or SettingInfo::RANGE. To determine if such a
setting uses a normal or a range slider, we need to check the slider.
  • Loading branch information...
1 parent ae0b8be commit 76f150476f2b9e0eccb9369384251745d0800bd7 @Montellese Montellese committed Oct 15, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −0 xbmc/guilib/GUISliderControl.h
  2. +2 −2 xbmc/settings/GUIDialogSettings.cpp
View
1 xbmc/guilib/GUISliderControl.h
@@ -72,6 +72,7 @@ class CGUISliderControl :
virtual bool OnMessage(CGUIMessage& message);
bool ProcessSelector(CGUITexture &nib, unsigned int currentTime, float fScaleY, RangeSelector selector);
void SetRangeSelection(bool rangeSelection);
+ bool GetRangeSelection() { return m_rangeSelection; }
void SetRangeSelector(RangeSelector selector);
void SwitchRangeSelector();
void SetInfo(int iInfo);
View
4 xbmc/settings/GUIDialogSettings.cpp
@@ -674,14 +674,14 @@ void CGUIDialogSettings::OnSliderChange(void *data, CGUISliderControl *slider)
return;
SettingInfo *setting = (SettingInfo *)data;
- if (setting->type == SettingInfo::SLIDER)
+ if (setting->type == SettingInfo::SLIDER || (setting->type == SettingInfo::BUTTON && m_usePopupSliders && !slider->GetRangeSelection()))
{
*(float *)setting->data = slider->GetFloatValue();
OnSettingChanged(*setting);
if (setting->formatFunction.standard)
slider->SetTextValue(setting->formatFunction.standard(slider->GetFloatValue(), setting->interval));
}
- else if (setting->type == SettingInfo::RANGE)
+ else if (setting->type == SettingInfo::RANGE || (setting->type == SettingInfo::BUTTON && m_usePopupSliders && slider->GetRangeSelection()))
{
*((float **)setting->data)[0] = slider->GetFloatValue(CGUISliderControl::RangeSelectorLower);
*((float **)setting->data)[1] = slider->GetFloatValue(CGUISliderControl::RangeSelectorUpper);

0 comments on commit 76f1504

Please sign in to comment.
Something went wrong with that request. Please try again.