fix disabled state in uicheckbox

This commit is contained in:
Eduardo Bart 2011-11-16 03:23:16 -02:00
parent 7ab67c012f
commit 1667662c5c
3 changed files with 15 additions and 5 deletions

View File

@ -4,6 +4,7 @@ Button < UIButton
color: #f0ad4dff color: #f0ad4dff
size: 106 24 size: 106 24
text-translate: 0 0 text-translate: 0 0
border-image: border-image:
source: /core_styles/images/button.png source: /core_styles/images/button.png
border: 5 border: 5
@ -20,7 +21,7 @@ Button < UIButton
border: 5 border: 5
$disabled: $disabled:
color: #999999 color: #f0ad4d88
background-color: #ffffff88 background-color: #ffffff88
TopButton < UIButton TopButton < UIButton

View File

@ -3,6 +3,8 @@ CheckBox < UICheckBox
box-size: 12 12 box-size: 12 12
text-offset: 16 -1 text-offset: 16 -1
color: #aaaaaa color: #aaaaaa
enabled: false
background-color: #ffffff88
$hover: $hover:
color: #cccccc color: #cccccc
@ -26,3 +28,7 @@ CheckBox < UICheckBox
image: image:
source: /core_styles/images/checkbox.png source: /core_styles/images/checkbox.png
coords: 0 36 12 12 coords: 0 36 12 12
$disabled
background-color: #ffffff88
color: #aaaaaa88

View File

@ -81,8 +81,8 @@ void UIWidget::destroy()
if(parent->hasChild(asUIWidget())) if(parent->hasChild(asUIWidget()))
parent->removeChild(asUIWidget()); parent->removeChild(asUIWidget());
} }
setVisible(false); //setVisible(false);
setEnabled(false); //setEnabled(false);
} }
void UIWidget::render() void UIWidget::render()
@ -139,12 +139,14 @@ void UIWidget::setStyle(const std::string& styleName)
OTMLNodePtr styleNode = g_ui.getStyle(styleName); OTMLNodePtr styleNode = g_ui.getStyle(styleName);
applyStyle(styleNode); applyStyle(styleNode);
m_style = styleNode; m_style = styleNode;
updateStyle();
} }
void UIWidget::setStyleFromNode(const OTMLNodePtr& styleNode) void UIWidget::setStyleFromNode(const OTMLNodePtr& styleNode)
{ {
applyStyle(styleNode); applyStyle(styleNode);
m_style = styleNode; m_style = styleNode;
updateStyle();
} }
void UIWidget::setParent(const UIWidgetPtr& parent) void UIWidget::setParent(const UIWidgetPtr& parent)
@ -751,10 +753,11 @@ void UIWidget::updateStyle()
} }
// merge states styles // merge states styles
if(match) if(match) {
newStateStyle->merge(style); newStateStyle->merge(style);
} }
} }
}
applyStyle(newStateStyle); applyStyle(newStateStyle);
m_stateStyle = newStateStyle; m_stateStyle = newStateStyle;