diff options
author | Chris Lumens <clumens@redhat.com> | 2012-06-19 11:41:27 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2012-06-19 11:41:27 -0400 |
commit | 317bf5a19f0f46bc6758c399f2f41ce970d4a52e (patch) | |
tree | 738d58997e935cfac9c642a63912daf7898fecc6 /widgets | |
parent | 08fb512a46196bfc4c8a158e67ad4d95f8e0bbc0 (diff) | |
download | anaconda-317bf5a19f0f46bc6758c399f2f41ce970d4a52e.tar.gz anaconda-317bf5a19f0f46bc6758c399f2f41ce970d4a52e.tar.xz anaconda-317bf5a19f0f46bc6758c399f2f41ce970d4a52e.zip |
Add the hand cursor to MountpointSelectors, too.
This is largely just copy & paste from what msivak did elsewhere.
Thanks.
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/src/MountpointSelector.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/widgets/src/MountpointSelector.c b/widgets/src/MountpointSelector.c index 7ac3983de..2f3a3b6b8 100644 --- a/widgets/src/MountpointSelector.c +++ b/widgets/src/MountpointSelector.c @@ -54,6 +54,8 @@ struct _AnacondaMountpointSelectorPrivate { GtkWidget *name_label, *size_label, *mountpoint_label; GtkWidget *arrow; + GdkCursor *cursor; + gboolean chosen; }; @@ -62,6 +64,9 @@ G_DEFINE_TYPE(AnacondaMountpointSelector, anaconda_mountpoint_selector, GTK_TYPE static void anaconda_mountpoint_selector_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void anaconda_mountpoint_selector_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void anaconda_mountpoint_selector_realize(GtkWidget *widget, gpointer user_data); +static void anaconda_mountpoint_selector_finalize(AnacondaMountpointSelector *widget); + static void anaconda_mountpoint_selector_toggle_background(AnacondaMountpointSelector *widget); static gboolean anaconda_mountpoint_selector_focus_changed(GtkWidget *widget, GdkEventFocus *event, gpointer user_data); @@ -70,6 +75,7 @@ static void anaconda_mountpoint_selector_class_init(AnacondaMountpointSelectorCl object_class->set_property = anaconda_mountpoint_selector_set_property; object_class->get_property = anaconda_mountpoint_selector_get_property; + object_class->finalize = (GObjectFinalizeFunc) anaconda_mountpoint_selector_finalize; /** * AnacondaMountpointSelector:name: @@ -174,6 +180,10 @@ static void anaconda_mountpoint_selector_init(AnacondaMountpointSelector *mountp g_signal_connect(mountpoint, "focus-in-event", G_CALLBACK(anaconda_mountpoint_selector_focus_changed), NULL); g_signal_connect(mountpoint, "focus-out-event", G_CALLBACK(anaconda_mountpoint_selector_focus_changed), NULL); + /* Set "hand" cursor shape when over the selector */ + mountpoint->priv->cursor = gdk_cursor_new(GDK_HAND2); + g_signal_connect(mountpoint, "realize", G_CALLBACK(anaconda_mountpoint_selector_realize), NULL); + /* Create the grid. */ mountpoint->priv->grid = gtk_grid_new(); gtk_grid_set_column_spacing(GTK_GRID(mountpoint->priv->grid), 12); @@ -224,6 +234,16 @@ static void anaconda_mountpoint_selector_init(AnacondaMountpointSelector *mountp gtk_container_add(GTK_CONTAINER(mountpoint), mountpoint->priv->grid); } +static void anaconda_mountpoint_selector_finalize(AnacondaMountpointSelector *widget) { + g_object_unref(widget->priv->cursor); +} + +static void anaconda_mountpoint_selector_realize(GtkWidget *widget, gpointer user_data) { + AnacondaMountpointSelector *mountpoint = ANACONDA_MOUNTPOINT_SELECTOR(widget); + + gdk_window_set_cursor(gtk_widget_get_window(widget), mountpoint->priv->cursor); +} + static void anaconda_mountpoint_selector_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { AnacondaMountpointSelector *widget = ANACONDA_MOUNTPOINT_SELECTOR(object); AnacondaMountpointSelectorPrivate *priv = widget->priv; |