toward bug 853775

This commit is contained in:
cinamod 2003-12-30 17:22:30 +00:00
parent 7b61ec8c3b
commit 16f9478ee3
5 changed files with 47 additions and 17 deletions

View File

@ -1,3 +1,10 @@
2003-12-30 Dom Lachowicz <cinamod@hotmail.com>
* src/wimp_style.c
* src/xp_theme.c
* src/xp_theme.h
* src/xp_theme_defs.h: Toward 853775, get toolbar button borders correct
2003-12-30 Dom Lachowicz <cinamod@hotmail.com>
* src/wimp_style.c: Fix bug 852354 to my liking

View File

@ -556,7 +556,7 @@ setup_wimp_rc_style(void)
(font_ptr ? "font_name" : "#"),
(font_ptr ? font_ptr : " font name should go here"));
gtk_rc_parse_string(buf);
/* Enable coloring for menu bars. */
font_ptr = sys_font_to_pango_font (XP_THEME_CLASS_MENU, XP_THEME_FONT_MENU,font_buf, sizeof (font_buf));
g_snprintf(buf, sizeof (buf),
@ -568,7 +568,7 @@ setup_wimp_rc_style(void)
btn_face.green,
btn_face.blue);
gtk_rc_parse_string(buf);
/* enable tooltip fonts */
font_ptr = sys_font_to_pango_font (XP_THEME_CLASS_STATUS, XP_THEME_FONT_STATUS,font_buf, sizeof (font_buf));
g_snprintf(buf, sizeof (buf),
@ -582,7 +582,7 @@ setup_wimp_rc_style(void)
(font_ptr ? "font_name" : "#"),
(font_ptr ? font_ptr : " font name should go here"));
gtk_rc_parse_string(buf);
g_snprintf(buf, sizeof (buf),
"style \"wimp-tooltips\" = \"wimp-default\"\n"
"{bg[NORMAL] = { %d, %d, %d }\n"
@ -591,7 +591,7 @@ setup_wimp_rc_style(void)
tooltip_back.green,
tooltip_back.blue);
gtk_rc_parse_string(buf);
/* enable font theming for status bars */
font_ptr = sys_font_to_pango_font (XP_THEME_CLASS_STATUS, XP_THEME_FONT_STATUS,font_buf, sizeof (font_buf));
g_snprintf(buf, sizeof (buf),
@ -603,7 +603,7 @@ setup_wimp_rc_style(void)
(font_ptr ? font_ptr : " font name should go here"),
btn_face.red, btn_face.green, btn_face.blue);
gtk_rc_parse_string(buf);
/* enable coloring for text on buttons
TODO: use GetThemeMetric for the border and outside border */
g_snprintf(buf, sizeof (buf),
@ -636,7 +636,7 @@ setup_wimp_rc_style(void)
progress_back.blue,
btn_face.red, btn_face.green, btn_face.blue);
gtk_rc_parse_string(buf);
/* scrollbar thumb width and height */
g_snprintf(buf, sizeof (buf),
"style \"wimp-vscrollbar\" = \"wimp-default\"\n"
@ -648,7 +648,7 @@ setup_wimp_rc_style(void)
GetSystemMetrics(SM_CYVTHUMB),
get_system_metric(XP_THEME_CLASS_SCROLLBAR, SM_CXVSCROLL));
gtk_rc_parse_string(buf);
g_snprintf(buf, sizeof (buf),
"style \"wimp-hscrollbar\" = \"wimp-default\"\n"
"{GtkRange::slider-width = %d\n"
@ -659,7 +659,7 @@ setup_wimp_rc_style(void)
GetSystemMetrics(SM_CXHTHUMB),
get_system_metric(XP_THEME_CLASS_SCROLLBAR, SM_CYHSCROLL));
gtk_rc_parse_string(buf);
/* radio/check button sizes */
g_snprintf(buf, sizeof (buf),
"style \"wimp-checkbutton\" = \"wimp-button\"\n"
@ -1284,6 +1284,12 @@ draw_box (GtkStyle *style,
width, height, state_type, area))
return;
}
else if (GTK_IS_TOOLBAR (widget->parent))
{
if (xp_theme_draw(window, XP_THEME_ELEMENT_TOOLBAR_BUTTON, style, x, y,
width, height, state_type, area))
return;
}
else
{
gboolean is_default = !strcmp (detail, "buttondefault");
@ -1433,15 +1439,15 @@ draw_box (GtkStyle *style,
else if (widget && GTK_IS_SCALE(widget))
{
gboolean is_vertical = GTK_IS_VSCALE(widget);
parent_class->draw_box (style, window, state_type, GTK_SHADOW_NONE, area,
widget, detail, x, y, width, height);
if(is_vertical)
parent_class->draw_box(style, window, state_type, GTK_SHADOW_ETCHED_IN, area, NULL, NULL, (2 * x + width)/2, y, 1, height);
else
parent_class->draw_box(style, window, state_type, GTK_SHADOW_ETCHED_IN, area, NULL, NULL, x, (2 * y + height)/2, width, 1);
return;
}
}

View File

@ -240,7 +240,7 @@ xp_theme_get_handle_by_element (XpThemeElement element)
klazz = XP_THEME_CLASS_STATUS;
break;
case XP_THEME_ELEMENT_TOOLBAR:
case XP_THEME_ELEMENT_TOOLBAR_BUTTON:
klazz = XP_THEME_CLASS_TOOLBAR;
break;
@ -357,9 +357,22 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
}
break;
case XP_THEME_ELEMENT_TOOLBAR:
ret = 1;
break;
case XP_THEME_ELEMENT_TOOLBAR_BUTTON:
switch (state)
{
case GTK_STATE_ACTIVE:
ret = TS_PRESSED;
break;
case GTK_STATE_PRELIGHT:
ret = TS_HOT;
break;
case GTK_STATE_INSENSITIVE:
ret = TS_DISABLED;
break;
default:
ret = TS_NORMAL;
}
break;
case XP_THEME_ELEMENT_TAB_PANE:
ret = 1;
@ -665,7 +678,7 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
HDC dc;
GdkDrawable *drawable;
int part_state;
if (! xp_theme_is_drawable (element))
return FALSE;

View File

@ -83,7 +83,7 @@ typedef enum
XP_THEME_ELEMENT_REBAR_GRIPPER_H,
XP_THEME_ELEMENT_REBAR_GRIPPER_V,
XP_THEME_ELEMENT_REBAR_CHEVRON,
XP_THEME_ELEMENT_TOOLBAR,
XP_THEME_ELEMENT_TOOLBAR_BUTTON,
XP_THEME_ELEMENT_MENU_ITEM,
XP_THEME_ELEMENT_MENU_SEPARATOR,
XP_THEME_ELEMENT_STATUS_GRIPPER,

View File

@ -75,6 +75,10 @@ typedef HANDLE HTHEME;
#define RP_CHEVRON 4
#define TP_BUTTON 1
#define TS_NORMAL 1
#define TS_HOT 2
#define TS_PRESSED 3
#define TS_DISABLED 4
#define TTSS_NORMAL 1