[gnome-software] Refactor gs_shell_overview_search_button_cb
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Refactor gs_shell_overview_search_button_cb
- Date: Thu, 2 Jun 2016 10:20:14 +0000 (UTC)
commit 730496dbca4dfd7c8f1d97cc444e0f298edd8cf9
Author: Joaquim Rocha <jrocha endlessm com>
Date: Thu Jun 2 12:19:48 2016 +0200
Refactor gs_shell_overview_search_button_cb
src/gs-shell-overview.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/src/gs-shell-overview.c b/src/gs-shell-overview.c
index d55a847..0ed2265 100644
--- a/src/gs-shell-overview.c
+++ b/src/gs-shell-overview.c
@@ -524,18 +524,15 @@ static void
gs_shell_overview_search_button_cb (GtkButton *button, GsShellOverview *self)
{
GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
- GtkWidget *widget;
+ GtkToggleButton *search_button = GTK_TOGGLE_BUTTON (priv->search_button);
+ GtkRevealer *search_bar;
+ gboolean show_search;
- /* show search */
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->search_button))) {
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
- gtk_revealer_set_reveal_child (GTK_REVEALER (widget), TRUE);
- return;
- }
+ show_search = gtk_toggle_button_get_active (search_button);
- /* hide search */
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
- gtk_revealer_set_reveal_child (GTK_REVEALER (widget), FALSE);
+ search_bar = GTK_REVEALER (gtk_builder_get_object (priv->builder,
+ "search_bar"));
+ gtk_revealer_set_reveal_child (search_bar, show_search);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]