Kaydet (Commit) 3a0ca274 authored tarafından Khaled Hosny's avatar Khaled Hosny Kaydeden (comit) Caolán McNamara

Fix GTK3 right-to-left rendering of spin buttons

The buttons were not drawn at all

Change-Id: I51dfa30a6daa1034b5e978b09bcdfcc83e859f3d
Reviewed-on: https://gerrit.libreoffice.org/17790Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/17943Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst f9410a54
...@@ -137,25 +137,40 @@ Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, Rectangle aAre ...@@ -137,25 +137,40 @@ Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, Rectangle aAre
buttonRect.SetSize(Size(buttonWidth, buttonHeight)); buttonRect.SetSize(Size(buttonWidth, buttonHeight));
buttonRect.setY(aAreaRect.Top()); buttonRect.setY(aAreaRect.Top());
buttonRect.Bottom() = buttonRect.Top() + aAreaRect.GetHeight(); buttonRect.Bottom() = buttonRect.Top() + aAreaRect.GetHeight();
Rectangle partRect(buttonRect);
if ( nPart == PART_BUTTON_UP ) if ( nPart == PART_BUTTON_UP )
{ {
buttonRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - buttonRect.GetWidth())); if (AllSettings::GetLayoutRTL())
partRect.setX(aAreaRect.Left());
else
partRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - buttonRect.GetWidth()));
} }
else if( nPart == PART_BUTTON_DOWN ) else if( nPart == PART_BUTTON_DOWN )
{ {
buttonRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - 2*buttonRect.GetWidth())); if (AllSettings::GetLayoutRTL())
partRect.setX(aAreaRect.Left() + buttonRect.GetWidth());
else
partRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - 2 * buttonRect.GetWidth()));
} }
else else
{ {
buttonRect.Right() = (aAreaRect.Left() + (aAreaRect.GetWidth() - 2*buttonRect.GetWidth()))-1; if (AllSettings::GetLayoutRTL())
buttonRect.Left() = aAreaRect.Left(); {
buttonRect.Top() = aAreaRect.Top(); partRect.Right() = aAreaRect.Left() + aAreaRect.GetWidth();
buttonRect.Bottom() = aAreaRect.Bottom(); partRect.Left() = aAreaRect.Left() + (2 * buttonRect.GetWidth()) - 1;
}
else
{
partRect.Right() = (aAreaRect.Left() + (aAreaRect.GetWidth() - 2 * buttonRect.GetWidth())) - 1;
partRect.Left() = aAreaRect.Left();
}
partRect.Top() = aAreaRect.Top();
partRect.Bottom() = aAreaRect.Bottom();
} }
gtk_style_context_restore(mpSpinStyle); gtk_style_context_restore(mpSpinStyle);
return buttonRect; return partRect;
} }
Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect ) Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect )
......
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