[Libreoffice-commits] core.git: starmath/inc starmath/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Tue May 28 04:07:22 UTC 2019


 starmath/inc/ElementsDockingWindow.hxx    |    1 +
 starmath/source/ElementsDockingWindow.cxx |   23 +++++++++++++++++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

New commits:
commit 67fd47e909aa88584420c3351ab17308aeb4e911
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Tue May 14 02:48:37 2019 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Tue May 28 06:06:48 2019 +0200

    tdf#125454 SM use theming for element list
    
    This uses the same background color then the edit entries and
    changes the focus from the gray filled rectangle to a non-filled
    rectangle using the general highlight color.
    
    Change-Id: I4b44811e768266ccd2081a8e3ef61483a803da3b
    Reviewed-on: https://gerrit.libreoffice.org/72795
    Reviewed-by: Heiko Tietze <tietze.heiko at gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx
index 874735a8a44f..c68d442bef3d 100644
--- a/starmath/inc/ElementsDockingWindow.hxx
+++ b/starmath/inc/ElementsDockingWindow.hxx
@@ -73,6 +73,7 @@ class SmElementsControl : public Control
     static const std::pair<const char*, const char*> aOthers[];
 
     virtual void ApplySettings(vcl::RenderContext&) override;
+    virtual void DataChanged(const DataChangedEvent&) override;
     virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
     virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
     virtual void MouseMove(const MouseEvent& rMEvt) override;
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 385d33d795b5..43948cd18106 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -378,9 +378,10 @@ void SmElementsControl::LayoutOrPaintContents(vcl::RenderContext *pContext)
                 if (pCurrentElement == element)
                 {
                     pContext->Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
-                    pContext->SetFillColor(Color(230, 230, 230));
-                    pContext->SetLineColor(Color(230, 230, 230));
-
+                    const StyleSettings& rStyleSettings = pContext->GetSettings().GetStyleSettings();
+                    pContext->SetLineColor(rStyleSettings.GetHighlightColor());
+                    pContext->SetFillColor(COL_TRANSPARENT);
+                    pContext->DrawRect(PixelToLogic(tools::Rectangle(x + 1, y + 1, x + boxX - 1, y + boxY - 1)));
                     pContext->DrawRect(PixelToLogic(tools::Rectangle(x + 2, y + 2, x + boxX - 2, y + boxY - 2)));
                     pContext->Pop();
                 }
@@ -452,7 +453,21 @@ void SmElementsControl::Resize()
 
 void SmElementsControl::ApplySettings(vcl::RenderContext& rRenderContext)
 {
-    rRenderContext.SetBackground(COL_WHITE);
+    const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
+    rRenderContext.SetBackground(rStyleSettings.GetFieldColor());
+}
+
+void SmElementsControl::DataChanged(const DataChangedEvent& rDCEvt)
+{
+    Window::DataChanged(rDCEvt);
+
+    if (!((rDCEvt.GetType() == DataChangedEventType::FONTS) ||
+          (rDCEvt.GetType() == DataChangedEventType::FONTSUBSTITUTION) ||
+          ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
+           (rDCEvt.GetFlags() & AllSettingsFlags::STYLE))))
+        return;
+
+    Invalidate();
 }
 
 void SmElementsControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)


More information about the Libreoffice-commits mailing list