Commit 8f51ccc0 authored by cinamod's avatar cinamod

toolbar chevrons

parent 87248d53
2003-08-29 Dom Lachowicz <cinamod@hotmail.com>
* src/*.c: Theme GTK toolbar arrows to XP chevrons, once my GTK patch is committed.
2003-08-28 Dom Lachowicz <cinamod@hotmail.com>
* src/wimp_style.c: Change how we draw handle boxes in the non-XP case. This does not yet apply to GtkHandleBoxes
......
......@@ -724,6 +724,10 @@ draw_arrow (GtkStyle *style,
gint width,
gint height)
{
const gchar * name;
name = gtk_widget_get_name (widget);
sanitize_size (window, &width, &height);
if (detail && strcmp (detail, "spinbutton") == 0)
......@@ -792,6 +796,12 @@ draw_arrow (GtkStyle *style,
}
else
{
if (name && !strcmp (name, "gtk-toolbar-arrow"))
{
if (xp_theme_draw(window, XP_THEME_ELEMENT_CHEVRON, style, x, y, width, height, state))
return;
}
if (arrow_type == GTK_ARROW_UP || arrow_type == GTK_ARROW_DOWN)
{
x += (width - 7) / 2;
......@@ -855,6 +865,10 @@ draw_box (GtkStyle *style,
gint width,
gint height)
{
const gchar * name;
name = gtk_widget_get_name (widget);
if (detail &&
(!strcmp (detail, "button") ||
!strcmp (detail, "buttondefault")))
......@@ -928,7 +942,7 @@ draw_box (GtkStyle *style,
return;
}
}
else if (!strcmp (gtk_widget_get_name (widget), "gtk-tooltips")) {
else if (name && !strcmp (name, "gtk-tooltips")) {
if (xp_theme_draw (window, XP_THEME_ELEMENT_TOOLTIP, style, x, y, width, height, state_type))
{
return;
......
......@@ -81,6 +81,7 @@ static const short element_part_map[]=
RP_BAND,
RP_GRIPPER,
RP_GRIPPERVERT,
RP_CHEVRON,
TP_BUTTON
};
......@@ -173,6 +174,7 @@ xp_theme_get_handle_by_element(XpThemeElement element)
case XP_THEME_ELEMENT_REBAR:
case XP_THEME_ELEMENT_GRIPPER_H:
case XP_THEME_ELEMENT_GRIPPER_V:
case XP_THEME_ELEMENT_CHEVRON:
klazz = XP_THEME_CLASS_REBAR;
break;
......@@ -263,6 +265,20 @@ xp_theme_map_gtk_state(XpThemeElement element, GtkStateType state)
ret = 0;
break;
case XP_THEME_ELEMENT_CHEVRON:
switch (state)
{
case GTK_STATE_PRELIGHT:
ret = CHEVS_HOT;
break;
case GTK_STATE_SELECTED:
case GTK_STATE_ACTIVE:
ret = CHEVS_PRESSED;
break;
default:
ret = CHEVS_NORMAL;
}
case XP_THEME_ELEMENT_TOOLBAR:
ret = 1;
break;
......
......@@ -77,6 +77,7 @@ typedef enum
XP_THEME_ELEMENT_REBAR,
XP_THEME_ELEMENT_GRIPPER_H,
XP_THEME_ELEMENT_GRIPPER_V,
XP_THEME_ELEMENT_CHEVRON,
XP_THEME_ELEMENT_TOOLBAR,
XP_THEME_ELEMENT__SIZEOF
} XpThemeElement;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment