diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2012-07-27 20:53:32 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2012-08-01 17:02:59 +0400 |
commit | 09eb412b2c8c55c9b0a280a61d6fef18ab5c7c18 (patch) | |
tree | 97d9d694af248627cf407d7896dfbfae22bd01ae | |
parent | 8291d41667b1a63d35bf818aaf9d75529e1f12f0 (diff) |
gtk: listbox border was not rendered
remove extending of pixmapRect in the nPart == PART_WINDOW branch
and simplify code, since rControlRectangle, pixmapRect and widgetRect
are the same.
Change-Id: I253851fad558e525cd533bb3576a9bba82187e53
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 2f2158a99510..4d8ba82a1459 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -2733,15 +2733,13 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, const ImplControlValue& aValue, const OUString& rCaption ) { - Rectangle pixmapRect; - Rectangle widgetRect; Rectangle aIndicatorRect; GtkStateType stateType; GtkShadowType shadowType; gint bInteriorFocus; gint nFocusLineWidth; gint nFocusPadding; - gint x,y; + gint x,y,w,h; GdkRectangle clipRect; NWEnsureGTKButton( m_nXScreen ); @@ -2749,27 +2747,16 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, NWEnsureGTKScrolledWindow( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); - // Find the overall bounding rect of the buttons's drawing area, - // plus its actual draw rect excluding adornment - pixmapRect = rControlRectangle; - if ( nPart == PART_WINDOW ) - { - // Make the widget a _bit_ bigger - pixmapRect.SetPos( Point( pixmapRect.Left() - 1, - pixmapRect.Top() - 1 ) ); - pixmapRect.SetSize( Size( pixmapRect.GetWidth() + 2, - pixmapRect.GetHeight() + 2 ) ); - } - - widgetRect = pixmapRect; - x = pixmapRect.Left(); - y = pixmapRect.Top(); - // set up references to correct drawable and cliprect NWSetWidgetState( gWidgetData[m_nXScreen].gBtnWidget, nState, stateType ); NWSetWidgetState( gWidgetData[m_nXScreen].gOptionMenuWidget, nState, stateType ); NWSetWidgetState( gWidgetData[m_nXScreen].gScrolledWindowWidget, nState, stateType ); + x = rControlRectangle.Left(); + y = rControlRectangle.Top(); + w = rControlRectangle.GetWidth(); + h = rControlRectangle.GetHeight(); + if ( nPart != PART_WINDOW ) { gtk_widget_style_get( gWidgetData[m_nXScreen].gOptionMenuWidget, @@ -2790,19 +2777,15 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, { // Listboxes must paint opaque since some themes have alpha-channel enabled bodies gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, - &clipRect, m_pWindow, "base", x, y, - pixmapRect.GetWidth(), pixmapRect.GetHeight() ); + &clipRect, m_pWindow, "base", x, y, w, h); gtk_paint_box( gWidgetData[m_nXScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect, gWidgetData[m_nXScreen].gOptionMenuWidget, "optionmenu", - x+(widgetRect.Left() - pixmapRect.Left()), - y+(widgetRect.Top() - pixmapRect.Top()), - widgetRect.GetWidth(), widgetRect.GetHeight() ); - aIndicatorRect = NWGetListBoxIndicatorRect( m_nXScreen, nType, nPart, widgetRect, nState, + x, y, w, h); + aIndicatorRect = NWGetListBoxIndicatorRect( m_nXScreen, nType, nPart, rControlRectangle, nState, aValue, rCaption ); gtk_paint_tab( gWidgetData[m_nXScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect, gWidgetData[m_nXScreen].gOptionMenuWidget, "optionmenutab", - x+(aIndicatorRect.Left() - pixmapRect.Left()), - y+(aIndicatorRect.Top() - pixmapRect.Top()), + aIndicatorRect.Left(), aIndicatorRect.Top(), aIndicatorRect.GetWidth(), aIndicatorRect.GetHeight() ); } else @@ -2811,8 +2794,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, gtk_paint_shadow( gWidgetData[m_nXScreen].gScrolledWindowWidget->style, gdkDrawable, GTK_STATE_NORMAL, shadowType, &clipRect, gWidgetData[m_nXScreen].gScrolledWindowWidget, "scrolled_window", - x+(widgetRect.Left() - pixmapRect.Left()), y+(widgetRect.Top() - pixmapRect.Top()), - widgetRect.GetWidth(), widgetRect.GetHeight() ); + x, y, w, h ); } } |