[gnome-software/wip/rancell/paid] Remove special price label - just use button



commit bfb7f43049a123183de2b2bca4e06b36f1ee10fc
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri May 6 10:56:34 2016 +1200

    Remove special price label - just use button

 src/gs-app-row.c  |   27 +++++++++++----------------
 src/gs-app-row.ui |   12 ------------
 2 files changed, 11 insertions(+), 28 deletions(-)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 8272063..e843b80 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -40,7 +40,6 @@ typedef struct
        GtkWidget       *name_label;
        GtkWidget       *version_label;
        GtkWidget       *star;
-       GtkWidget       *price_label;
        GtkWidget       *folder_label;
        GtkWidget       *description_label;
        GtkWidget       *button_box;
@@ -219,17 +218,6 @@ gs_app_row_refresh (GsAppRow *app_row)
                                     gs_app_get_version_ui (priv->app));
        }
 
-       prices = gs_app_get_prices (priv->app);
-       if (prices->len > 0) {
-               GsPrice *price = g_ptr_array_index (prices, 0);
-               g_autofree gchar *text = NULL;
-               text = gs_price_to_string (price);
-               gtk_label_set_label (GTK_LABEL (priv->price_label), text);
-               gtk_widget_show (priv->price_label);
-       } else {
-               gtk_widget_hide (priv->price_label);
-       }
-
        if (priv->show_update || priv->show_codec) {
                gtk_widget_hide (priv->folder_label);
        } else {
@@ -293,9 +281,17 @@ gs_app_row_refresh (GsAppRow *app_row)
        case AS_APP_STATE_AVAILABLE:
        case AS_APP_STATE_AVAILABLE_LOCAL:
                gtk_widget_set_visible (priv->button, TRUE);
-               /* TRANSLATORS: this is a button next to the search results that
-                * allows the application to be easily installed */
-               gtk_button_set_label (GTK_BUTTON (priv->button), _("Install"));
+               prices = gs_app_get_prices (priv->app);
+               if (prices->len > 0) {
+                       GsPrice *price = g_ptr_array_index (prices, 0);
+                       g_autofree gchar *text = NULL;
+                       text = gs_price_to_string (price);
+                       gtk_button_set_label (GTK_BUTTON (priv->button), text);
+               } else {
+                       /* TRANSLATORS: this is a button next to the search results that
+                        * allows the application to be easily installed */
+                       gtk_button_set_label (GTK_BUTTON (priv->button), _("Install"));
+               }
                break;
        case AS_APP_STATE_UPDATABLE_LIVE:
                gtk_widget_set_visible (priv->button, TRUE);
@@ -545,7 +541,6 @@ gs_app_row_class_init (GsAppRowClass *klass)
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, name_label);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, version_label);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, star);
-       gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, price_label);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, folder_label);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, description_label);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, button_box);
diff --git a/src/gs-app-row.ui b/src/gs-app-row.ui
index cab89d1..0146a6a 100644
--- a/src/gs-app-row.ui
+++ b/src/gs-app-row.ui
@@ -80,18 +80,6 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="price_label">
-                <property name="visible">True</property>
-                <property name="xalign">0.0</property>
-                <property name="yalign">0.5</property>
-                <property name="ellipsize">end</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-              </packing>
-            </child>
-            <child>
               <object class="GtkLabel" id="folder_label">
                 <property name="visible">True</property>
                 <property name="xalign">0.0</property>


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