summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-05-11 17:33:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-05-11 19:45:39 +0100
commit686034d5ced19ea2a16127ba3f5af49e7f9e1b35 (patch)
treee89d8f8938d21b65aaa9571009df3149868ab4cf
parent0f8f60f2bef959389d45b2dd0a535cd8848ed8e9 (diff)
gtk3: insert a gap between tabs
Change-Id: I7d502571719e58d1436b6651eb9f01e4ef46aa6a
-rw-r--r--vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx26
1 files changed, 20 insertions, 6 deletions
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 17ef6e28cefc..906d3b298864 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -75,6 +75,7 @@ enum {
RENDER_SCROLLBAR = 8,
RENDER_SPINBUTTON = 9,
RENDER_COMBOBOX = 10,
+ RENDER_EXTENSION = 11,
};
static void PrepareComboboxStyle( GtkStyleContext *context,
@@ -940,6 +941,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
context = mpNoteBookStyle;
if (nState & ControlState::SELECTED)
flags = (GtkStateFlags) (flags | GTK_STATE_FLAG_ACTIVE);
+
break;
case CTRL_WINDOW_BACKGROUND:
context = gtk_widget_get_style_context(mpWindow);
@@ -952,6 +954,11 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
clipRegion(cr);
cairo_translate(cr, rControlRegion.Left(), rControlRegion.Top());
+ long nX = 0;
+ long nY = 0;
+ long nWidth = rControlRegion.GetWidth();
+ long nHeight = rControlRegion.GetHeight();
+
gtk_style_context_save(context);
gtk_style_context_set_state(context, flags);
if (nType == CTRL_TAB_ITEM)
@@ -969,6 +976,14 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
gtk_style_context_add_region(mpNoteBookStyle, GTK_STYLE_REGION_TAB, eFlags);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_TOP);
+
+ gint initial_gap(0);
+ gtk_style_context_get_style(mpNoteBookStyle,
+ "initial-gap", &initial_gap,
+ NULL);
+
+ nX += initial_gap/2;
+ nWidth -= initial_gap;
}
if (styleClass)
{
@@ -983,16 +998,15 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
{
case RENDER_BACKGROUND:
case RENDER_BACKGROUND_AND_FRAME:
- gtk_render_background(context, cr,
- 0, 0,
- rControlRegion.GetWidth(), rControlRegion.GetHeight());
+ gtk_render_background(context, cr, nX, nY, nWidth, nHeight);
if (renderType == RENDER_BACKGROUND_AND_FRAME)
{
- gtk_render_frame(context, cr,
- 0, 0,
- rControlRegion.GetWidth(), rControlRegion.GetHeight());
+ gtk_render_frame(context, cr, nX, nY, nWidth, nHeight);
}
break;
+ case RENDER_EXTENSION:
+ gtk_render_extension(context, cr, nX, nY, nWidth, nHeight, GTK_POS_BOTTOM);
+ break;
case RENDER_CHECK:
case RENDER_RADIO:
PaintCheckOrRadio(context, cr, rControlRegion, nType);