[Libreoffice-commits] .: 2 commits - vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Aug 25 03:32:37 PDT 2012
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
New commits:
commit 2da4a011130cefa3bd56e5b62c9068d202e81913
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Sat Aug 25 14:18:57 2012 +0400
gtk: wrong menu border size, need to add thickness
Change-Id: Ibcd63b7a74f6a6afb0ac1195218125fea26a0482
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index f204c03..f28cb0a 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -446,8 +446,10 @@ void GtkData::initNWF( void )
gtk_widget_style_get( gWidgetData[0].gMenuWidget,
"vertical-padding", &vertical_padding,
(char *)NULL);
- pSVData->maNWFData.mnMenuFormatBorderX = horizontal_padding;
- pSVData->maNWFData.mnMenuFormatBorderY = vertical_padding;
+ gint xthickness = gWidgetData[0].gMenuWidget->style->xthickness;
+ gint ythickness = gWidgetData[0].gMenuWidget->style->ythickness;
+ pSVData->maNWFData.mnMenuFormatBorderX = xthickness + horizontal_padding;
+ pSVData->maNWFData.mnMenuFormatBorderY = ythickness + vertical_padding;
if( SalGetDesktopEnvironment() == "KDE" )
{
commit a2c5a1174ef964f3993f49162b4d8d14b8f02c46
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Sat Aug 25 14:14:58 2012 +0400
gtk: fix scrollbar drawing with Clearlooks
Change-Id: Ia1afbfd027bf473f23b83239562f542d0157d549
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index a0ccfb6..f204c03 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1751,8 +1751,6 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// Find the overall bounding rect of the control
pixmapRect = rControlRectangle;
- pixmapRect.SetSize( Size( pixmapRect.GetWidth() + 1,
- pixmapRect.GetHeight() + 1 ) );
scrollbarRect = pixmapRect;
if ( (scrollbarRect.GetWidth() <= 1) || (scrollbarRect.GetHeight() <= 1) )
@@ -1939,13 +1937,22 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
x+hShim+thumbRect.Left(), y+vShim+thumbRect.Top(),
thumbRect.GetWidth(), thumbRect.GetHeight(), scrollbarOrientation );
}
+
+ // Some engines require allocation, e.g. Clearlooks uses it to identify
+ // positions of the buttons, whereupon the first and the last button will
+ // have rounded corners.
+ GTK_WIDGET(scrollbarWidget)->allocation.x = x;
+ GTK_WIDGET(scrollbarWidget)->allocation.y = y;
+ GTK_WIDGET(scrollbarWidget)->allocation.width = w;
+ GTK_WIDGET(scrollbarWidget)->allocation.height = h;
+
// ----------------- BUTTON 1 //
if ( has_backward )
{
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag,
x+hShim+button11BoundRect.Left(), y+vShim+button11BoundRect.Top(),
button11BoundRect.GetWidth(), button11BoundRect.GetHeight() );
// ----------------- ARROW 1
@@ -1960,7 +1967,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag,
x+hShim+button12BoundRect.Left(), y+vShim+button12BoundRect.Top(),
button12BoundRect.GetWidth(), button12BoundRect.GetHeight() );
// ----------------- ARROW 1
@@ -1976,7 +1983,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
- GTK_WIDGET(scrollbarWidget), "stepper",
+ GTK_WIDGET(scrollbarWidget), scrollbarTag,
x+hShim+button21BoundRect.Left(), y+vShim+button21BoundRect.Top(),
button21BoundRect.GetWidth(), button21BoundRect.GetHeight() );
// ----------------- ARROW 2
@@ -1991,7 +1998,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
- GTK_WIDGET(scrollbarWidget), "stepper",
+ GTK_WIDGET(scrollbarWidget), scrollbarTag,
x+hShim+button22BoundRect.Left(), y+vShim+button22BoundRect.Top(),
button22BoundRect.GetWidth(), button22BoundRect.GetHeight() );
// ----------------- ARROW 2
More information about the Libreoffice-commits
mailing list