From b00ab0259794e7011172875e72f407bc70c95191 Mon Sep 17 00:00:00 2001 From: Dom Lachowicz Date: Wed, 1 Dec 2004 17:25:19 +0000 Subject: [PATCH] xp theme combo box arrows on toolbars --- ChangeLog | 1 + ChangeLog.pre-2-10 | 1 + ChangeLog.pre-2-6 | 1 + ChangeLog.pre-2-8 | 1 + modules/engines/ms-windows/msw_style.c | 49 +++++++++++++++++--------- 5 files changed, 36 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb77ac494e..720b8e56a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: use MS Windows button order, not Gnome HIG order * modules/engines/ms-windows/msw_style.c (draw_handle): Draw XP toolbar grippie handle properly (draw_resize_grip): Draw XP status bar grippie handle properly + (draw_arrow): XP theme combo box arrows on toolbars 2004-11-30 Dom Lachowicz diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index bb77ac494e..720b8e56a0 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -13,6 +13,7 @@ * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: use MS Windows button order, not Gnome HIG order * modules/engines/ms-windows/msw_style.c (draw_handle): Draw XP toolbar grippie handle properly (draw_resize_grip): Draw XP status bar grippie handle properly + (draw_arrow): XP theme combo box arrows on toolbars 2004-11-30 Dom Lachowicz diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index bb77ac494e..720b8e56a0 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -13,6 +13,7 @@ * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: use MS Windows button order, not Gnome HIG order * modules/engines/ms-windows/msw_style.c (draw_handle): Draw XP toolbar grippie handle properly (draw_resize_grip): Draw XP status bar grippie handle properly + (draw_arrow): XP theme combo box arrows on toolbars 2004-11-30 Dom Lachowicz diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index bb77ac494e..720b8e56a0 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -13,6 +13,7 @@ * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: use MS Windows button order, not Gnome HIG order * modules/engines/ms-windows/msw_style.c (draw_handle): Draw XP toolbar grippie handle properly (draw_resize_grip): Draw XP status bar grippie handle properly + (draw_arrow): XP theme combo box arrows on toolbars 2004-11-30 Dom Lachowicz diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c index 93052c5963..34c88326b8 100755 --- a/modules/engines/ms-windows/msw_style.c +++ b/modules/engines/ms-windows/msw_style.c @@ -1164,6 +1164,29 @@ reverse_engineer_stepper_box (GtkWidget *range, *height = box_height; } +static XpThemeElement to_xp_arrow(GtkArrowType arrow_type) +{ + XpThemeElement xp_arrow; + + switch (arrow_type) + { + case GTK_ARROW_UP: + xp_arrow = XP_THEME_ELEMENT_ARROW_UP; + break; + case GTK_ARROW_DOWN: + xp_arrow = XP_THEME_ELEMENT_ARROW_DOWN; + break; + case GTK_ARROW_LEFT: + xp_arrow = XP_THEME_ELEMENT_ARROW_LEFT; + break; + default: + xp_arrow = XP_THEME_ELEMENT_ARROW_RIGHT; + break; + } + + return xp_arrow; +} + static void draw_arrow (GtkStyle *style, GdkWindow *window, @@ -1212,29 +1235,14 @@ draw_arrow (GtkStyle *style, gint box_y = y; gint box_width = width; gint box_height = height; - XpThemeElement xp_arrow; + reverse_engineer_stepper_box (widget, arrow_type, &box_x, &box_y, &box_width, &box_height); if (scrollbar->range.adjustment->page_size >= (scrollbar->range.adjustment->upper-scrollbar->range.adjustment->lower)) is_disabled = TRUE; - switch (arrow_type) - { - case GTK_ARROW_UP: - xp_arrow = XP_THEME_ELEMENT_ARROW_UP; - break; - case GTK_ARROW_DOWN: - xp_arrow = XP_THEME_ELEMENT_ARROW_DOWN; - break; - case GTK_ARROW_LEFT: - xp_arrow = XP_THEME_ELEMENT_ARROW_LEFT; - break; - default: - xp_arrow = XP_THEME_ELEMENT_ARROW_RIGHT; - break; - } - if (xp_theme_draw(window, xp_arrow, style, box_x, box_y, box_width, box_height, state, area)) + if (xp_theme_draw(window, to_xp_arrow(arrow_type), style, box_x, box_y, box_width, box_height, state, area)) { } else if (arrow_type == GTK_ARROW_UP || arrow_type == GTK_ARROW_DOWN) @@ -1262,6 +1270,13 @@ draw_arrow (GtkStyle *style, if (xp_theme_draw(window, XP_THEME_ELEMENT_REBAR_CHEVRON, style, x, y, width, height, state, area)) return; } + /* probably a gtk combo box on a toolbar */ + else if (widget->parent && GTK_IS_BUTTON (widget->parent)) + { + if (xp_theme_draw(window, XP_THEME_ELEMENT_COMBOBUTTON, style, x-3, widget->allocation.y+1, + width+5, widget->allocation.height-4, state, area)) + return; + } if (arrow_type == GTK_ARROW_UP || arrow_type == GTK_ARROW_DOWN) {