Commit b1bb0593 authored by Adrien Plazas's avatar Adrien Plazas
Browse files

details-page: Show the compatible-device kudo

This lets the users know if an app is compatible with their device.
parent db6c3943
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<g fill="#2e3436">
<path d="M4 1C2.338 1 1 2.338 1 4v1h2V4c0-.554.446-1 1-1h8c.554 0 1 .446 1 1v6c0 .554-.446 1-1 1H9v2h3c1.662 0 3-1.338 3-3V4c0-1.662-1.338-3-3-3zm5 13.025V16h3c1 0 1-1 1-1s-.053-.845-4-.975z"/>
<path d="M2.28 6C1.57 6 1 6.571 1 7.281v7.438C1 15.429 1.57 16 2.28 16h4.438C7.428 16 8 15.429 8 14.719V7.28C8 6.571 7.428 6 6.718 6H4zm.13 1H3c0 .554.446 1 1 1h1c.554 0 1-.446 1-1h.59c.227 0 .41.182.41.41v6.163c0 .228-.183.41-.41.41H2.41a.409.409 0 0 1-.41-.41V7.41c0-.228.182-.41.41-.41z" style="marker:none"/>
</g>
</svg>
......@@ -121,11 +121,13 @@ struct _GsDetailsPage
GtkWidget *spinner_remove;
GtkWidget *stack_details;
GtkWidget *grid_details_kudo;
GtkWidget *image_details_kudo_compatible_device;
GtkWidget *image_details_kudo_docs;
GtkWidget *image_details_kudo_sandboxed;
GtkWidget *image_details_kudo_integration;
GtkWidget *image_details_kudo_translated;
GtkWidget *image_details_kudo_updated;
GtkWidget *label_details_kudo_compatible_device;
GtkWidget *label_details_kudo_docs;
GtkWidget *label_details_kudo_sandboxed;
GtkWidget *label_details_kudo_integration;
......@@ -1054,8 +1056,13 @@ gs_details_page_refresh_all (GsDetailsPage *self)
gtk_label_set_label (GTK_LABEL (self->label_details_origin_value), origin);
}
/* set MyLanguage kudo */
/* set CompatibleDevice kudo */
kudos = gs_app_get_kudos (self->app);
ret = (kudos & GS_APP_KUDO_COMPATIBLE_DEVICE) > 0;
gtk_widget_set_sensitive (self->image_details_kudo_compatible_device, ret);
gs_details_page_set_sensitive (self->label_details_kudo_compatible_device, ret);
/* set MyLanguage kudo */
ret = (kudos & GS_APP_KUDO_MY_LANGUAGE) > 0;
gtk_widget_set_sensitive (self->image_details_kudo_translated, ret);
gs_details_page_set_sensitive (self->label_details_kudo_translated, ret);
......@@ -2560,11 +2567,13 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, spinner_remove);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, stack_details);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, grid_details_kudo);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_compatible_device);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_docs);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_sandboxed);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_integration);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_translated);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_updated);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_compatible_device);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_docs);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_sandboxed);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_integration);
......
......@@ -465,6 +465,21 @@
<property name="row_spacing">9</property>
<property name="column_spacing">12</property>
<property name="hexpand">True</property>
<child>
<object class="GtkImage" id="image_details_kudo_compatible_device">
<property name="visible">True</property>
<property name="pixel_size">16</property>
<property name="icon_name">device-compatible-symbolic</property>
<property name="icon_size">6</property>
<style>
<class name="kudo-pill"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkImage" id="image_details_kudo_translated">
<property name="visible">True</property>
......@@ -477,7 +492,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
......@@ -491,7 +506,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
......@@ -506,7 +521,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
......@@ -521,7 +536,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
......@@ -536,7 +551,18 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_details_kudo_compatible_device">
<property name="visible">True</property>
<property name="label" translatable="yes">Designed for your device</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
......@@ -547,7 +573,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
......@@ -558,7 +584,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
......@@ -569,7 +595,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
......@@ -580,7 +606,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
......@@ -591,7 +617,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="top_attach">5</property>
</packing>
</child>
</object>
......
......@@ -39,6 +39,7 @@
<file>gtk-style-hc.css</file>
</gresource>
<gresource prefix="/sm/puri/Store/icons/hicolor/scalable/status">
<file preprocess="xml-stripblanks">device-compatible-symbolic.svg</file>
<file preprocess="xml-stripblanks">navigate-symbolic.svg</file>
</gresource>
</gresources>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment