[gnome-software] Only set the app row's buttons as destructive when they remove an app



commit e946352e191e6b19f7dc6c10cfd087411e3e53ee
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Wed Mar 28 13:17:45 2018 +0200

    Only set the app row's buttons as destructive when they remove an app
    
    If the page is set as colorful, we should still not show the update
    button as destructive. So it should only be set as such when the app
    is installed (because the button will remove the app).

 src/gs-app-row.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index fe1c9bd9..1e7368ec 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -211,9 +211,14 @@ gs_app_row_refresh_button (GsAppRow *app_row, gboolean missing_search_result)
                switch (gs_app_get_state (priv->app)) {
                case AS_APP_STATE_UPDATABLE:
                case AS_APP_STATE_INSTALLED:
-               case AS_APP_STATE_UPDATABLE_LIVE:
                        gtk_style_context_add_class (context, "destructive-action");
                        break;
+               case AS_APP_STATE_UPDATABLE_LIVE:
+                       if (priv->show_update)
+                               gtk_style_context_remove_class (context, "destructive-action");
+                       else
+                               gtk_style_context_add_class (context, "destructive-action");
+                       break;
                default:
                        gtk_style_context_remove_class (context, "destructive-action");
                        break;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]