mirror of
https://github.com/edubart/otclient.git
synced 2025-12-20 15:37:11 +01:00
scrollbar, options and widgets changes
* complete scrollbar skin * implement scrollbar functionality (scrolling with mouse) * fix onMouseClick issues * add tabs in options (graphics and general tab) * add new option for limiting frame rate using scrollbar * add new widget property "clipping" that will be used on scrollable areas
This commit is contained in:
@@ -53,20 +53,14 @@ UIWidget::~UIWidget()
|
||||
|
||||
void UIWidget::draw(const Rect& visibleRect)
|
||||
{
|
||||
if(m_clipping)
|
||||
g_graphics.beginClipping(visibleRect);
|
||||
|
||||
drawSelf();
|
||||
if(m_children.size() > 0) {
|
||||
bool clip = true;
|
||||
if(this == g_ui.getRootWidget().get())
|
||||
clip = false;
|
||||
drawChildren(visibleRect);
|
||||
|
||||
if(clip)
|
||||
g_graphics.beginClipping(visibleRect);
|
||||
|
||||
drawChildren(visibleRect);
|
||||
|
||||
if(clip)
|
||||
g_graphics.endClipping();
|
||||
}
|
||||
if(m_clipping)
|
||||
g_graphics.endClipping();
|
||||
}
|
||||
|
||||
void UIWidget::drawSelf()
|
||||
@@ -1325,12 +1319,20 @@ bool UIWidget::onMouseWheel(const Point& mousePos, Fw::MouseWheelDirection direc
|
||||
|
||||
bool UIWidget::onClick(const Point& mousePos)
|
||||
{
|
||||
return callLuaField<bool>("onClick", mousePos);
|
||||
if(hasLuaField("onClick")) {
|
||||
callLuaField("onClick", mousePos);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UIWidget::onDoubleClick(const Point& mousePos)
|
||||
{
|
||||
return callLuaField<bool>("onDoubleClick", mousePos);
|
||||
if(hasLuaField("onDoubleClick")) {
|
||||
callLuaField("onDoubleClick", mousePos);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UIWidget::propagateOnKeyText(const std::string& keyText)
|
||||
|
||||
Reference in New Issue
Block a user