include/vcl/decoview.hxx | 10 ---------- include/vcl/layout.hxx | 1 + include/vcl/vclenum.hxx | 11 +++++++++++ vcl/source/window/layout.cxx | 19 ++++++++++++++++++- 4 files changed, 30 insertions(+), 11 deletions(-)
New commits: commit bfdee54f8cd0fa987d004e42564a19aba24b4393 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Dec 4 12:11:49 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Dec 4 14:32:57 2019 +0100 honour GtkScrolledWindow shadow-type Change-Id: If6cc9f9f6c310261d783f2698b86329aa2a12c5a Reviewed-on: https://gerrit.libreoffice.org/84401 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/decoview.hxx b/include/vcl/decoview.hxx index 5bcdcc1a208a..40dc600b87d2 100644 --- a/include/vcl/decoview.hxx +++ b/include/vcl/decoview.hxx @@ -43,16 +43,6 @@ namespace o3tl } // Flags for DrawFrame() -enum class DrawFrameStyle -{ - NONE = 0x0000, - In = 0x0001, - Out = 0x0002, - Group = 0x0003, - DoubleIn = 0x0004, - DoubleOut = 0x0005, - NWF = 0x0006, -}; enum class DrawFrameFlags { NONE = 0x0000, diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index f60014bb315d..9d8290929db6 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -521,6 +521,7 @@ private: void InitScrollBars(const Size &rRequest); virtual bool EventNotify(NotifyEvent& rNEvt) override; bool m_bUserManagedScrolling; + DrawFrameStyle m_eDrawFrameStyle; VclPtr<ScrollBar> m_pVScroll; VclPtr<ScrollBar> m_pHScroll; VclPtr<ScrollBarBox> m_aScrollBarBox; diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx index 95650b2ed889..738dca1fc3b0 100644 --- a/include/vcl/vclenum.hxx +++ b/include/vcl/vclenum.hxx @@ -326,6 +326,17 @@ namespace vcl }; } +enum class DrawFrameStyle +{ + NONE = 0x0000, + In = 0x0001, + Out = 0x0002, + Group = 0x0003, + DoubleIn = 0x0004, + DoubleOut = 0x0005, + NWF = 0x0006, +}; + #endif // INCLUDED_VCL_VCLENUM_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index db0f26397927..fbada38f6e48 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1681,6 +1681,7 @@ IMPL_LINK( VclExpander, ClickHdl, CheckBox&, rBtn, void ) 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_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)) @@ -1888,6 +1889,22 @@ Size VclScrolledWindow::getVisibleChildSize() const bool VclScrolledWindow::set_property(const OString &rKey, const OUString &rValue) { + if (rKey == "shadow-type") + { + // despite the style names, this looks like the best mapping + if (rValue == "in") + m_eDrawFrameStyle = DrawFrameStyle::Out; + else if (rValue == "out") + m_eDrawFrameStyle = DrawFrameStyle::In; + else if (rValue == "etched-in") + m_eDrawFrameStyle = DrawFrameStyle::DoubleOut; + else if (rValue == "etched-out") + m_eDrawFrameStyle = DrawFrameStyle::DoubleIn; + else if (rValue == "none") + m_eDrawFrameStyle = DrawFrameStyle::NONE; + return true; + } + bool bRet = VclBin::set_property(rKey, rValue); m_pVScroll->Show((GetStyle() & WB_VSCROLL) != 0); m_pHScroll->Show((GetStyle() & WB_HSCROLL) != 0); @@ -1917,7 +1934,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())); + aDecoView.DrawFrame(tools::Rectangle(Point(0,0), GetSizePixel()), m_eDrawFrameStyle); } void VclViewport::setAllocation(const Size &rAllocation) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits