diff options
author | Benjamin Otte <otte@gnome.org> | 2016-02-23 05:05:37 +0100 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2016-02-25 16:53:22 +0100 |
commit | 3a9ceffe12927fd229e91623d476b53a70618d42 (patch) | |
tree | 36a296e48b54fc47060c70ff578df26cf3049c7d /gtk/gtkwin32draw.c | |
parent | 4e8fb33f5677e086e1ba9f5a5650a12be99da99c (diff) | |
download | gtk+-3a9ceffe12927fd229e91623d476b53a70618d42.tar.gz |
win32 theme: Make entries and textview work
Diffstat (limited to 'gtk/gtkwin32draw.c')
-rw-r--r-- | gtk/gtkwin32draw.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gtk/gtkwin32draw.c b/gtk/gtkwin32draw.c index 0483723d34..84b50f2773 100644 --- a/gtk/gtkwin32draw.c +++ b/gtk/gtkwin32draw.c @@ -187,6 +187,41 @@ draw_radio (cairo_t *cr, } static void +draw_edit (cairo_t *cr, + int part, + int state, + int width, + int height) +{ + int xborder = gtk_win32_get_sys_metric (GTK_WIN32_SYS_METRIC_CXBORDER); + int yborder = gtk_win32_get_sys_metric (GTK_WIN32_SYS_METRIC_CYBORDER); + + cairo_rectangle (cr, 0, 0, width, height); + gtk_cairo_set_source_sys_color (cr, (state == 6 || state == 4) ? GTK_WIN32_SYS_COLOR_BTNFACE + : GTK_WIN32_SYS_COLOR_WINDOW); + cairo_fill_preserve (cr); + + cairo_rectangle (cr, width - xborder, yborder, + - (width - 2 * xborder), height - 2 * yborder); + gtk_cairo_set_source_sys_color (cr, GTK_WIN32_SYS_COLOR_WINDOWFRAME); + cairo_fill (cr); +} + +static void +draw_edit_noborder (cairo_t *cr, + int part, + int state, + int width, + int height) +{ + + cairo_rectangle (cr, 0, 0, width, height); + gtk_cairo_set_source_sys_color (cr, (state == 6 || state == 4) ? GTK_WIN32_SYS_COLOR_BTNFACE + : GTK_WIN32_SYS_COLOR_WINDOW); + cairo_fill (cr); +} + +static void draw_window (cairo_t *cr, int part, int state, @@ -270,6 +305,12 @@ static GtkWin32ThemePart theme_parts[] = { { "button", 1, 0, { 3, 3, 3, 3 }, draw_button }, { "button", 2, 13, { 0, 0, 0, 0 }, draw_radio }, { "button", 3, 13, { 0, 0, 0, 0 }, draw_check }, + { "edit", 1, 0, { 0, 0, 0, 0 }, draw_edit }, + { "edit", 3, 0, { 0, 0, 0, 0 }, draw_edit_noborder }, + { "edit", 6, 0, { 0, 0, 0, 0 }, draw_edit }, + { "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 }, { "tooltip", 1, 0, { 0, 0, 0, 0 }, draw_tooltip }, { "window", 1, 0, { 0, 0, 0, 0 }, draw_window }, { "window", 15, 0, { 0, 0, 0, 0 }, draw_window_button }, |