diff options
author | Ruslan Kabatsayev <b7.10110111@gmail.com> | 2012-07-07 22:02:35 +0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-07-10 17:34:55 +0100 |
commit | 1c222c5a767311d6628bdef3cfc7d7bc1e72e6ea (patch) | |
tree | 08c8a8d64bf5a9a823299a426f6cb62c435d7720 /vcl/unx | |
parent | 53f9b54f73f313814b7f1217a4e37f5dc6bd5a45 (diff) |
Implement support for HeaderBar arrow native rendering, add GTK support
Change-Id: Ib65e61259fdbf371c3330dd555ee020f3a20d1fb
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 31067512a0c7..c9b1c30ff9ea 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -641,7 +641,7 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar break; case CTRL_LISTHEADER: - if(nPart == PART_BUTTON) + if(nPart == PART_BUTTON || nPart == PART_ARROW) return true; break; } @@ -940,7 +940,10 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType, } else if(nType==CTRL_LISTHEADER) { - returnVal = NWPaintGTKListHeader( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); + if(nPart == PART_BUTTON) + returnVal = NWPaintGTKListHeader( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); + else if(nPart == PART_ARROW) + returnVal = NWPaintGTKArrow( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } if( pixmap ) @@ -1203,6 +1206,35 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, /************************************************************************ * Individual control drawing functions ************************************************************************/ +sal_Bool GtkSalGraphics::NWPaintGTKArrow( + GdkDrawable* gdkDrawable, + ControlType, ControlPart, + const Rectangle& rControlRectangle, + const clipList& rClipList, + ControlState nState, const ImplControlValue& aValue, + const OUString& ) +{ + GtkArrowType arrowType(aValue.getNumericVal()&1?GTK_ARROW_DOWN:GTK_ARROW_UP); + GtkStateType stateType(nState&CTRL_STATE_PRESSED?GTK_STATE_ACTIVE:GTK_STATE_NORMAL); + + GdkRectangle clipRect; + for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) + { + clipRect.x = it->Left(); + clipRect.y = it->Top(); + clipRect.width = it->GetWidth(); + clipRect.height = it->GetHeight(); + + gtk_paint_arrow(m_pWindow->style,gdkDrawable,stateType,GTK_SHADOW_NONE,&clipRect, + m_pWindow,"arrow",arrowType,true, + rControlRectangle.Left(), + rControlRectangle.Top(), + rControlRectangle.GetWidth(), + rControlRectangle.GetHeight()); + } + return true; +} + sal_Bool GtkSalGraphics::NWPaintGTKListHeader( GdkDrawable* gdkDrawable, ControlType, ControlPart, |