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

d/patches: Ellipsize the updates section buttons

This ensures they won't grow so large that they will make the window too
wide.

Fixes #30
parent f3c29e45
Pipeline #74286 passed with stages
in 6 minutes and 36 seconds
From d42ce11fb22ec4de912fceb6b5d518e7fe3bc3e9 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Wed, 12 Jan 2022 15:51:43 +0100
Subject: [PATCH] progress-button: Ellipsize the label
This ensures the buttons don't grow so wide they make the window pop out
of the screen.
---
src/gs-progress-button.ui | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gs-progress-button.ui b/src/gs-progress-button.ui
index daa28d28f..3407c332a 100644
--- a/src/gs-progress-button.ui
+++ b/src/gs-progress-button.ui
@@ -9,6 +9,7 @@
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="label">
+ <property name="ellipsize">end</property>
<property name="label" bind-source="GsProgressButton" bind-property="label" bind-flags="sync-create"/>
<property name="use-underline" bind-source="GsProgressButton" bind-property="use-underline" bind-flags="sync-create"/>
<property name="visible">True</property>
--
2.30.2
From cb01898cabed947e7a0b726b8169a52e660408f1 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Wed, 12 Jan 2022 16:12:02 +0100
Subject: [PATCH] updates-section: Ellipsize the button label
This ensures the button don't grow so wide it makes the window pop out
of the screen.
---
src/gs-updates-section.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/gs-updates-section.c b/src/gs-updates-section.c
index 8a30dcf9b..e8d43432c 100644
--- a/src/gs-updates-section.c
+++ b/src/gs-updates-section.c
@@ -323,6 +323,8 @@ _update_buttons (GsUpdatesSection *self)
if (self->kind == GS_UPDATES_SECTION_KIND_OFFLINE_FIRMWARE ||
self->kind == GS_UPDATES_SECTION_KIND_OFFLINE) {
+ GtkWidget *child;
+
if (_all_offline_updates_downloaded (self))
gtk_stack_set_visible_child_name (GTK_STACK (self->button_stack), "update");
else
@@ -332,12 +334,18 @@ _update_buttons (GsUpdatesSection *self)
/* TRANSLATORS: This is the button for installing all
* offline updates */
gtk_button_set_label (GTK_BUTTON (self->button_update), _("Restart & Update"));
+ child = gtk_bin_get_child (GTK_BIN (self->button_update));
+ gtk_label_set_ellipsize (GTK_LABEL (child), PANGO_ELLIPSIZE_END);
} else if (self->kind == GS_UPDATES_SECTION_KIND_ONLINE) {
+ GtkWidget *child;
+
gtk_stack_set_visible_child_name (GTK_STACK (self->button_stack), "update");
gtk_widget_show (GTK_WIDGET (self->button_stack));
/* TRANSLATORS: This is the button for upgrading all
* online-updatable applications */
gtk_button_set_label (GTK_BUTTON (self->button_update), _("Update All"));
+ child = gtk_bin_get_child (GTK_BIN (self->button_update));
+ gtk_label_set_ellipsize (GTK_LABEL (child), PANGO_ELLIPSIZE_END);
} else {
gtk_widget_hide (GTK_WIDGET (self->button_stack));
}
--
2.30.2
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