diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-04-28 20:53:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-28 20:53:04 +0100 |
commit | a0c8b9c502be6df8ba853f3e8c0d4e45bb2785b2 (patch) | |
tree | 1ba4839e75c50ea5f690ec8636a2d83a59460973 /vcl | |
parent | d86ccaf3d518a0aa82d7ee4ce1d30cfeb2b6c8cb (diff) |
gtk3: implement notebook header support
Change-Id: I0dd0feb2a254b6cdb4730e2c9fd2abc80e992025
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 5e24802049af..1931ac9b36aa 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 acb542ff5b07..aad0ca567782 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) |