summaryrefslogtreecommitdiff
path: root/gtk/gtkstatusbar.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-12-31 00:36:03 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-12-31 00:36:03 +0000
commit571f4ff9722ebee5b35f7d39dc80786d2aa75777 (patch)
treeeec3ae15ecdd6d2037158977c8c29982dc59d61a /gtk/gtkstatusbar.c
parent1ed8f921401a1f37cf0bf37b5c59937339e447f4 (diff)
downloadgtk+-571f4ff9722ebee5b35f7d39dc80786d2aa75777.tar.gz
Don't install cursors on insensitive widgets. (#358864, Jan Schampera)
2006-12-30 Matthias Clasen <mclasen@redhat.com> * gtk/gtkentry.c: * gtk/gtklabel.c: * gtk/gtkpaned.c: * gtk/gtkstatusbar.c: * gtk/gtktextview.c: Don't install cursors on insensitive widgets. (#358864, Jan Schampera) svn path=/trunk/; revision=16983
Diffstat (limited to 'gtk/gtkstatusbar.c')
-rw-r--r--gtk/gtkstatusbar.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 252e165096..bdeeed91a8 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -77,6 +77,8 @@ static void gtk_statusbar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_statusbar_direction_changed (GtkWidget *widget,
GtkTextDirection prev_dir);
+static void gtk_statusbar_state_changed (GtkWidget *widget,
+ GtkStateType previous_state);
static void gtk_statusbar_create_window (GtkStatusbar *statusbar);
static void gtk_statusbar_destroy_window (GtkStatusbar *statusbar);
static void gtk_statusbar_get_property (GObject *object,
@@ -116,14 +118,12 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
widget_class->unrealize = gtk_statusbar_unrealize;
widget_class->map = gtk_statusbar_map;
widget_class->unmap = gtk_statusbar_unmap;
-
widget_class->button_press_event = gtk_statusbar_button_press;
widget_class->expose_event = gtk_statusbar_expose_event;
-
widget_class->size_request = gtk_statusbar_size_request;
widget_class->size_allocate = gtk_statusbar_size_allocate;
-
widget_class->direction_changed = gtk_statusbar_direction_changed;
+ widget_class->state_changed = gtk_statusbar_state_changed;
class->text_pushed = gtk_statusbar_update;
class->text_popped = gtk_statusbar_update;
@@ -512,14 +512,19 @@ set_grip_cursor (GtkStatusbar *statusbar)
GdkCursorType cursor_type;
GdkCursor *cursor;
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- cursor_type = GDK_BOTTOM_RIGHT_CORNER;
+ if (GTK_WIDGET_IS_SENSITIVE (widget))
+ {
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+ cursor_type = GDK_BOTTOM_RIGHT_CORNER;
+ else
+ cursor_type = GDK_BOTTOM_LEFT_CORNER;
+
+ cursor = gdk_cursor_new_for_display (display, cursor_type);
+ gdk_window_set_cursor (statusbar->grip_window, cursor);
+ gdk_cursor_unref (cursor);
+ }
else
- cursor_type = GDK_BOTTOM_LEFT_CORNER;
-
- cursor = gdk_cursor_new_for_display (display, cursor_type);
- gdk_window_set_cursor (statusbar->grip_window, cursor);
- gdk_cursor_unref (cursor);
+ gdk_window_set_cursor (statusbar->grip_window, NULL);
}
}
@@ -567,6 +572,15 @@ gtk_statusbar_direction_changed (GtkWidget *widget,
}
static void
+gtk_statusbar_state_changed (GtkWidget *widget,
+ GtkStateType previous_state)
+{
+ GtkStatusbar *statusbar = GTK_STATUSBAR (widget);
+
+ set_grip_cursor (statusbar);
+}
+
+static void
gtk_statusbar_destroy_window (GtkStatusbar *statusbar)
{
gdk_window_set_user_data (statusbar->grip_window, NULL);