Commit 7cfceccf authored by Adrien Plazas's avatar Adrien Plazas
Browse files

librem5: review-row: Port it to phones

Shuffle the layout a bit to better work on phones, but less well on
desktops.
parent b6e03435
......@@ -29,7 +29,8 @@ typedef struct
GtkWidget *button_dismiss;
GtkWidget *button_report;
GtkWidget *button_remove;
GtkWidget *box_voting;
GtkWidget *label_voting;
GtkWidget *box_vote_buttons;
} GsReviewRowPrivate;
enum {
......@@ -76,9 +77,11 @@ gs_review_row_refresh (GsReviewRow *row)
if ((priv->actions & (1 << GS_PLUGIN_ACTION_REVIEW_UPVOTE |
1 << GS_PLUGIN_ACTION_REVIEW_DOWNVOTE |
1 << GS_PLUGIN_ACTION_REVIEW_DISMISS)) == 0) {
gtk_widget_set_visible (priv->box_voting, FALSE);
gtk_widget_set_visible (priv->label_voting, FALSE);
gtk_widget_set_visible (priv->box_vote_buttons, FALSE);
} else {
gtk_widget_set_visible (priv->box_voting, TRUE);
gtk_widget_set_visible (priv->label_voting, TRUE);
gtk_widget_set_visible (priv->box_vote_buttons, TRUE);
gtk_widget_set_visible (priv->button_yes,
priv->actions & 1 << GS_PLUGIN_ACTION_REVIEW_UPVOTE);
gtk_widget_set_visible (priv->button_no,
......@@ -179,7 +182,8 @@ gs_review_row_class_init (GsReviewRowClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GsReviewRow, button_dismiss);
gtk_widget_class_bind_template_child_private (widget_class, GsReviewRow, button_report);
gtk_widget_class_bind_template_child_private (widget_class, GsReviewRow, button_remove);
gtk_widget_class_bind_template_child_private (widget_class, GsReviewRow, box_voting);
gtk_widget_class_bind_template_child_private (widget_class, GsReviewRow, label_voting);
gtk_widget_class_bind_template_child_private (widget_class, GsReviewRow, box_vote_buttons);
}
static void
......
......@@ -95,61 +95,62 @@
</packing>
</child>
<child>
<object class="GtkBox" id="box_voting">
<object class="GtkLabel" id="label_voting">
<property name="visible">True</property>
<property name="spacing">9</property>
<property name="halign">start</property>
<property name="label" translatable="yes" comments="Translators: Users can express their opinions about other users&apos; opinions about the apps.">Was this review useful to you?</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_vote_buttons">
<property name="visible">True</property>
<property name="spacing">0</property>
<property name="halign">start</property>
<style>
<class name="vote-buttons"/>
</style>
<child>
<object class="GtkButton" id="button_yes">
<property name="label" translatable="yes">Yes</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
</child>
<child>
<object class="GtkLabel">
<object class="GtkButton" id="button_no">
<property name="label" translatable="yes">No</property>
<property name="visible">True</property>
<property name="label" translatable="yes" comments="Translators: Users can express their opinions about other users&apos; opinions about the apps.">Was this review useful to you?</property>
<style>
<class name="dim-label"/>
</style>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
</child>
<child>
<object class="GtkBox" id="box_vote_buttons">
<object class="GtkButton" id="button_dismiss">
<property name="label" translatable="yes" comments="Translators: Button text for indifference, only used when moderating">Meh</property>
<property name="visible">True</property>
<property name="spacing">0</property>
<property name="halign">start</property>
<style>
<class name="vote-buttons"/>
</style>
<child>
<object class="GtkButton" id="button_yes">
<property name="label" translatable="yes">Yes</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
</child>
<child>
<object class="GtkButton" id="button_no">
<property name="label" translatable="yes">No</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
</child>
<child>
<object class="GtkButton" id="button_dismiss">
<property name="label" translatable="yes" comments="Translators: Button text for indifference, only used when moderating">Meh</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
</child>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">2</property>
<property name="top_attach">4</property>
<property name="width">1</property>
</packing>
</child>
<child>
......@@ -180,7 +181,7 @@
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
</object>
......
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