diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-01-30 10:59:02 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-01-30 15:41:36 +0100 |
commit | 9e8f11a722ee9cba37c4692a6ab7d74536261429 (patch) | |
tree | d05ae138d8879585a093866aacc6372cce014e33 /vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | |
parent | 90de8fa1d10190f45450aa41c60a42a408b15f68 (diff) |
tdf#118038: use the ListboxButtonStyle padding for listboxes
Change-Id: I916dfe036e1e4fbdc67b0c34dc0d3a428ae50d3a
Reviewed-on: https://gerrit.libreoffice.org/67123
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx')
-rw-r--r-- | vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 40d5abd573f9..4799b77e672b 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 gint(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) { |