summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-07-09 14:39:17 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-07-09 14:39:17 +0000
commit50ff8e97f9a5997bc93b48110649b1b47c7ea1aa (patch)
treed248b11e5944f2b14cb31f02896ca8693b34d414
parent7cd37d663b0e47e05e9e336cfc21f4e4de2ab932 (diff)
downloadgdk-pixbuf-50ff8e97f9a5997bc93b48110649b1b47c7ea1aa.tar.gz
Fix some cases where style functions were not handling widget == NULL
2004-07-09 Matthias Clasen <mclasen@redhat.com> * gtk/gtkstyle.c: Fix some cases where style functions were not handling widget == NULL properly. (#146282)
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-2-105
-rw-r--r--ChangeLog.pre-2-65
-rw-r--r--ChangeLog.pre-2-85
-rw-r--r--gtk/gtkstyle.c32
5 files changed, 43 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index f2dd16406..a22613840 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-09 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkstyle.c: Fix some cases where style functions were
+ not handling widget == NULL properly. (#146282)
+
Thu Jul 8 22:16:18 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkiconfactory.c (get_default_icons):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index f2dd16406..a22613840 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,8 @@
+2004-07-09 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkstyle.c: Fix some cases where style functions were
+ not handling widget == NULL properly. (#146282)
+
Thu Jul 8 22:16:18 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkiconfactory.c (get_default_icons):
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index f2dd16406..a22613840 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,8 @@
+2004-07-09 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkstyle.c: Fix some cases where style functions were
+ not handling widget == NULL properly. (#146282)
+
Thu Jul 8 22:16:18 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkiconfactory.c (get_default_icons):
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index f2dd16406..a22613840 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,8 @@
+2004-07-09 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkstyle.c: Fix some cases where style functions were
+ not handling widget == NULL properly. (#146282)
+
Thu Jul 8 22:16:18 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkiconfactory.c (get_default_icons):
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 23bca4dc3..f6270c0a4 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -2550,6 +2550,20 @@ draw_menu_shadow (GtkStyle *style,
x + 1, y + 1, x + 1, y + height - 3);
}
+static GtkTextDirection
+get_direction (GtkWidget *widget)
+{
+ GtkTextDirection dir;
+
+ if (widget)
+ dir = gtk_widget_get_direction (widget);
+ else
+ dir = GTK_TEXT_DIR_LTR;
+
+ return dir;
+}
+
+
static void
gtk_default_draw_shadow (GtkStyle *style,
GdkWindow *window,
@@ -2592,8 +2606,8 @@ gtk_default_draw_shadow (GtkStyle *style,
if (widget && GTK_IS_SPIN_BUTTON (widget) &&
detail && strcmp (detail, "spinbutton") == 0)
{
- draw_spinbutton_shadow (style, window, state_type,
- gtk_widget_get_direction (widget), area, x, y, width, height);
+ draw_spinbutton_shadow (style, window, state_type,
+ get_direction (widget), area, x, y, width, height);
return;
}
@@ -2830,7 +2844,7 @@ gtk_default_draw_shadow (GtkStyle *style,
widget && GTK_IS_SPIN_BUTTON (widget) &&
detail && strcmp (detail, "entry") == 0)
{
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+ if (get_direction (widget) == GTK_TEXT_DIR_LTR)
{
gdk_draw_line (window,
style->base_gc[state_type],
@@ -3397,7 +3411,7 @@ gtk_default_draw_box (GtkStyle *style,
width -= 3;
height -= 2;
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+ if (get_direction (widget) == GTK_TEXT_DIR_RTL)
x += 2;
else
x += 1;
@@ -3409,7 +3423,7 @@ gtk_default_draw_box (GtkStyle *style,
width -= 3;
height -= 2;
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+ if (get_direction (widget) == GTK_TEXT_DIR_RTL)
x += 2;
else
x += 1;
@@ -3483,7 +3497,7 @@ gtk_default_draw_box (GtkStyle *style,
sanitize_size (window, &width, &height);
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+ if (get_direction (widget) == GTK_TEXT_DIR_RTL)
vline_x = x + indicator_size.width + indicator_spacing.left + indicator_spacing.right;
else
vline_x = x + width - (indicator_size.width + indicator_spacing.left + indicator_spacing.right) - style->xthickness;
@@ -4993,13 +5007,13 @@ gtk_default_draw_expander (GtkStyle *style,
switch (expander_style)
{
case GTK_EXPANDER_COLLAPSED:
- degrees = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? 180 : 0;
+ degrees = (get_direction (widget) == GTK_TEXT_DIR_RTL) ? 180 : 0;
break;
case GTK_EXPANDER_SEMI_COLLAPSED:
- degrees = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? 150 : 30;
+ degrees = (get_direction (widget) == GTK_TEXT_DIR_RTL) ? 150 : 30;
break;
case GTK_EXPANDER_SEMI_EXPANDED:
- degrees = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? 120 : 60;
+ degrees = (get_direction (widget) == GTK_TEXT_DIR_RTL) ? 120 : 60;
break;
case GTK_EXPANDER_EXPANDED:
degrees = 90;