Commit c626cd42 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

New default theme! A slighly improved version of the 2.0 Raleigh theme,

Mon Apr 30 20:29:27 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkoptionmenu.c
	  gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtkwidget.c:
  	  New default theme! A slighly improved version of the 2.0 Raleigh
	  theme, with Windows-esque focus/drawing default.
	  (GtkWidget::interior_focus defaults to TRUE.)

	* gtk/gtkstyle.[ch]: Add a text_aa color halfway between text and base.
parent 2635496a
Mon Apr 30 20:29:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkoptionmenu.c
gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtkwidget.c:
New default theme! A slighly improved version of the 2.0 Raleigh
theme, with Windows-esque focus/drawing default.
(GtkWidget::interior_focus defaults to TRUE.)
* gtk/gtkstyle.[ch]: Add a text_aa color halfway between text and base.
2001-04-30 Havoc Pennington <hp@pobox.com>
* tests/testtext.c (line_numbers_expose): fix to work with
......@@ -13,7 +23,8 @@ Mon Apr 30 19:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
with GtkWidget::interior_focus = TRUE better.
* gtk/gtkbutton.c
* gtk/gtkbutton.c: Switch ::default_spacing to ::default_border,
::default_outside_border for more flexibility.
* gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove
G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
......
Mon Apr 30 20:29:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkoptionmenu.c
gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtkwidget.c:
New default theme! A slighly improved version of the 2.0 Raleigh
theme, with Windows-esque focus/drawing default.
(GtkWidget::interior_focus defaults to TRUE.)
* gtk/gtkstyle.[ch]: Add a text_aa color halfway between text and base.
2001-04-30 Havoc Pennington <hp@pobox.com>
* tests/testtext.c (line_numbers_expose): fix to work with
......@@ -13,7 +23,8 @@ Mon Apr 30 19:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
with GtkWidget::interior_focus = TRUE better.
* gtk/gtkbutton.c
* gtk/gtkbutton.c: Switch ::default_spacing to ::default_border,
::default_outside_border for more flexibility.
* gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove
G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
......
Mon Apr 30 20:29:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkoptionmenu.c
gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtkwidget.c:
New default theme! A slighly improved version of the 2.0 Raleigh
theme, with Windows-esque focus/drawing default.
(GtkWidget::interior_focus defaults to TRUE.)
* gtk/gtkstyle.[ch]: Add a text_aa color halfway between text and base.
2001-04-30 Havoc Pennington <hp@pobox.com>
* tests/testtext.c (line_numbers_expose): fix to work with
......@@ -13,7 +23,8 @@ Mon Apr 30 19:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
with GtkWidget::interior_focus = TRUE better.
* gtk/gtkbutton.c
* gtk/gtkbutton.c: Switch ::default_spacing to ::default_border,
::default_outside_border for more flexibility.
* gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove
G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
......
Mon Apr 30 20:29:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkoptionmenu.c
gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtkwidget.c:
New default theme! A slighly improved version of the 2.0 Raleigh
theme, with Windows-esque focus/drawing default.
(GtkWidget::interior_focus defaults to TRUE.)
* gtk/gtkstyle.[ch]: Add a text_aa color halfway between text and base.
2001-04-30 Havoc Pennington <hp@pobox.com>
* tests/testtext.c (line_numbers_expose): fix to work with
......@@ -13,7 +23,8 @@ Mon Apr 30 19:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
with GtkWidget::interior_focus = TRUE better.
* gtk/gtkbutton.c
* gtk/gtkbutton.c: Switch ::default_spacing to ::default_border,
::default_outside_border for more flexibility.
* gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove
G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
......
Mon Apr 30 20:29:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkoptionmenu.c
gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtkwidget.c:
New default theme! A slighly improved version of the 2.0 Raleigh
theme, with Windows-esque focus/drawing default.
(GtkWidget::interior_focus defaults to TRUE.)
* gtk/gtkstyle.[ch]: Add a text_aa color halfway between text and base.
2001-04-30 Havoc Pennington <hp@pobox.com>
* tests/testtext.c (line_numbers_expose): fix to work with
......@@ -13,7 +23,8 @@ Mon Apr 30 19:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
with GtkWidget::interior_focus = TRUE better.
* gtk/gtkbutton.c
* gtk/gtkbutton.c: Switch ::default_spacing to ::default_border,
::default_outside_border for more flexibility.
* gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove
G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
......
Mon Apr 30 20:29:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkoptionmenu.c
gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtkwidget.c:
New default theme! A slighly improved version of the 2.0 Raleigh
theme, with Windows-esque focus/drawing default.
(GtkWidget::interior_focus defaults to TRUE.)
* gtk/gtkstyle.[ch]: Add a text_aa color halfway between text and base.
2001-04-30 Havoc Pennington <hp@pobox.com>
* tests/testtext.c (line_numbers_expose): fix to work with
......@@ -13,7 +23,8 @@ Mon Apr 30 19:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
with GtkWidget::interior_focus = TRUE better.
* gtk/gtkbutton.c
* gtk/gtkbutton.c: Switch ::default_spacing to ::default_border,
::default_outside_border for more flexibility.
* gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove
G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
......
Mon Apr 30 20:29:27 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtkoptionmenu.c
gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtkwidget.c:
New default theme! A slighly improved version of the 2.0 Raleigh
theme, with Windows-esque focus/drawing default.
(GtkWidget::interior_focus defaults to TRUE.)
* gtk/gtkstyle.[ch]: Add a text_aa color halfway between text and base.
2001-04-30 Havoc Pennington <hp@pobox.com>
* tests/testtext.c (line_numbers_expose): fix to work with
......@@ -13,7 +23,8 @@ Mon Apr 30 19:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
with GtkWidget::interior_focus = TRUE better.
* gtk/gtkbutton.c
* gtk/gtkbutton.c: Switch ::default_spacing to ::default_border,
::default_outside_border for more flexibility.
* gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove
G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
......
......@@ -496,7 +496,6 @@ This can later be composited together with other
#GtkRcStyle structures to form a #GtkStyle.
</para>
@parent_instance:
@name:
@bg_pixmap_name:
@font_desc:
......
......@@ -37,8 +37,8 @@
#define CHILD_SPACING 1
static GtkBorder default_default_border = { 5, 5, 6, 6 };
static GtkBorder default_default_outside_border = { 5, 5, 6, 6 };
static GtkBorder default_default_border = { 1, 1, 1, 1 };
static GtkBorder default_default_outside_border = { 0, 0, 0, 0 };
/* Time out before giving up on getting a key release when animatng
* the close button.
......
......@@ -29,7 +29,7 @@
#include "gtklabel.h"
#define INDICATOR_SIZE 10
#define INDICATOR_SIZE 13
#define INDICATOR_SPACING 2
......
......@@ -48,8 +48,8 @@ struct _GtkOptionMenuProps
static GtkOptionMenuProps default_props = {
FALSE,
{ 12, 8 },
{ 3, 7, 2, 2 } /* Left, right, top, bottom */
{ 7, 13 },
{ 7, 5, 2, 2 } /* Left, right, top, bottom */
};
static void gtk_option_menu_class_init (GtkOptionMenuClass *klass);
......
......@@ -203,7 +203,7 @@ gtk_range_class_init (GtkRangeClass *class)
_("Width of scrollbar or scale thumb"),
0,
G_MAXINT,
11,
14,
G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("trough_border",
......@@ -211,7 +211,7 @@ gtk_range_class_init (GtkRangeClass *class)
_("Width of border around range"),
0,
G_MAXINT,
2,
1,
G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("stepper_size",
......@@ -219,7 +219,7 @@ gtk_range_class_init (GtkRangeClass *class)
_("Size of step buttons at ends"),
0,
G_MAXINT,
11,
14,
G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("stepper_spacing",
......@@ -227,7 +227,7 @@ gtk_range_class_init (GtkRangeClass *class)
_("Spacing between step buttons and thumb"),
G_MININT,
G_MAXINT,
1,
0,
G_PARAM_READABLE));
}
......
......@@ -231,7 +231,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
gtk_widget_class_install_style_property_parser (widget_class,
g_param_spec_enum ("shadow_type", "Shadow Type", NULL,
GTK_TYPE_SHADOW_TYPE,
GTK_SHADOW_NONE,
GTK_SHADOW_IN,
G_PARAM_READABLE),
gtk_rc_property_parse_enum);
spinbutton_signals[INPUT] =
......
......@@ -28,6 +28,7 @@
#include <string.h>
#include "gtkgc.h"
#include "gtkrc.h"
#include "gtkspinbutton.h"
#include "gtkstyle.h"
#include "gtkwidget.h"
#include "gtkthemes.h"
......@@ -311,6 +312,90 @@ static void hls_to_rgb (gdouble *h,
gdouble *s);
/*
* Data for default check and radio buttons
*/
static GtkRequisition default_option_indicator_size = { 7, 13 };
static GtkBorder default_option_indicator_spacing = { 7, 5, 2, 2 };
#define INDICATOR_PART_SIZE 13
typedef enum {
CHECK_AA,
CHECK_BASE,
CHECK_BLACK,
CHECK_DARK,
CHECK_LIGHT,
CHECK_MID,
CHECK_TEXT,
RADIO_BASE,
RADIO_BLACK,
RADIO_DARK,
RADIO_LIGHT,
RADIO_MID,
RADIO_TEXT
} IndicatorPart;
static char check_aa_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x58,0x00,0xa0,
0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
static char check_base_bits[] = {
0x00,0x00,0x00,0x00,0xfc,0x07,0xfc,0x07,0xfc,0x07,0xfc,0x07,0xfc,0x07,0xfc,
0x07,0xfc,0x07,0xfc,0x07,0xfc,0x07,0x00,0x00,0x00,0x00};
static char check_black_bits[] = {
0x00,0x00,0xfe,0x0f,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,
0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x00,0x00};
static char check_dark_bits[] = {
0xff,0x1f,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,
0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00};
static char check_light_bits[] = {
0x00,0x00,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,
0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0xfe,0x1f};
static char check_mid_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
0x08,0x00,0x08,0x00,0x08,0x00,0x08,0xfc,0x0f,0x00,0x00};
static char check_text_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x03,0x80,0x01,0x80,0x00,0xd8,
0x00,0x60,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
static char radio_base_bits[] = {
0x00,0x00,0x00,0x00,0xf0,0x01,0xf8,0x03,0xfc,0x07,0xfc,0x07,0xfc,0x07,0xfc,
0x07,0xfc,0x07,0xf8,0x03,0xf0,0x01,0x00,0x00,0x00,0x00};
static char radio_black_bits[] = {
0x00,0x00,0xf0,0x01,0x08,0x02,0x04,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,
0x00,0x02,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
static char radio_dark_bits[] = {
0xf0,0x01,0x08,0x02,0x04,0x04,0x02,0x04,0x01,0x00,0x01,0x00,0x01,0x00,0x01,
0x00,0x01,0x00,0x02,0x00,0x0c,0x00,0x00,0x00,0x00,0x00};
static char radio_light_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x00,0x10,0x00,0x10,0x00,
0x10,0x00,0x10,0x00,0x08,0x00,0x04,0x08,0x02,0xf0,0x01};
static char radio_mid_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,
0x08,0x00,0x08,0x00,0x04,0x00,0x02,0xf0,0x01,0x00,0x00};
static char radio_text_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0xf0,0x01,0xf0,0x01,0xf0,
0x01,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
static struct {
char *bits;
GdkBitmap *bmap;
} indicator_parts[] = {
{ check_aa_bits, NULL },
{ check_base_bits, NULL },
{ check_black_bits, NULL },
{ check_dark_bits, NULL },
{ check_light_bits, NULL },
{ check_mid_bits, NULL },
{ check_text_bits, NULL },
{ radio_base_bits, NULL },
{ radio_black_bits, NULL },
{ radio_dark_bits, NULL },
{ radio_light_bits, NULL },
{ radio_mid_bits, NULL },
{ radio_text_bits, NULL }
};
/* --- variables --- */
static GdkColor gtk_default_normal_fg = { 0, 0, 0, 0 };
static GdkColor gtk_default_active_fg = { 0, 0, 0, 0 };
......@@ -429,6 +514,7 @@ gtk_style_init (GtkStyle *style)
style->mid_gc[i] = NULL;
style->text_gc[i] = NULL;
style->base_gc[i] = NULL;
style->text_aa_gc[i] = NULL;
}
style->xthickness = 2;
......@@ -1307,6 +1393,10 @@ gtk_style_real_realize (GtkStyle *style)
style->mid[i].red = (style->light[i].red + style->dark[i].red) / 2;
style->mid[i].green = (style->light[i].green + style->dark[i].green) / 2;
style->mid[i].blue = (style->light[i].blue + style->dark[i].blue) / 2;
style->text_aa[i].red = (style->text[i].red + style->base[i].red) / 2;
style->text_aa[i].green = (style->text[i].green + style->base[i].green) / 2;
style->text_aa[i].blue = (style->text[i].blue + style->base[i].blue) / 2;
}
gdk_color_black (style->colormap, &style->black);
......@@ -1356,6 +1446,9 @@ gtk_style_real_realize (GtkStyle *style)
if (!gdk_color_alloc (style->colormap, &style->base[i]))
g_warning ("unable to allocate color: ( %d %d %d )",
style->base[i].red, style->base[i].green, style->base[i].blue);
if (!gdk_color_alloc (style->colormap, &style->text_aa[i]))
g_warning ("unable to allocate color: ( %d %d %d )",
style->text_aa[i].red, style->text_aa[i].green, style->text_aa[i].blue);
gc_values.foreground = style->fg[i];
style->fg_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
......@@ -1377,6 +1470,9 @@ gtk_style_real_realize (GtkStyle *style)
gc_values.foreground = style->base[i];
style->base_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
gc_values.foreground = style->text_aa[i];
style->text_aa_gc[i] = gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask);
}
}
......@@ -1614,6 +1710,54 @@ gtk_default_render_icon (GtkStyle *style,
return stated;
}
static gboolean
sanitize_size (GdkWindow *window,
gint *width,
gint *height)
{
gboolean set_bg = FALSE;
if ((*width == -1) && (*height == -1))
{
set_bg = GDK_IS_WINDOW (window);
gdk_window_get_size (window, width, height);
}
else if (*width == -1)
gdk_window_get_size (window, width, NULL);
else if (*height == -1)
gdk_window_get_size (window, NULL, height);
return set_bg;
}
static void
draw_part (GdkDrawable *drawable,
GdkGC *gc,
GdkRectangle *area,
gint x,
gint y,
IndicatorPart part)
{
if (area)
gdk_gc_set_clip_rectangle (gc, area);
if (!indicator_parts[part].bmap)
indicator_parts[part].bmap = gdk_bitmap_create_from_data (drawable,
indicator_parts[part].bits,
INDICATOR_PART_SIZE, INDICATOR_PART_SIZE);
gdk_gc_set_ts_origin (gc, x, y);
gdk_gc_set_stipple (gc, indicator_parts[part].bmap);
gdk_gc_set_fill (gc, GDK_STIPPLED);
gdk_draw_rectangle (drawable, gc, TRUE, x, y, INDICATOR_PART_SIZE, INDICATOR_PART_SIZE);
gdk_gc_set_fill (gc, GDK_SOLID);
if (area)
gdk_gc_set_clip_rectangle (gc, NULL);
}
static void
gtk_default_draw_hline (GtkStyle *style,
GdkWindow *window,
......@@ -1717,6 +1861,170 @@ gtk_default_draw_vline (GtkStyle *style,
}
void
draw_thin_shadow (GtkStyle *style,
GdkWindow *window,
GtkStateType state,
GdkRectangle *area,
gint x,
gint y,
gint width,
gint height)
{
GdkGC *gc1, *gc2;
sanitize_size (window, &width, &height);
gc1 = style->light_gc[state];
gc2 = style->dark_gc[state];
if (area)
{
gdk_gc_set_clip_rectangle (gc1, area);
gdk_gc_set_clip_rectangle (gc2, area);
}
gdk_draw_line (window, gc1,
x, y + height - 1, x + width - 1, y + height - 1);
gdk_draw_line (window, gc1,
x + width - 1, y, x + width - 1, y + height - 1);
gdk_draw_line (window, gc2,
x, y, x + width - 1, y);
gdk_draw_line (window, gc2,
x, y, x, y + height - 1);
if (area)
{
gdk_gc_set_clip_rectangle (gc1, NULL);
gdk_gc_set_clip_rectangle (gc2, NULL);
}
}
void
draw_spin_entry_shadow (GtkStyle *style,
GdkWindow *window,
GtkStateType state,
GdkRectangle *area,
gint x,
gint y,
gint width,
gint height)
{
gint window_width, window_height;
gboolean focus_inset;
gdk_window_get_size (window, &window_width, &window_height);
if (width == -1)
width = window_width;
if (height == 1)
height = window_height;
focus_inset = (width < window_width && height < window_height);
if (area)
{
gdk_gc_set_clip_rectangle (style->light_gc[state], area);
gdk_gc_set_clip_rectangle (style->dark_gc[state], area);
gdk_gc_set_clip_rectangle (style->black_gc, area);
gdk_gc_set_clip_rectangle (style->bg_gc[state], area);
gdk_gc_set_clip_rectangle (style->base_gc[state], area);
}
gdk_draw_line (window, style->light_gc[state],
x, y + height - 1, x + width - 1, y + height - 1);
gdk_draw_line (window,
style->base_gc[state],
x + width - 1, y + 1, x + width - 1, y + height - 3);
if (!focus_inset)
{
gdk_draw_line (window, style->bg_gc[state],
x + 1, y + height - 2, x + width - 1, y + height - 2);
gdk_draw_line (window,
style->base_gc[state],
x + width - 2, y + 1, x + width - 2, y + height - 3);
gdk_draw_line (window, style->black_gc,
x + 1, y + 1, x + width - 1, y + 1);
gdk_draw_line (window, style->black_gc,
x + 1, y + 1, x + 1, y + height - 2);
}
gdk_draw_line (window, style->dark_gc[state],
x, y, x + width - 1, y);
gdk_draw_line (window, style->dark_gc[state],
x, y, x, y + height - 1);
if (area)
{
gdk_gc_set_clip_rectangle (style->light_gc[state], NULL);
gdk_gc_set_clip_rectangle (style->dark_gc[state], NULL);
gdk_gc_set_clip_rectangle (style->black_gc, NULL);
gdk_gc_set_clip_rectangle (style->bg_gc[state], NULL);
gdk_gc_set_clip_rectangle (style->base_gc[state], NULL);
}
}
static void
draw_spinbutton_shadow (GtkStyle *style,
GdkWindow *window,
GtkStateType state,
GdkRectangle *area,
gint x,
gint y,
gint width,
gint height)
{
gint y_middle = y + height / 2;
sanitize_size (window, &width, &height);
if (area)
{
gdk_gc_set_clip_rectangle (style->black_gc, area);
gdk_gc_set_clip_rectangle (style->bg_gc[state], area);
gdk_gc_set_clip_rectangle (style->dark_gc[state], area);
gdk_gc_set_clip_rectangle (style->light_gc[state], area);
}
gdk_draw_line (window, style->black_gc,
x, y + 2, x, y + height - 3);
gdk_draw_line (window, style->black_gc,
x, y + 1, x + width - 2, y + 1);
gdk_draw_line (window, style->black_gc,
x + width - 2, y + 2, x + width - 2, y + height - 3);
gdk_draw_line (window, style->bg_gc[state],
x, y + height - 2, x + width - 2, y + height - 2);
gdk_draw_line (window, style->dark_gc[state],
x, y, x + width - 1, y);
gdk_draw_line (window, style->dark_gc[state],
x + 1, y_middle - 1, x + width - 3, y_middle - 1);
gdk_draw_line (window, style->dark_gc[state],
x + 1, y + height - 3, x + width - 3, y + height - 3);
gdk_draw_line (window, style->light_gc[state],
x + 1, y + 2, x + width - 3, y + 2);
gdk_draw_line (window, style->light_gc[state],
x + 1, y_middle, x + width - 3, y_middle);
gdk_draw_line (window, style->light_gc[state],
x + width - 1, y + 1, x + width - 1, y + height - 1);
gdk_draw_line (window, style->light_gc[state],
x, y + height - 1, x + width - 2, y + height - 1);
if (area)
{
gdk_gc_set_clip_rectangle (style->black_gc, NULL);
gdk_gc_set_clip_rectangle (style->bg_gc[state], NULL);
gdk_gc_set_clip_rectangle (style->dark_gc[state], NULL);
gdk_gc_set_clip_rectangle (style->light_gc[state], NULL);
}
}
static void
gtk_default_draw_shadow (GtkStyle *style,
GdkWindow *window,
......@@ -1738,13 +2046,41 @@ gtk_default_draw_shadow (GtkStyle *style,
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (window != NULL);
if (shadow_type == GTK_SHADOW_IN)
{
if (detail && (strcmp (detail, "buttondefault") == 0))
{
sanitize_size (window, &width, &height);
gdk_draw_rectangle (window, style->black_gc, FALSE,
x, y, width - 1, height - 1);
return;
}
if (detail && strcmp (detail, "trough") == 0)
{
draw_thin_shadow (style, window, state_type, area,
x, y, width, height);
return;
}
else if (widget && GTK_IS_SPIN_BUTTON (widget) &&
detail && strcmp (detail, "entry") == 0)
{
draw_spin_entry_shadow (style, window, state_type, area,
x, y, width, height);
return;
}
else if (widget && GTK_IS_SPIN_BUTTON (widget) &&
detail && strcmp (detail, "spinbutton") == 0)
{
draw_spinbutton_shadow (style, window, state_type,
area, x, y, width, height);
return;
}
}
if ((width == -1) && (height == -1))
gdk_window_get_size (window, &width, &height);
else if (width == -1)
gdk_window_get_size (window, &width, NULL);
else if (height == -1)
gdk_window_get_size (window, NULL, &height);
sanitize_size (window, &width, &height);
switch (shadow_type)
{
......@@ -2027,355 +2363,181 @@ gtk_default_draw_polygon (GtkStyle *style,
}
static void
gtk_default_draw_arrow (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
GtkArrowType arrow_type,
gboolean fill,
gint x,
gint y,
gint width,
gint height)
draw_varrow (GdkWindow *window,
GdkGC *gc,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkArrowType arrow_type,