diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-26 17:37:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-27 10:16:19 +0200 |
commit | 4895f9de44713fdc574342e5b2993b9829cddb41 (patch) | |
tree | 6504ac653685d0a0226f827cd1aae1e8240937ae | |
parent | 3636972c4ef6135ffa8de7c94412b9cdcbaaf169 (diff) |
use monoborder widget css name as a WindowBorderStyle::MONO replacement
Change-Id: I563f917c741130909a9d726754cd3eb23a651a11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101429
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | dbaccess/uiconfig/ui/detailwindow.ui | 1 | ||||
-rw-r--r-- | include/vcl/layout.hxx | 1 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 13 |
3 files changed, 14 insertions, 1 deletions
diff --git a/dbaccess/uiconfig/ui/detailwindow.ui b/dbaccess/uiconfig/ui/detailwindow.ui index 36955532cf0c..19bf1e23361b 100644 --- a/dbaccess/uiconfig/ui/detailwindow.ui +++ b/dbaccess/uiconfig/ui/detailwindow.ui @@ -63,6 +63,7 @@ <property name="row_spacing">6</property> <child> <object class="GtkScrolledWindow"> + <property name="name">monoborder</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index 3fcfd58c3f43..3a5adbcf0aeb 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -522,6 +522,7 @@ private: virtual bool EventNotify(NotifyEvent& rNEvt) override; bool m_bUserManagedScrolling; DrawFrameStyle m_eDrawFrameStyle; + DrawFrameFlags m_eDrawFrameFlags; VclPtr<ScrollBar> m_pVScroll; VclPtr<ScrollBar> m_pHScroll; VclPtr<ScrollBarBox> m_aScrollBarBox; 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<ScrollBar>::Create(this, WB_HIDE | WB_VERT)) , m_pHScroll(VclPtr<ScrollBar>::Create(this, WB_HIDE | WB_HORZ)) , m_aScrollBarBox(VclPtr<ScrollBarBox>::Create(this, WB_HIDE)) { SetType(WindowType::SCROLLWINDOW); + AllSettings aAllSettings = GetSettings(); + StyleSettings aStyle = aAllSettings.GetStyleSettings(); + aStyle.SetMonoColor(aStyle.GetActiveBorderColor()); + aAllSettings.SetStyleSettings(aStyle); + SetSettings(aAllSettings); + Link<ScrollBar*,void> 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) |