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

Caolán McNamara caolanm at redhat.com
Tue Apr 28 12:53:45 PDT 2015


 vcl/source/control/tabctrl.cxx                |   16 ++++++++++++++++
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |    5 +++++
 2 files changed, 21 insertions(+)

New commits:
commit a0c8b9c502be6df8ba853f3e8c0d4e45bb2785b2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 28 20:53:04 2015 +0100

    gtk3: implement notebook header support
    
    Change-Id: I0dd0feb2a254b6cdb4730e2c9fd2abc80e992025

diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 5e24802..1931ac9 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1115,6 +1115,22 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
             DrawNativeControl(CTRL_TAB_PANE, PART_ENTIRE_CONTROL, aRect, nState,
                 aControlValue, OUString());
         }
+
+        if (IsNativeControlSupported(CTRL_TAB_HEADER, PART_ENTIRE_CONTROL))
+        {
+            Rectangle aHeaderRect(0, 0, GetSizePixel().Width(), aRect.Top());
+
+            aClipRgn = GetActiveClipRegion();
+            aClipRgn.Intersect( aHeaderRect );
+            if( !rRect.IsEmpty() )
+                aClipRgn.Intersect( rRect );
+
+            if( !aClipRgn.IsEmpty() )
+            {
+                DrawNativeControl(CTRL_TAB_HEADER, PART_ENTIRE_CONTROL, aHeaderRect, nState,
+                    aControlValue, OUString());
+            }
+        }
     }
     else
     {
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index acb542f..aad0ca5 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -932,6 +932,10 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
     case CTRL_TAB_PANE:
         context = mpNoteBookStyle;
         break;
+    case CTRL_TAB_HEADER:
+        context = mpNoteBookStyle;
+        styleClass = GTK_STYLE_CLASS_HEADER;
+        break;
     case CTRL_TAB_ITEM:
         context = mpNoteBookStyle;
         if (nState & ControlState::SELECTED)
@@ -1540,6 +1544,7 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
 //            return true;
 
         case CTRL_TAB_ITEM:
+        case CTRL_TAB_HEADER:
         case CTRL_TAB_PANE:
         case CTRL_TAB_BODY:
             if(nPart==PART_ENTIRE_CONTROL || nPart==PART_TABS_DRAW_RTL)


More information about the Libreoffice-commits mailing list