From 4895f9de44713fdc574342e5b2993b9829cddb41 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 26 Aug 2020 17:37:35 +0100 Subject: use monoborder widget css name as a WindowBorderStyle::MONO replacement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I563f917c741130909a9d726754cd3eb23a651a11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101429 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/window/layout.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'vcl/source/window') diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index a4a008df7448..d6b9247b73ed 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1791,12 +1791,19 @@ VclScrolledWindow::VclScrolledWindow(vcl::Window *pParent) : VclBin(pParent, WB_HIDE | WB_CLIPCHILDREN | WB_AUTOHSCROLL | WB_AUTOVSCROLL | WB_TABSTOP) , m_bUserManagedScrolling(false) , m_eDrawFrameStyle(DrawFrameStyle::NONE) + , m_eDrawFrameFlags(DrawFrameFlags::NONE) , m_pVScroll(VclPtr::Create(this, WB_HIDE | WB_VERT)) , m_pHScroll(VclPtr::Create(this, WB_HIDE | WB_HORZ)) , m_aScrollBarBox(VclPtr::Create(this, WB_HIDE)) { SetType(WindowType::SCROLLWINDOW); + AllSettings aAllSettings = GetSettings(); + StyleSettings aStyle = aAllSettings.GetStyleSettings(); + aStyle.SetMonoColor(aStyle.GetActiveBorderColor()); + aAllSettings.SetStyleSettings(aStyle); + SetSettings(aAllSettings); + Link aLink( LINK( this, VclScrolledWindow, ScrollBarHdl ) ); m_pVScroll->SetScrollHdl(aLink); m_pHScroll->SetScrollHdl(aLink); @@ -2013,6 +2020,10 @@ bool VclScrolledWindow::set_property(const OString &rKey, const OUString &rValue m_eDrawFrameStyle = DrawFrameStyle::NONE; return true; } + else if (rKey == "name") + { + m_eDrawFrameFlags = rValue == "monoborder" ? DrawFrameFlags::Mono : DrawFrameFlags::NONE; + } bool bRet = VclBin::set_property(rKey, rValue); m_pVScroll->Show((GetStyle() & WB_VSCROLL) != 0); @@ -2043,7 +2054,7 @@ void VclScrolledWindow::Paint(vcl::RenderContext& rRenderContext, const tools::R { VclBin::Paint(rRenderContext, rRect); DecorationView aDecoView(&rRenderContext); - aDecoView.DrawFrame(tools::Rectangle(Point(0,0), GetSizePixel()), m_eDrawFrameStyle); + aDecoView.DrawFrame(tools::Rectangle(Point(0,0), GetSizePixel()), m_eDrawFrameStyle, m_eDrawFrameFlags); } void VclViewport::setAllocation(const Size &rAllocation) -- cgit v1.2.3