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

View File

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

View File

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