[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara caolanm at redhat.com
Mon Feb 25 07:12:07 PST 2013


 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

New commits:
commit 3094f6627f5925852a772754c067bfbb9491c94a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 25 15:09:23 2013 +0000

    Resolves: fdo#61373 tabs too narrow under oxygen gtk theme
    
    Change-Id: I794b34c1864f619d91f0b105ba08a4f607abd291

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index e15fbfa..405fcc3 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -209,6 +209,8 @@ static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow );
 static Rectangle NWGetButtonArea( SalX11Screen nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
                                 const ImplControlValue& aValue, const OUString& rCaption );
 
+static Rectangle NWGetTabItemRect( SalX11Screen nScreen, Rectangle aAreaRect );
+
 //---
 static Rectangle NWGetEditBoxPixmapRect( SalX11Screen nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
                             const ImplControlValue& aValue, const OUString& rCaption );
@@ -993,6 +995,12 @@ sal_Bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
 
         returnVal = sal_True;
     }
+    if (nType == CTRL_TAB_ITEM && nPart == PART_ENTIRE_CONTROL)
+    {
+        rNativeBoundingRegion = NWGetTabItemRect(m_nXScreen, rControlRegion);
+        rNativeContentRegion = rNativeBoundingRegion;
+        returnVal = sal_True;
+    }
     if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
     {
         rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState,
@@ -1594,6 +1602,28 @@ static Rectangle NWGetButtonArea( SalX11Screen nScreen,
     return( aRect );
 }
 
+static Rectangle NWGetTabItemRect( SalX11Screen nScreen, Rectangle aAreaRect )
+{
+    NWEnsureGTKNotebook( nScreen );
+
+    gint            x, y, w, h;
+
+    x = aAreaRect.Left();
+    y = aAreaRect.Top();
+    w = aAreaRect.GetWidth();
+    h = aAreaRect.GetHeight();
+
+    gint xthickness = gWidgetData[0].gNotebookWidget->style->xthickness;
+    gint ythickness = gWidgetData[0].gNotebookWidget->style->ythickness;
+
+    x -= xthickness;
+    y -= ythickness;
+    w += xthickness*2;
+    h += ythickness*2;
+
+    return Rectangle( Point( x, y ), Size( w, h ) );
+}
+
 //-------------------------------------
 
 sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,


More information about the Libreoffice-commits mailing list