[fixed]combobox appearance not affected by enabled state
Posted: Wed Jan 21, 2009 2:39 pm
The combo box control has no visual indication when it is disabled. I haven't checked other gui elements to see if they also have similar problems. I made the following change to disable the blue highlight on click and give it grey text so the user knows the combobox is disabled:
from CGUIComboBox.cpp in draw()
from CGUIComboBox.cpp in draw()
Code: Select all
@@ -343,8 +343,16 @@
LastFocus = currentFocus;
SelectedText->setBackgroundColor(skin->getColor(EGDC_HIGH_LIGHT));
- SelectedText->setDrawBackground(HasFocus);
- SelectedText->setOverrideColor(skin->getColor(HasFocus ? EGDC_HIGH_LIGHT_TEXT : EGDC_BUTTON_TEXT));
+ if (isEnabled())
+ {
+ SelectedText->setDrawBackground(HasFocus);
+ SelectedText->setOverrideColor(skin->getColor(HasFocus ? EGDC_HIGH_LIGHT_TEXT : EGDC_BUTTON_TEXT));
+ }
+ else
+ {
+ SelectedText->setDrawBackground(false);
+ SelectedText->setOverrideColor(skin->getColor(EGDC_GRAY_TEXT));
+ }
}
core::rect<s32> frameRect(AbsoluteRect);