diff --git a/Thirdparty/ZWidget/src/core/canvas.cpp b/Thirdparty/ZWidget/src/core/canvas.cpp index 9faccfa0..eab9f0ee 100644 --- a/Thirdparty/ZWidget/src/core/canvas.cpp +++ b/Thirdparty/ZWidget/src/core/canvas.cpp @@ -769,7 +769,7 @@ void BitmapCanvas::drawGlyph(CanvasTexture* texture, float left, float top, floa uint32_t cgreen = (int32_t)clamp(color.g * 255.0f, 0.0f, 255.0f); uint32_t cblue = (int32_t)clamp(color.b * 255.0f, 0.0f, 255.0f); #ifdef USE_SSE2 - __m128i crgba = _mm_set_epi16(0, cblue, cgreen, cred, 0, cblue, cgreen, cred); + __m128i crgba = _mm_set_epi16(0, cred, cgreen, cblue, 0, cred, cgreen, cblue); #endif float uscale = uvwidth / width; diff --git a/Thirdparty/ZWidget/src/core/theme.cpp b/Thirdparty/ZWidget/src/core/theme.cpp index de779561..f30bffdf 100644 --- a/Thirdparty/ZWidget/src/core/theme.cpp +++ b/Thirdparty/ZWidget/src/core/theme.cpp @@ -153,6 +153,7 @@ DarkWidgetTheme::DarkWidgetTheme() auto tabbar = RegisterStyle(std::make_unique(widget), "tabbar"); auto tabbar_tab = RegisterStyle(std::make_unique(widget), "tabbar-tab"); auto tabwidget_stack = RegisterStyle(std::make_unique(widget), "tabwidget-stack"); + auto checkbox_label = RegisterStyle(std::make_unique(widget), "checkbox-label"); widget->SetString("font-family", "NotoSans"); widget->SetColor("color", Colorf::fromRgba8(226, 223, 219)); @@ -222,6 +223,12 @@ DarkWidgetTheme::DarkWidgetTheme() tabwidget_stack->SetDouble("noncontent-top", 5.0); tabwidget_stack->SetDouble("noncontent-right", 20.0); tabwidget_stack->SetDouble("noncontent-bottom", 5.0); + + checkbox_label->SetColor("checked-outer-border-color", Colorf::fromRgba8(100, 100, 100)); + checkbox_label->SetColor("checked-inner-border-color", Colorf::fromRgba8(51, 51, 51)); + checkbox_label->SetColor("checked-color", Colorf::fromRgba8(226, 223, 219)); + checkbox_label->SetColor("unchecked-outer-border-color", Colorf::fromRgba8(99, 99, 99)); + checkbox_label->SetColor("unchecked-inner-border-color", Colorf::fromRgba8(51, 51, 51)); } ///////////////////////////////////////////////////////////////////////////// @@ -238,10 +245,14 @@ LightWidgetTheme::LightWidgetTheme() auto tabbar = RegisterStyle(std::make_unique(widget), "tabbar"); auto tabbar_tab = RegisterStyle(std::make_unique(widget), "tabbar-tab"); auto tabwidget_stack = RegisterStyle(std::make_unique(widget), "tabwidget-stack"); + auto checkbox_label = RegisterStyle(std::make_unique(widget), "checkbox-label"); widget->SetString("font-family", "NotoSans"); widget->SetColor("color", Colorf::fromRgba8(0, 0, 0)); widget->SetColor("window-background", Colorf::fromRgba8(240, 240, 240)); + widget->SetColor("window-border", Colorf::fromRgba8(100, 100, 100)); + widget->SetColor("window-caption-color", Colorf::fromRgba8(70, 70, 70)); + widget->SetColor("window-caption-text-color", Colorf::fromRgba8(226, 223, 219)); pushbutton->SetDouble("noncontent-left", 10.0); pushbutton->SetDouble("noncontent-top", 5.0); @@ -304,4 +315,10 @@ LightWidgetTheme::LightWidgetTheme() tabwidget_stack->SetDouble("noncontent-top", 5.0); tabwidget_stack->SetDouble("noncontent-right", 20.0); tabwidget_stack->SetDouble("noncontent-bottom", 5.0); + + checkbox_label->SetColor("checked-outer-border-color", Colorf::fromRgba8(155, 155, 155)); + checkbox_label->SetColor("checked-inner-border-color", Colorf::fromRgba8(200, 200, 200)); + checkbox_label->SetColor("checked-color", Colorf::fromRgba8(50, 50, 50)); + checkbox_label->SetColor("unchecked-outer-border-color", Colorf::fromRgba8(156, 156, 156)); + checkbox_label->SetColor("unchecked-inner-border-color", Colorf::fromRgba8(200, 200, 200)); } diff --git a/Thirdparty/ZWidget/src/core/widget.cpp b/Thirdparty/ZWidget/src/core/widget.cpp index 9cf5dda2..e27fff17 100644 --- a/Thirdparty/ZWidget/src/core/widget.cpp +++ b/Thirdparty/ZWidget/src/core/widget.cpp @@ -582,8 +582,10 @@ void Widget::OnWindowMouseMove(const Point& pos) do { widget->OnMouseMove(widget->MapFrom(this, pos)); + if (widget == this) + break; widget = widget->Parent(); - } while (widget != this); + } while (widget); } } diff --git a/Thirdparty/ZWidget/src/widgets/checkboxlabel/checkboxlabel.cpp b/Thirdparty/ZWidget/src/widgets/checkboxlabel/checkboxlabel.cpp index 1738624f..f7899889 100644 --- a/Thirdparty/ZWidget/src/widgets/checkboxlabel/checkboxlabel.cpp +++ b/Thirdparty/ZWidget/src/widgets/checkboxlabel/checkboxlabel.cpp @@ -3,6 +3,7 @@ CheckboxLabel::CheckboxLabel(Widget* parent) : Widget(parent) { + SetStyleClass("checkbox-label"); } void CheckboxLabel::SetText(const std::string& value) @@ -42,17 +43,17 @@ void CheckboxLabel::OnPaint(Canvas* canvas) { if (checked) { - canvas->fillRect(Rect::xywh(0.0, GetHeight() * 0.5 - 6.0, 10.0, 10.0), Colorf::fromRgba8(100, 100, 100)); - canvas->fillRect(Rect::xywh(1.0, GetHeight() * 0.5 - 5.0, 8.0, 8.0), Colorf::fromRgba8(51, 51, 51)); - canvas->fillRect(Rect::xywh(2.0, GetHeight() * 0.5 - 4.0, 6.0, 6.0), Colorf::fromRgba8(226, 223, 219)); + canvas->fillRect(Rect::xywh(0.0, GetHeight() * 0.5 - 6.0, 10.0, 10.0), GetStyleColor("checked-outer-border-color")); + canvas->fillRect(Rect::xywh(1.0, GetHeight() * 0.5 - 5.0, 8.0, 8.0), GetStyleColor("checked-inner-border-color")); + canvas->fillRect(Rect::xywh(2.0, GetHeight() * 0.5 - 4.0, 6.0, 6.0), GetStyleColor("checked-color")); } else { - canvas->fillRect(Rect::xywh(0.0, GetHeight() * 0.5 - 6.0, 10.0, 10.0), Colorf::fromRgba8(99, 99, 99)); - canvas->fillRect(Rect::xywh(1.0, GetHeight() * 0.5 - 5.0, 8.0, 8.0), Colorf::fromRgba8(51, 51, 51)); + canvas->fillRect(Rect::xywh(0.0, GetHeight() * 0.5 - 6.0, 10.0, 10.0), GetStyleColor("unchecked-outer-border-color")); + canvas->fillRect(Rect::xywh(1.0, GetHeight() * 0.5 - 5.0, 8.0, 8.0), GetStyleColor("unchecked-inner-border-color")); } - canvas->drawText(Point(14.0, GetHeight() - 5.0), Colorf::fromRgba8(255, 255, 255), text); + canvas->drawText(Point(14.0, GetHeight() - 5.0), GetStyleColor("color"), text); } bool CheckboxLabel::OnMouseDown(const Point& pos, InputKey key)