vcl/inc/unx/gtk/gtkgdi.hxx | 2 +- vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-)
New commits: commit af9cf4782bd4cb7f0bd791937a3334a09eb9a1e5 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Jan 30 10:59:02 2019 +0000 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Tue Feb 5 10:34:43 2019 +0100 tdf#118038: use the ListboxButtonStyle padding for listboxes Change-Id: I916dfe036e1e4fbdc67b0c34dc0d3a428ae50d3a Reviewed-on: https://gerrit.libreoffice.org/67124 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index 839ee9eaac45..074ce583dfb6 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -213,7 +213,7 @@ private: static tools::Rectangle NWGetScrollButtonRect( ControlPart nPart, tools::Rectangle aAreaRect ); static tools::Rectangle NWGetSpinButtonRect( ControlPart nPart, tools::Rectangle aAreaRect); - static tools::Rectangle NWGetComboBoxButtonRect( ControlPart nPart, tools::Rectangle aAreaRect ); + static tools::Rectangle NWGetComboBoxButtonRect(ControlType nType, ControlPart nPart, tools::Rectangle aAreaRect); static void PaintScrollbar(GtkStyleContext *context, cairo_t *cr, diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 64c0791bba98..f6096f36b72b 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -1168,14 +1168,17 @@ void GtkSalGraphics::PaintSpinButton(GtkStateFlags flags, #define FALLBACK_ARROW_SIZE 11 * 0.85 -tools::Rectangle GtkSalGraphics::NWGetComboBoxButtonRect( +tools::Rectangle GtkSalGraphics::NWGetComboBoxButtonRect(ControlType nType, ControlPart nPart, tools::Rectangle aAreaRect ) { tools::Rectangle aButtonRect; GtkBorder padding; - gtk_style_context_get_padding( mpButtonStyle, gtk_style_context_get_state(mpButtonStyle), &padding); + if (nType == ControlType::Listbox) + gtk_style_context_get_padding(mpListboxButtonStyle, gtk_style_context_get_state(mpListboxButtonStyle), &padding); + else + gtk_style_context_get_padding(mpButtonStyle, gtk_style_context_get_state(mpButtonStyle), &padding); gint nArrowWidth = FALLBACK_ARROW_SIZE; if (gtk_check_version(3, 20, 0) == nullptr) @@ -1228,7 +1231,7 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr, // plus its actual draw rect excluding adornment areaRect = rControlRectangle; - buttonRect = NWGetComboBoxButtonRect( ControlPart::ButtonDown, areaRect ); + buttonRect = NWGetComboBoxButtonRect(ControlType::Combobox, ControlPart::ButtonDown, areaRect); tools::Rectangle aEditBoxRect( areaRect ); aEditBoxRect.SetSize( Size( areaRect.GetWidth() - buttonRect.GetWidth(), aEditBoxRect.GetHeight() ) ); @@ -2787,12 +2790,12 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar else if ( (nType==ControlType::Combobox) && ((nPart==ControlPart::ButtonDown) || (nPart==ControlPart::SubEdit)) ) { - aEditRect = NWGetComboBoxButtonRect( nPart, rControlRegion ); + aEditRect = NWGetComboBoxButtonRect(nType, nPart, rControlRegion); } else if ( (nType==ControlType::Listbox) && ((nPart==ControlPart::ButtonDown) || (nPart==ControlPart::SubEdit)) ) { - aEditRect = NWGetComboBoxButtonRect( nPart, rControlRegion ); + aEditRect = NWGetComboBoxButtonRect(nType, nPart, rControlRegion); } else if (nType == ControlType::Editbox && nPart == ControlPart::Entire) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits