Kaydet (Commit) 9e8f11a7 authored tarafından Caolán McNamara's avatar Caolán McNamara

tdf#118038: use the ListboxButtonStyle padding for listboxes

Change-Id: I916dfe036e1e4fbdc67b0c34dc0d3a428ae50d3a
Reviewed-on: https://gerrit.libreoffice.org/67123
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 90de8fa1
......@@ -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,
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment