summaryrefslogtreecommitdiff
path: root/gtk/gtkwin32draw.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-02-27 14:23:06 +0100
committerBenjamin Otte <otte@redhat.com>2016-02-27 14:34:33 +0100
commit5d34ee729d45e362d5644cfabf3cac6ed9ab8ed2 (patch)
treea5d0f64ec5f0400cb6a841fc40962d543b49f306 /gtk/gtkwin32draw.c
parentb18e64e6c697dadfab002b3bd6ae578c6cc25fd9 (diff)
downloadgtk+-5d34ee729d45e362d5644cfabf3cac6ed9ab8ed2.tar.gz
win32: Implement fallback code for tabs
This is naive code in that it doesn't do the rounded edges for the tab items yet. We can fix that later I guess.
Diffstat (limited to 'gtk/gtkwin32draw.c')
-rw-r--r--gtk/gtkwin32draw.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gtk/gtkwin32draw.c b/gtk/gtkwin32draw.c
index d5f7b0d5f8..9183877241 100644
--- a/gtk/gtkwin32draw.c
+++ b/gtk/gtkwin32draw.c
@@ -395,6 +395,34 @@ draw_window_button (cairo_t *cr,
}
static void
+draw_tab_item (cairo_t *cr,
+ int part,
+ int state,
+ int width,
+ int height)
+{
+ draw_edge (cr, EDGE_RAISED, 0, 0, width, height + 2);
+
+ gtk_cairo_set_source_sys_color (cr, GTK_WIN32_SYS_COLOR_BTNFACE);
+ cairo_rectangle (cr, 2, 2, width - 4, height - 2);
+ cairo_fill (cr);
+}
+
+static void
+draw_tab_pane (cairo_t *cr,
+ int part,
+ int state,
+ int width,
+ int height)
+{
+ draw_edge (cr, EDGE_RAISED, 0, 0, width, height);
+
+ gtk_cairo_set_source_sys_color (cr, GTK_WIN32_SYS_COLOR_BTNFACE);
+ cairo_rectangle (cr, 2, 2, width - 4, height - 4);
+ cairo_fill (cr);
+}
+
+static void
draw_tooltip (cairo_t *cr,
int part,
int state,
@@ -436,6 +464,15 @@ static GtkWin32ThemePart theme_parts[] = {
{ "edit", 7, 0, { 0, 0, 0, 0 }, draw_edit },
{ "edit", 8, 0, { 0, 0, 0, 0 }, draw_edit },
{ "edit", 9, 0, { 0, 0, 0, 0 }, draw_edit },
+ { "tab", 1, 0, { 0, 0, 0, 0 }, draw_tab_item },
+ { "tab", 2, 0, { 0, 0, 0, 0 }, draw_tab_item },
+ { "tab", 3, 0, { 0, 0, 0, 0 }, draw_tab_item },
+ { "tab", 4, 0, { 0, 0, 0, 0 }, draw_tab_item },
+ { "tab", 5, 0, { 0, 0, 0, 0 }, draw_tab_item },
+ { "tab", 6, 0, { 0, 0, 0, 0 }, draw_tab_item },
+ { "tab", 7, 0, { 0, 0, 0, 0 }, draw_tab_item },
+ { "tab", 8, 0, { 0, 0, 0, 0 }, draw_tab_item },
+ { "tab", 9, 0, { 0, 0, 0, 0 }, draw_tab_pane },
{ "tooltip", 1, 0, { 0, 0, 0, 0 }, draw_tooltip },
{ "window", 1, 0, { 0, 0, 0, 0 }, draw_window },
{ "window", 7, 0, { 0, 0, 0, 0 }, draw_window_left },