mirror of
https://github.com/edubart/otclient.git
synced 2025-12-20 15:37:11 +01:00
change interface style, add top menu
This commit is contained in:
@@ -59,6 +59,7 @@ void UIWidget::setup()
|
||||
setVisible(true);
|
||||
setEnabled(true);
|
||||
setFocusable(true);
|
||||
setPhantom(false);
|
||||
setPressed(false);
|
||||
setSizeFixed(false);
|
||||
setFont(g_fonts.getDefaultFont());
|
||||
@@ -732,10 +733,18 @@ void UIWidget::onStyleApply(const OTMLNodePtr& styleNode)
|
||||
else if(node->tag() == "opacity") {
|
||||
setOpacity(node->value<int>());
|
||||
}
|
||||
// enabled
|
||||
else if(node->tag() == "enabled") {
|
||||
setEnabled(node->value<bool>());
|
||||
}
|
||||
// focusable
|
||||
else if(node->tag() == "focusable") {
|
||||
setFocusable(node->value<bool>());
|
||||
}
|
||||
// focusable
|
||||
else if(node->tag() == "phantom") {
|
||||
setPhantom(node->value<bool>());
|
||||
}
|
||||
// size
|
||||
else if(node->tag() == "size") {
|
||||
resize(node->value<Size>());
|
||||
@@ -910,8 +919,11 @@ bool UIWidget::onMousePress(const Point& mousePos, Fw::MouseButton button)
|
||||
|
||||
bool mustEnd = child->onMousePress(mousePos, button);
|
||||
|
||||
if(!child->getChildByPos(mousePos) && !child->isPressed())
|
||||
child->setPressed(true);
|
||||
if(button == Fw::MouseLeftButton && !child->isPressed()) {
|
||||
UIWidgetPtr clickedChild = child->getChildByPos(mousePos);
|
||||
if(!clickedChild || clickedChild->isPhantom())
|
||||
child->setPressed(true);
|
||||
}
|
||||
|
||||
if(mustEnd)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user