some fancy

This commit is contained in:
Eduardo Bart 2011-08-26 15:56:56 -03:00
parent 0749e6a9d5
commit ccc4c1ba5e
3 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Button < UIButton Button < UIButton
font: helvetica-11px-bold font: helvetica-11px-bold
background-color: #ffffff
color: #f0ad4dff color: #f0ad4dff
size: 106 24 size: 106 24
border-image: border-image:
@ -17,3 +18,6 @@ Button < UIButton
source: /core_ui/images/button_down.png source: /core_ui/images/button_down.png
border: 5 border: 5
state.disabled:
color: #999999
background-color: #ffffff88

View File

@ -5,11 +5,13 @@ FlatPanel < Panel
source: /core_ui/images/panel_flat.png source: /core_ui/images/panel_flat.png
border: 4 border: 4
RoundedPanel < Panel RoundedPanel < Panel
color: #ffffffc0 background-color: #ffffffdd
border-image: border-image:
source: /core_ui/images/panel_rounded.png source: /core_ui/images/panel_rounded.png
border: 4 border: 4
RectPanel < UIWidget RectPanel < UIWidget
image: /core_ui/images/empty_rect.png image: /core_ui/images/empty_rect.png

View File

@ -503,7 +503,7 @@ void UIWidget::updateState(WidgetState state)
UIWidgetPtr parent; UIWidgetPtr parent;
do { do {
parent = widget->getParent(); parent = widget->getParent();
if(!widget->getRect().contains(mousePos) || if(!widget->isExplicitlyEnabled() || !widget->getRect().contains(mousePos) ||
(parent && widget != parent->getChildByPos(mousePos))) { (parent && widget != parent->getChildByPos(mousePos))) {
newStatus = false; newStatus = false;
break; break;
@ -514,14 +514,16 @@ void UIWidget::updateState(WidgetState state)
newStatus = m_pressed; newStatus = m_pressed;
} }
else if(state == DisabledState) { else if(state == DisabledState) {
bool enabled = true;
updateChildren = true; updateChildren = true;
UIWidgetPtr widget = asUIWidget(); UIWidgetPtr widget = asUIWidget();
do { do {
if(!widget->isExplicitlyEnabled()) { if(!widget->isExplicitlyEnabled()) {
newStatus = false; enabled = false;
break; break;
} }
} while(widget = widget->getParent()); } while(widget = widget->getParent());
newStatus = !enabled;
} }
else { else {
return; return;