[gnome-control-center/wip/feborges/new-users-panel] user-accounts: Do not draw the arrow when the Carousel is hidden
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/feborges/new-users-panel] user-accounts: Do not draw the arrow when the Carousel is hidden
- Date: Sat, 10 Dec 2016 22:31:43 +0000 (UTC)
commit 4cb0a7a6b87c0f71226b221a85842d429464d88d
Author: Felipe Borges <felipeborges gnome org>
Date: Sat Dec 10 23:29:26 2016 +0100
user-accounts: Do not draw the arrow when the Carousel is hidden
Since we hide the carousel when there's just a single user, do not
draw the arrow.
https://bugzilla.gnome.org/show_bug.cgi?id=767065
panels/user-accounts/um-carousel.c | 6 +++++-
panels/user-accounts/um-user-panel.c | 10 +++++-----
2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/panels/user-accounts/um-carousel.c b/panels/user-accounts/um-carousel.c
index 3260f44..3ff8152 100644
--- a/panels/user-accounts/um-carousel.c
+++ b/panels/user-accounts/um-carousel.c
@@ -157,7 +157,8 @@ on_item_toggled (UmCarouselItem *item,
self->selected_item = item;
- g_signal_emit (user_data, signals[ITEM_ACTIVATED], 0, item);
+ if (item != NULL)
+ g_signal_emit (user_data, signals[ITEM_ACTIVATED], 0, item);
}
void
@@ -168,6 +169,9 @@ um_carousel_select_item (UmCarousel *self,
on_item_toggled (item, self);
+ if (item == NULL)
+ return;
+
self->visible_page = item->page;
page_name = g_strdup_printf ("%d", self->visible_page);
gtk_stack_set_visible_child_name (self->stack, page_name);
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index a8d156e..495b372 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -293,12 +293,11 @@ reload_users (CcUserPanelPrivate *d)
static void
user_removed (ActUserManager *um, ActUser *user, CcUserPanelPrivate *d)
{
+ UmCarouselItem *item = NULL;
gboolean show_carousel;
d->other_accounts--;
show_carousel = (d->other_accounts > 0);
- gtk_revealer_set_reveal_child (GTK_REVEALER (get_widget (d, "carousel-revealer")),
- show_carousel);
reload_users (d);
@@ -307,11 +306,12 @@ user_removed (ActUserManager *um, ActUser *user, CcUserPanelPrivate *d)
show_user (user, d);
if (show_carousel) {
- UmCarouselItem *item;
-
item = um_carousel_find_item (d->carousel, user, user_compare);
- um_carousel_select_item (d->carousel, item);
}
+
+ um_carousel_select_item (d->carousel, item);
+ gtk_revealer_set_reveal_child (GTK_REVEALER (get_widget (d, "carousel-revealer")),
+ show_carousel);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]