[gnome-software/wip/jrocha/category-redesign: 9/9] Do not show the sort button on add-ons (except in shell-extensions)
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/jrocha/category-redesign: 9/9] Do not show the sort button on add-ons (except in shell-extensions)
- Date: Tue, 29 Aug 2017 15:50:34 +0000 (UTC)
commit d9ebe831524034a61be82ffb78f54bcb15db5633
Author: Joaquim Rocha <jrocha endlessm com>
Date: Tue Aug 29 17:48:30 2017 +0200
Do not show the sort button on add-ons (except in shell-extensions)
This is due to the fact that add-ons (except shell-extensions) cannot
be rated at the moment.
src/gs-category-page.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-category-page.c b/src/gs-category-page.c
index 4d4eeef..684e37d 100644
--- a/src/gs-category-page.c
+++ b/src/gs-category-page.c
@@ -57,6 +57,7 @@ struct _GsCategoryPage
GtkWidget *subcats_filter_button_label;
GtkWidget *subcats_filter_button;
GtkWidget *popover_filter_box;
+ GtkWidget *subcats_sort_button;
GtkWidget *subcats_sort_button_label;
GtkWidget *sort_rating_button;
GtkWidget *sort_name_button;
@@ -308,12 +309,19 @@ gs_category_page_reload (GsPage *page)
gs_category_get_id (self->category),
gs_category_get_id (self->subcategory));
- /* show the shell extensions header */
- if (g_strcmp0 (gs_category_get_id (self->category), "addons") == 0 &&
- g_strcmp0 (gs_category_get_id (self->subcategory), "shell-extensions") == 0) {
- gtk_widget_set_visible (self->infobar_category_shell_extensions, TRUE);
+ if (g_strcmp0 (gs_category_get_id (self->category), "addons") == 0) {
+ if (g_strcmp0 (gs_category_get_id (self->subcategory), "shell-extensions") != 0) {
+ /* we don't want to show the sort button on the addons that
+ * cannot be rated */
+ gtk_widget_set_visible (self->subcats_sort_button, FALSE);
+ } else {
+ /* show the shell extensions header and the sort button */
+ gtk_widget_set_visible (self->infobar_category_shell_extensions, TRUE);
+ gtk_widget_set_visible (self->subcats_sort_button, TRUE);
+ }
} else {
gtk_widget_set_visible (self->infobar_category_shell_extensions, FALSE);
+ gtk_widget_set_visible (self->subcats_sort_button, TRUE);
}
if (self->sort_rating_handler_id > 0)
@@ -556,6 +564,7 @@ gs_category_page_class_init (GsCategoryPageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, subcats_filter_button_label);
gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, subcats_filter_button);
gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, popover_filter_box);
+ gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, subcats_sort_button);
gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, subcats_sort_button_label);
gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, sort_rating_button);
gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, sort_name_button);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]