From aa8ac5da956173d31381873c5baf1c738c4bddb2 Mon Sep 17 00:00:00 2001 From: houzh <13923402541@gitee.com> Date: Fri, 18 Aug 2023 15:54:35 +0000 Subject: [PATCH 1/2] fix selecttextcolor while colorstatelist exists --- src/gui/widget/numberpicker.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/numberpicker.cc b/src/gui/widget/numberpicker.cc index aa44e0d0..30a29294 100644 --- a/src/gui/widget/numberpicker.cc +++ b/src/gui/widget/numberpicker.cc @@ -87,7 +87,8 @@ NumberPicker::NumberPicker(Context* context,const AttributeSet& atts) setTextColor(mTextColor,atts.getColor("textColor2",mTextColor)); setSelectedTextColor(atts.getColor("selectedTextColor")); ColorStateList*colors=mSelectedText->getTextColors(); - mTextColor = colors->getColorForState(StateSet::get(StateSet::VIEW_STATE_ENABLED),Color::WHITE); + if(colors->isStateful()) + mTextColor = colors->getColorForState(StateSet::get(StateSet::VIEW_STATE_ENABLED),mTextColor); updateInputTextView(); setValue(atts.getInt("value",0)); From aad95209c768111e09a763349dacd6e00d0b4042 Mon Sep 17 00:00:00 2001 From: houzh <13923402541@gitee.com> Date: Fri, 18 Aug 2023 16:01:28 +0000 Subject: [PATCH 2/2] numberpicker modifies --- src/gui/widget/numberpicker.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/numberpicker.cc b/src/gui/widget/numberpicker.cc index 30a29294..ddc5e1a3 100644 --- a/src/gui/widget/numberpicker.cc +++ b/src/gui/widget/numberpicker.cc @@ -88,7 +88,7 @@ NumberPicker::NumberPicker(Context* context,const AttributeSet& atts) setSelectedTextColor(atts.getColor("selectedTextColor")); ColorStateList*colors=mSelectedText->getTextColors(); if(colors->isStateful()) - mTextColor = colors->getColorForState(StateSet::get(StateSet::VIEW_STATE_ENABLED),mTextColor); + setSelectedTextColor(colors->getColorForState(StateSet::get(StateSet::VIEW_STATE_ENABLED),mSelectedTextColor)); updateInputTextView(); setValue(atts.getInt("value",0));