[glide] Theme chooser now supports clicking on stage to deselect...just seems like what you would expect
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] Theme chooser now supports clicking on stage to deselect...just seems like what you would expect
- Date: Sat, 5 Jun 2010 22:30:56 +0000 (UTC)
commit 0e1c03c38b00ad3fa32c25df23cecc8b78d2f7e3
Author: Robert Carr <racarr Valentine localdomain>
Date: Sat Jun 5 18:31:21 2010 -0400
Theme chooser now supports clicking on stage to deselect...just seems like what you would expect
libglide/glide-theme-chooser-priv.h | 1 +
libglide/glide-theme-chooser.c | 17 +++++++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/libglide/glide-theme-chooser-priv.h b/libglide/glide-theme-chooser-priv.h
index b847386..05fb643 100644
--- a/libglide/glide-theme-chooser-priv.h
+++ b/libglide/glide-theme-chooser-priv.h
@@ -29,6 +29,7 @@ struct _GlideThemeChooserPrivate
GList *themes;
GtkWidget *embed;
+ GtkWidget *new_button;
ClutterActor *stage;
ClutterActor *theme_box;
diff --git a/libglide/glide-theme-chooser.c b/libglide/glide-theme-chooser.c
index f793f4f..301940e 100644
--- a/libglide/glide-theme-chooser.c
+++ b/libglide/glide-theme-chooser.c
@@ -113,14 +113,21 @@ glide_theme_chooser_stage_button_press (ClutterActor *actor,
ClutterActor *clicked;
if (chooser->priv->selection)
- glide_theme_preview_actor_set_selected (GLIDE_THEME_PREVIEW_ACTOR (chooser->priv->selection),
- FALSE);
+ {
+ glide_theme_preview_actor_set_selected (GLIDE_THEME_PREVIEW_ACTOR (chooser->priv->selection),
+ FALSE);
+ chooser->priv->selection = NULL;
+ }
clicked = clutter_stage_get_actor_at_pos (CLUTTER_STAGE (actor), CLUTTER_PICK_REACTIVE,
bev->x, bev->y);
- if (!clicked)
- return;
+ if (!clicked || !GLIDE_IS_THEME_PREVIEW_ACTOR (clicked))
+ {
+ gtk_widget_set_sensitive (chooser->priv->new_button, FALSE);
+ return;
+ }
+ gtk_widget_set_sensitive (chooser->priv->new_button, TRUE);
chooser->priv->selection = clicked;
glide_theme_preview_actor_set_selected (GLIDE_THEME_PREVIEW_ACTOR (chooser->priv->selection),
@@ -308,6 +315,8 @@ glide_theme_chooser_make_bottom_hbox (GlideThemeChooser *chooser)
gtk_box_pack_start (GTK_BOX (ret), new, FALSE, 0, 0);
gtk_box_pack_start (GTK_BOX (ret), cancel, FALSE, 0, 0);
+ chooser->priv->new_button = new;
+
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]