Initial steps for icon buttons.
This commit is contained in:
parent
8130308f7f
commit
f2ab532005
17 changed files with 66 additions and 2 deletions
|
@ -62,16 +62,21 @@ void Button::setEnabled(bool isEnabled)
|
|||
if (mEnabled != isEnabled)
|
||||
{
|
||||
mEnabled = isEnabled;
|
||||
if (mStyle.mState == ButtonData::State::Disabled)
|
||||
if (isEnabled && mStyle.mState == ButtonData::State::Disabled)
|
||||
{
|
||||
setState(ButtonData::State::Enabled);
|
||||
}
|
||||
else if (!isEnabled && mStyle.mState == ButtonData::State::Enabled)
|
||||
{
|
||||
setState(ButtonData::State::Disabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Button::updateState()
|
||||
{
|
||||
setBackground(mStyle.getContainerColor());
|
||||
setBackgroundOpacity(mStyle.getStateLayerOverlayOpacity());
|
||||
setBackgroundTone(mStyle.getContainerSurfaceTintColor());
|
||||
setElevation(mStyle.getContainerElevation());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue