summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-05-14 02:48:37 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2019-05-28 06:06:48 +0200
commit67fd47e909aa88584420c3351ab17308aeb4e911 (patch)
treee79a49a50da53d02262c0bef54747e4d20c5c541 /starmath
parent37103a3f008c13dee21d55c8da9e6af807b1997c (diff)
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@gmail.com> Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/ElementsDockingWindow.hxx1
-rw-r--r--starmath/source/ElementsDockingWindow.cxx23
2 files changed, 20 insertions, 4 deletions
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&)