Kaydet (Commit) 67fd47e9 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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/72795Reviewed-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
Tested-by: Jenkins
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst 37103a3f
...@@ -73,6 +73,7 @@ class SmElementsControl : public Control ...@@ -73,6 +73,7 @@ class SmElementsControl : public Control
static const std::pair<const char*, const char*> aOthers[]; static const std::pair<const char*, const char*> aOthers[];
virtual void ApplySettings(vcl::RenderContext&) override; virtual void ApplySettings(vcl::RenderContext&) override;
virtual void DataChanged(const DataChangedEvent&) override;
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
virtual void MouseButtonDown(const MouseEvent& rMEvt) override; virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
virtual void MouseMove(const MouseEvent& rMEvt) override; virtual void MouseMove(const MouseEvent& rMEvt) override;
......
...@@ -378,9 +378,10 @@ void SmElementsControl::LayoutOrPaintContents(vcl::RenderContext *pContext) ...@@ -378,9 +378,10 @@ void SmElementsControl::LayoutOrPaintContents(vcl::RenderContext *pContext)
if (pCurrentElement == element) if (pCurrentElement == element)
{ {
pContext->Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR); pContext->Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
pContext->SetFillColor(Color(230, 230, 230)); const StyleSettings& rStyleSettings = pContext->GetSettings().GetStyleSettings();
pContext->SetLineColor(Color(230, 230, 230)); 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->DrawRect(PixelToLogic(tools::Rectangle(x + 2, y + 2, x + boxX - 2, y + boxY - 2)));
pContext->Pop(); pContext->Pop();
} }
...@@ -452,7 +453,21 @@ void SmElementsControl::Resize() ...@@ -452,7 +453,21 @@ void SmElementsControl::Resize()
void SmElementsControl::ApplySettings(vcl::RenderContext& rRenderContext) 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&) void SmElementsControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment