From 1667662c5ceada526896088f4754717f8b723a45 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Wed, 16 Nov 2011 03:23:16 -0200 Subject: [PATCH] fix disabled state in uicheckbox --- modules/core_styles/styles/buttons.otui | 3 ++- modules/core_styles/styles/checkboxes.otui | 8 +++++++- src/framework/ui/uiwidget.cpp | 9 ++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/modules/core_styles/styles/buttons.otui b/modules/core_styles/styles/buttons.otui index 59ba2375..a1b0f8b8 100644 --- a/modules/core_styles/styles/buttons.otui +++ b/modules/core_styles/styles/buttons.otui @@ -4,6 +4,7 @@ Button < UIButton color: #f0ad4dff size: 106 24 text-translate: 0 0 + border-image: source: /core_styles/images/button.png border: 5 @@ -20,7 +21,7 @@ Button < UIButton border: 5 $disabled: - color: #999999 + color: #f0ad4d88 background-color: #ffffff88 TopButton < UIButton diff --git a/modules/core_styles/styles/checkboxes.otui b/modules/core_styles/styles/checkboxes.otui index 60f8a324..995a11c6 100644 --- a/modules/core_styles/styles/checkboxes.otui +++ b/modules/core_styles/styles/checkboxes.otui @@ -3,6 +3,8 @@ CheckBox < UICheckBox box-size: 12 12 text-offset: 16 -1 color: #aaaaaa + enabled: false + background-color: #ffffff88 $hover: color: #cccccc @@ -25,4 +27,8 @@ CheckBox < UICheckBox $hover checked: image: source: /core_styles/images/checkbox.png - coords: 0 36 12 12 \ No newline at end of file + coords: 0 36 12 12 + + $disabled + background-color: #ffffff88 + color: #aaaaaa88 \ No newline at end of file diff --git a/src/framework/ui/uiwidget.cpp b/src/framework/ui/uiwidget.cpp index dc71b50e..a30c962a 100644 --- a/src/framework/ui/uiwidget.cpp +++ b/src/framework/ui/uiwidget.cpp @@ -81,8 +81,8 @@ void UIWidget::destroy() if(parent->hasChild(asUIWidget())) parent->removeChild(asUIWidget()); } - setVisible(false); - setEnabled(false); + //setVisible(false); + //setEnabled(false); } void UIWidget::render() @@ -139,12 +139,14 @@ void UIWidget::setStyle(const std::string& styleName) OTMLNodePtr styleNode = g_ui.getStyle(styleName); applyStyle(styleNode); m_style = styleNode; + updateStyle(); } void UIWidget::setStyleFromNode(const OTMLNodePtr& styleNode) { applyStyle(styleNode); m_style = styleNode; + updateStyle(); } void UIWidget::setParent(const UIWidgetPtr& parent) @@ -751,8 +753,9 @@ void UIWidget::updateStyle() } // merge states styles - if(match) + if(match) { newStateStyle->merge(style); + } } }