diff options
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_updatedialog.hxx | 2 | ||||
-rw-r--r-- | desktop/uiconfig/ui/updatedialog.ui | 7 | ||||
-rw-r--r-- | include/vcl/layout.hxx | 11 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/CondFormat.cxx | 2 | ||||
-rw-r--r-- | reportdesign/uiconfig/dbreport/ui/condformatdialog.ui | 5 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/retypepassdialog.ui | 19 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/sortcriteriapage.ui | 17 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/cmisinfopage.ui | 25 | ||||
-rw-r--r-- | svtools/uiconfig/ui/addresstemplatedialog.ui | 5 | ||||
-rw-r--r-- | svx/uiconfig/ui/asianphoneticguidedialog.ui | 5 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 29 |
12 files changed, 102 insertions, 31 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx index adcc1895154a..e5365498b635 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx @@ -172,7 +172,7 @@ private: FixedText* m_pchecking; Throbber* m_pthrobber; FixedText* m_pUpdate; - VclScrolledWindow* m_pContainer; + VclViewport* m_pContainer; UpdateDialog::CheckListBox* m_pUpdates; CheckBox* m_pAll; FixedText* m_pDescription; diff --git a/desktop/uiconfig/ui/updatedialog.ui b/desktop/uiconfig/ui/updatedialog.ui index 940b104edafc..e3856326c385 100644 --- a/desktop/uiconfig/ui/updatedialog.ui +++ b/desktop/uiconfig/ui/updatedialog.ui @@ -144,10 +144,15 @@ </packing> </child> <child> - <object class="GtkScrolledWindow" id="UPDATES_CONTAINER"> + <object class="GtkScrolledWindow" id="scrolledwindow1"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="shadow_type">in</property> + <child> + <object class="GtkViewport" id="UPDATES_CONTAINER"> + <property name="visible">True</property> + </object> + </child> </object> <packing> <property name="expand">True</property> diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index a68103802e06..6c4ce283d12d 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -576,6 +576,17 @@ private: ScrollBarBox m_aScrollBarBox; }; +class VCL_DLLPUBLIC VclViewport : public VclBin +{ +public: + VclViewport(Window *pParent, WinBits nStyle = WB_HIDE | WB_CLIPCHILDREN) + : VclBin(pParent, nStyle) + { + } +protected: + virtual void setAllocation(const Size &rAllocation) SAL_OVERRIDE; +}; + //Enforces that its children are always the same size as itself. //Intercepts any Commands intended for its children. // diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx index 82fb0fdf225d..7390352cb0fe 100644 --- a/reportdesign/source/ui/dlg/CondFormat.cxx +++ b/reportdesign/source/ui/dlg/CondFormat.cxx @@ -321,7 +321,7 @@ namespace rptui return; long nConditionHeight = m_aConditions[0]->get_preferred_size().Height(); Point aConditionPos(0, -1 * nConditionHeight * impl_getFirstVisibleConditionIndex()); - m_pScrollWindow->get_child()->SetPosPixel(aConditionPos); + m_pConditionPlayground->SetPosPixel(aConditionPos); } void ConditionalFormattingDialog::impl_layoutAll() diff --git a/reportdesign/uiconfig/dbreport/ui/condformatdialog.ui b/reportdesign/uiconfig/dbreport/ui/condformatdialog.ui index 741ce749bdc0..a3ff67b406c6 100644 --- a/reportdesign/uiconfig/dbreport/ui/condformatdialog.ui +++ b/reportdesign/uiconfig/dbreport/ui/condformatdialog.ui @@ -92,6 +92,9 @@ <property name="vscrollbar_policy">always</property> <property name="shadow_type">in</property> <child> + <object class="GtkViewport" id="viewport1"> + <property name="visible">True</property> + <child> <object class="GtkBox" id="condPlaygroundDrawingarea"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -102,6 +105,8 @@ <placeholder/> </child> </object> + </child> + </object> </child> </object> <packing> diff --git a/sc/uiconfig/scalc/ui/retypepassdialog.ui b/sc/uiconfig/scalc/ui/retypepassdialog.ui index 95459f275264..88d32498661c 100644 --- a/sc/uiconfig/scalc/ui/retypepassdialog.ui +++ b/sc/uiconfig/scalc/ui/retypepassdialog.ui @@ -188,15 +188,20 @@ <property name="vexpand">True</property> <property name="vscrollbar_policy">always</property> <child> - <object class="GtkBox" id="sheetsBox"> + <object class="GtkViewport" id="viewport1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="orientation">vertical</property> - <property name="spacing">6</property> <child> - <placeholder/> + <object class="GtkBox" id="sheetsBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <placeholder/> + </child> + </object> </child> </object> </child> diff --git a/sc/uiconfig/scalc/ui/sortcriteriapage.ui b/sc/uiconfig/scalc/ui/sortcriteriapage.ui index 6b9202125d0a..c7347ef18510 100644 --- a/sc/uiconfig/scalc/ui/sortcriteriapage.ui +++ b/sc/uiconfig/scalc/ui/sortcriteriapage.ui @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> <interface> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> <object class="GtkScrolledWindow" id="SortCriteriaPage"> <property name="visible">True</property> <property name="can_focus">True</property> @@ -9,14 +10,22 @@ <property name="hscrollbar_policy">never</property> <property name="shadow_type">in</property> <child> - <object class="GtkBox" id="SortKeyWindow"> + <object class="GtkViewport" id="viewport2"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="orientation">vertical</property> <child> - <placeholder/> + <object class="GtkBox" id="SortKeyWindow"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <child> + <placeholder/> + </child> + </object> </child> </object> </child> diff --git a/sfx2/uiconfig/ui/cmisinfopage.ui b/sfx2/uiconfig/ui/cmisinfopage.ui index 6fad6832d5ac..dafcb96495e0 100644 --- a/sfx2/uiconfig/ui/cmisinfopage.ui +++ b/sfx2/uiconfig/ui/cmisinfopage.ui @@ -25,14 +25,17 @@ </child> <child> <object class="GtkScrolledWindow" id="CmisScroll"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="hscrollbar_policy">never</property> - <property name="shadow_type">in</property> - <child> - <object class="GtkBox" id="CmisWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport" id="viewport1"> + <property name="visible">True</property> + <child> + <object class="GtkBox" id="CmisWindow"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> @@ -41,8 +44,10 @@ <child> <placeholder/> </child> - </object> - </child> + </object> + </child> + </object> + </child> </object> <packing> <property name="left_attach">0</property> diff --git a/svtools/uiconfig/ui/addresstemplatedialog.ui b/svtools/uiconfig/ui/addresstemplatedialog.ui index 65e708c09fdb..50b38245322b 100644 --- a/svtools/uiconfig/ui/addresstemplatedialog.ui +++ b/svtools/uiconfig/ui/addresstemplatedialog.ui @@ -231,6 +231,9 @@ <property name="vexpand">True</property> <property name="vscrollbar_policy">always</property> <property name="shadow_type">in</property> + <child> + <object class="GtkViewport" id="viewport1"> + <property name="visible">True</property> <child> <object class="GtkGrid" id="grid4"> <property name="visible">True</property> @@ -582,6 +585,8 @@ </child> </object> </child> + </object> + </child> </object> </child> </object> diff --git a/svx/uiconfig/ui/asianphoneticguidedialog.ui b/svx/uiconfig/ui/asianphoneticguidedialog.ui index aa1cf2c5b59a..46f38e0d0df8 100644 --- a/svx/uiconfig/ui/asianphoneticguidedialog.ui +++ b/svx/uiconfig/ui/asianphoneticguidedialog.ui @@ -122,6 +122,9 @@ <property name="hscrollbar_policy">never</property> <property name="vscrollbar_policy">always</property> <property name="shadow_type">in</property> + <child> + <object class="GtkViewport" id="viewport1"> + <property name="visible">True</property> <child> <object class="GtkGrid" id="grid1"> <property name="visible">True</property> @@ -230,6 +233,8 @@ </child> </object> </child> + </object> + </child> </object> <packing> <property name="expand">False</property> diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index e336a052b5db..ff88496af8a7 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1159,7 +1159,7 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri } } - if (bIsPlaceHolder || name == "GtkTreeSelection" || name == "GtkViewport") + if (bIsPlaceHolder || name == "GtkTreeSelection") return NULL; extractButtonImage(id, rMap, name == "GtkRadioButton"); @@ -1473,6 +1473,10 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri { pWindow = new VclScrolledWindow(pParent); } + else if (name == "GtkViewport") + { + pWindow = new VclViewport(pParent); + } else if (name == "GtkEventBox") { pWindow = new VclEventBox(pParent); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 88823f17db6a..0795ee89fd65 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1616,6 +1616,13 @@ IMPL_LINK_NOARG(VclScrolledWindow, ScrollBarHdl) if (!pChild) return 1; + assert(dynamic_cast<VclViewport*>(pChild) && "scrolledwindow child should be a Viewport"); + + pChild = pChild->GetWindow(WINDOW_FIRSTCHILD); + + if (!pChild) + return 1; + Point aWinPos; if (m_aHScroll.IsVisible()) @@ -1698,7 +1705,9 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation) long nAvailWidth = rAllocation.Width(); // vert. ScrollBar if (GetStyle() & WB_AUTOVSCROLL) + { m_aVScroll.Show(nAvailHeight < aChildReq.Height()); + } if (m_aVScroll.IsVisible()) nAvailWidth -= getLayoutRequisition(m_aVScroll).Width(); @@ -1754,12 +1763,8 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation) if (pChild && pChild->IsVisible()) { - Point aChildPos(pChild->GetPosPixel()); - if (!m_aHScroll.IsVisible()) - aChildPos.X() = 0; - if (!m_aVScroll.IsVisible()) - aChildPos.Y() = 0; - setLayoutAllocation(*pChild, aChildPos, aChildAllocation); + assert(dynamic_cast<VclViewport*>(pChild) && "scrolledwindow child should be a Viewport"); + setLayoutAllocation(*pChild, Point(0, 0), aInnerSize); } if (!m_bUserManagedScrolling) @@ -1803,6 +1808,18 @@ bool VclScrolledWindow::Notify(NotifyEvent& rNEvt) return nDone || VclBin::Notify( rNEvt ); } +void VclViewport::setAllocation(const Size &rAllocation) +{ + Window *pChild = get_child(); + if (pChild && pChild->IsVisible()) + { + Size aReq(getLayoutRequisition(*pChild)); + aReq.Width() = std::max(aReq.Width(), rAllocation.Width()); + aReq.Height() = std::max(aReq.Height(), rAllocation.Height()); + setLayoutAllocation(*pChild, Point(0, 0), aReq); + } +} + const Window *VclEventBox::get_child() const { const WindowImpl* pWindowImpl = ImplGetWindowImpl(); |