Commit 6b6b84b3 authored by Adrien Plazas's avatar Adrien Plazas
Browse files

Patches

parent 1f1fd56c
From e404b1345bee576badf45e0121f1ab0d7f9487f9 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Tue, 3 Sep 2019 13:27:22 +0200
Subject: [PATCH 01/46] meson: Add dependency on libhandy 1.0.0
---
meson.build | 1 +
src/gs-application.c | 6 ++++++
src/meson.build | 1 +
3 files changed, 8 insertions(+)
diff --git a/meson.build b/meson.build
index 209e9705d..542089380 100644
--- a/meson.build
+++ b/meson.build
@@ -106,6 +106,7 @@ gmodule = dependency('gmodule-2.0')
goa = dependency('goa-1.0')
gtk = dependency('gtk+-3.0', version : '>= 3.22.4')
glib = dependency('glib-2.0', version : '>= 2.55.0')
+libhandy = dependency('libhandy-1', version: '>= 1.0.0')
json_glib = dependency('json-glib-1.0', version : '>= 1.2.0')
libm = cc.find_library('m', required: false)
libsoup = dependency('libsoup-2.4', version : '>= 2.52.0')
diff --git a/src/gs-application.c b/src/gs-application.c
index 9c2676ef3..715ee87a9 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -16,6 +16,7 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gio/gdesktopappinfo.h>
+#include <handy.h>
#include <libsoup/soup.h>
#ifdef GDK_WINDOWING_X11
@@ -945,6 +946,8 @@ gs_application_startup (GApplication *application)
GsApplication *app = GS_APPLICATION (application);
G_APPLICATION_CLASS (gs_application_parent_class)->startup (application);
+ hdy_init ();
+
gs_application_add_wrapper_actions (application);
g_action_map_add_action_entries (G_ACTION_MAP (application),
@@ -969,6 +972,9 @@ gs_application_startup (GApplication *application)
gs_folders_convert ();
gs_application_update_software_sources_presence (application);
+
+ gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (),
+ "/org/gnome/Software/icons/hicolor");
}
static void
diff --git a/src/meson.build b/src/meson.build
index 6581e77cb..bab9585cf 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -77,6 +77,7 @@ gnome_software_dependencies = [
gmodule,
goa,
gtk,
+ libhandy,
json_glib,
libm,
libsoup,
--
2.30.2
From 07ae06d0a77e5d38bfe6234181c924d23ee23611 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Tue, 3 Sep 2019 13:28:38 +0200
Subject: [PATCH 02/46] shell: Make the search bar adaptive
---
src/gnome-software.ui | 19 ++++++++++++-------
src/gs-shell.c | 21 +++++++++++++--------
2 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index 0811b6116..9606d91eb 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -317,17 +317,22 @@
</object>
</child>
<child>
- <object class="GtkSearchBar" id="search_bar">
+ <object class="HdySearchBar" id="search_bar">
<property name="visible">True</property>
<child>
- <object class="GtkSearchEntry" id="entry_search">
+ <object class="HdyClamp">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="activates_default">True</property>
- <property name="width_request">500</property>
- <property name="max_length">100</property>
+ <property name="tightening_threshold">300</property>
+ <property name="maximum_size">400</property>
<property name="hexpand">True</property>
- <property name="halign">center</property>
+ <child>
+ <object class="GtkSearchEntry" id="entry_search">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="activates_default">True</property>
+ <property name="max_length">100</property>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 8f0dc6f12..922d93bc9 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -12,6 +12,8 @@
#include <string.h>
#include <glib/gi18n.h>
+#define HANDY_USE_UNSTABLE_API
+#include <handy.h>
#ifdef HAVE_MOGWAI
#include <libmogwai-schedule-client/scheduler.h>
@@ -444,7 +446,7 @@ gs_shell_change_mode (GsShell *shell,
mode == GS_SHELL_MODE_SEARCH);
/* hide unless we're going to search */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
- gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (widget),
+ hdy_search_bar_set_search_mode (HDY_SEARCH_BAR (widget),
mode == GS_SHELL_MODE_SEARCH);
priv->in_mode_change = FALSE;
@@ -816,13 +818,13 @@ window_keypress_handler (GtkWidget *window, GdkEvent *event, GsShell *shell)
if ((e->state & GDK_CONTROL_MASK) > 0 &&
e->keyval == GDK_KEY_f) {
w = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
- if (!gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (w))) {
- gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (w), TRUE);
+ if (!hdy_search_bar_get_search_mode (HDY_SEARCH_BAR (w))) {
+ hdy_search_bar_set_search_mode (HDY_SEARCH_BAR (w), TRUE);
w = GTK_WIDGET (gtk_builder_get_object (priv->builder,
"entry_search"));
gtk_widget_grab_focus (w);
} else {
- gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (w), FALSE);
+ hdy_search_bar_set_search_mode (HDY_SEARCH_BAR (w), FALSE);
}
return GDK_EVENT_STOP;
}
@@ -830,7 +832,7 @@ window_keypress_handler (GtkWidget *window, GdkEvent *event, GsShell *shell)
/* pass to search bar */
w = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
- return gtk_search_bar_handle_event (GTK_SEARCH_BAR (w), event);
+ return hdy_search_bar_handle_event (HDY_SEARCH_BAR (w), event);
}
static void
@@ -860,7 +862,7 @@ search_button_clicked_cb (GtkToggleButton *toggle_button, GsShell *shell)
GtkWidget *search_bar;
search_bar = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
- gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (search_bar),
+ hdy_search_bar_set_search_mode (HDY_SEARCH_BAR (search_bar),
gtk_toggle_button_get_active (toggle_button));
if (priv->in_mode_change)
@@ -873,14 +875,14 @@ search_button_clicked_cb (GtkToggleButton *toggle_button, GsShell *shell)
}
static void
-search_mode_enabled_cb (GtkSearchBar *search_bar, GParamSpec *pspec, GsShell *shell)
+search_mode_enabled_cb (HdySearchBar *search_bar, GParamSpec *pspec, GsShell *shell)
{
GsShellPrivate *priv = gs_shell_get_instance_private (shell);
GtkWidget *search_button;
search_button = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_button"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (search_button),
- gtk_search_bar_get_search_mode (search_bar));
+ hdy_search_bar_get_search_mode (search_bar));
}
static gboolean
@@ -2183,6 +2185,9 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
g_signal_connect_after (priv->main_window, "button_press_event",
G_CALLBACK (window_button_press_event), shell);
+ /* connect the search entry to the serch bar */
+ hdy_search_bar_connect_entry (HDY_SEARCH_BAR (gtk_builder_get_object (priv->builder, "search_bar")),
+ GTK_ENTRY (gtk_builder_get_object (priv->builder, "entry_search")));
/* show the search bar when clicking on the search button */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_button"));
g_signal_connect (widget, "clicked",
--
2.30.2
From 33508c0a1d7fb10adf0f572ee04f157f33f232d3 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Tue, 3 Sep 2019 15:40:38 +0200
Subject: [PATCH 03/46] shell: Give a title and an icon to the main stack pages
---
src/gnome-software.gresource.xml | 3 +++
src/gnome-software.ui | 6 ++++++
src/navigate-symbolic.svg | 7 +++++++
3 files changed, 16 insertions(+)
create mode 100644 src/navigate-symbolic.svg
diff --git a/src/gnome-software.gresource.xml b/src/gnome-software.gresource.xml
index 459ecf821..2168c247e 100644
--- a/src/gnome-software.gresource.xml
+++ b/src/gnome-software.gresource.xml
@@ -39,4 +39,7 @@
<file>gtk-style.css</file>
<file>gtk-style-hc.css</file>
</gresource>
+ <gresource prefix="/org/gnome/Software/icons/hicolor/scalable/status">
+ <file preprocess="xml-stripblanks">navigate-symbolic.svg</file>
+ </gresource>
</gresources>
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index 9606d91eb..822582f8d 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -503,6 +503,8 @@
</object>
<packing>
<property name="name">overview</property>
+ <property name="title" translatable="yes" comments="Translators: A label for a button to show all available software.">Explore</property>
+ <property name="icon-name">navigate-symbolic</property>
</packing>
</child>
<child>
@@ -511,6 +513,8 @@
</object>
<packing>
<property name="name">installed</property>
+ <property name="title" translatable="yes" comments="Translators: A label for a button to show only software which is already installed.">Installed</property>
+ <property name="icon-name">software-installed-symbolic</property>
</packing>
</child>
<child>
@@ -543,6 +547,8 @@
</object>
<packing>
<property name="name">updates</property>
+ <property name="title" translatable="yes" comments="Translators: A label for a button to show only updates which are available to install.">Updates</property>
+ <property name="icon-name">software-update-available-symbolic</property>
</packing>
</child>
diff --git a/src/navigate-symbolic.svg b/src/navigate-symbolic.svg
new file mode 100644
index 000000000..5b264cd3e
--- /dev/null
+++ b/src/navigate-symbolic.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
+ <g fill="#2e3436">
+ <path d="M8.017 1.054c-3.82 0-6.941 3.12-6.941 6.941 0 3.822 3.12 6.942 6.941 6.942 3.822 0 6.942-3.12 6.942-6.942 0-3.82-3.12-6.941-6.942-6.941zm0 1.98a4.944 4.944 0 014.961 4.961 4.944 4.944 0 01-4.96 4.961 4.944 4.944 0 01-4.961-4.96 4.944 4.944 0 014.96-4.961z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;isolation:auto;mix-blend-mode:normal;solid-color:#000;solid-opacity:1;marker:none" color="#000" font-weight="400" font-family="sans-serif" overflow="visible"/>
+ <path d="M5.756 11.655L9.52 8.992l.759-4.656L6.515 7zm2.577-2.79a.956.956 0 01-1.25-.512.956.956 0 01.51-1.251.956.956 0 011.253.512.956.956 0 01-.513 1.25z" style="marker:none" opacity=".35"/>
+ <path d="M9.51 8.998l.01-.006.76-4.655-3.755 2.656.656.44a.956.956 0 01.413-.332.956.956 0 011.251.514.956.956 0 01-.078.884z" style="marker:none"/>
+ </g>
+</svg>
--
2.30.2
From 5bf65a2f6bb4b4afb329c666650a9035b7bc3c1f Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Tue, 3 Sep 2019 15:41:26 +0200
Subject: [PATCH 04/46] updates-page: Notify the stack when it needs attention
---
src/gs-updates-page.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index ee2544890..09bea9cf4 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -296,6 +296,11 @@ refresh_headerbar_updates_counter (GsUpdatesPage *self)
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "needs-attention");
else
gtk_style_context_remove_class (gtk_widget_get_style_context (widget), "needs-attention");
+
+ widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "stack_main"));
+ gtk_container_child_set (GTK_CONTAINER (widget), GTK_WIDGET (self),
+ "needs-attention", num_updates > 0,
+ NULL);
}
static void
--
2.30.2
From b89b00001a41042c413373c16a1518a82f1ff241 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Wed, 4 Sep 2019 21:15:57 +0200
Subject: [PATCH 05/46] loading-page: Make it adaptive
Make it work well on desktops and phones alike.
---
src/gs-loading-page.ui | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/gs-loading-page.ui b/src/gs-loading-page.ui
index 7120e5c59..c1fb3bc5c 100644
--- a/src/gs-loading-page.ui
+++ b/src/gs-loading-page.ui
@@ -18,6 +18,13 @@
<class name="dim-label"/>
</style>
<child type="center">
+ <object class="HdyClamp">
+ <property name="visible">True</property>
+ <property name="margin_start">12</property>
+ <property name="margin_end">12</property>
+ <property name="tightening_threshold">336</property>
+ <property name="maximum_size">480</property>
+ <child>
<object class="GtkBox" id="centerbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
@@ -32,8 +39,6 @@
<child>
<object class="GtkProgressBar" id="progressbar">
<property name="visible">True</property>
- <property name="width_request">480</property>
- <property name="halign">center</property>
<property name="fraction">0.0</property>
<property name="margin_top">8</property>
<style>
@@ -44,7 +49,10 @@
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
+ <property name="justify">center</property>
<property name="label" translatable="yes">Starting up…</property>
+ <property name="wrap">True</property>
+ <property name="wrap-mode">word-char</property>
<attributes>
<attribute name="scale" value="1.4"/>
</attributes>
@@ -52,6 +60,8 @@
</child>
</object>
</child>
+ </object>
+ </child>
</object>
</child>
</template>
--
2.30.2
From 35c060f583f3a12b578c9793635fbb0480234179 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Wed, 4 Sep 2019 21:16:58 +0200
Subject: [PATCH 06/46] shell: Set a minimum size
This prevents the window from being stupidly small.
---
src/gnome-software.ui | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index 822582f8d..7dede5ba0 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -51,6 +51,8 @@
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
+ <property name="width-request">360</property>
+ <property name="height-request">200</property>
<child>
<object class="GtkHeaderBar" id="header">
<property name="visible">True</property>
--
2.30.2
From e20370127a84c8d4d9aea71c3af2945b403ed32a Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Thu, 5 Sep 2019 07:46:39 +0200
Subject: [PATCH 07/46] details-page: Make it better fit in smaller narrower
windows
This makes the header work in both desktops and mobiles.
---
src/gs-details-page.ui | 47 ++++++++++++++++++++++++------------------
1 file changed, 27 insertions(+), 20 deletions(-)
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index f86674fea..ef376f622 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -86,46 +86,33 @@
<property name="halign">fill</property>
<property name="valign">start</property>
<property name="margin_start">24</property>
- <property name="margin_end">24</property>
<child>
- <object class="GtkLabel" id="application_details_title">
+ <object class="GtkBox" id="box_details_header3">
<property name="visible">True</property>
<property name="halign">fill</property>
<property name="valign">start</property>
- <property name="hexpand">True</property>
- <property name="margin_bottom">4</property>
- <property name="xalign">0</property>
- <property name="selectable">True</property>
- <property name="wrap">True</property>
- <property name="max_width_chars">20</property>
- <style>
- <class name="application-details-title"/>
- </style>
- </object>
- </child>
+ <property name="spacing">24</property>
<child>
- <object class="GtkLabel" id="application_details_summary">
+ <object class="GtkLabel" id="application_details_title">
<property name="visible">True</property>
<property name="halign">fill</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
- <property name="margin_bottom">16</property>
+ <property name="margin_bottom">4</property>
<property name="xalign">0</property>
<property name="selectable">True</property>
<property name="wrap">True</property>
- <property name="max-width-chars">60</property>
+ <property name="max_width_chars">20</property>
<style>
- <class name="application-details-summary"/>
+ <class name="application-details-title"/>
</style>
</object>
</child>
- </object>
- </child>
<child>
<object class="GtkBox" id="star_box">
<property name="visible">True</property>
- <property name="valign">start</property>
+ <property name="valign">center</property>
<child>
<object class="GtkEventBox" id="star_eventbox">
<property name="visible">True</property>
@@ -152,6 +139,26 @@
</object>
</child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="application_details_summary">
+ <property name="visible">True</property>
+ <property name="halign">fill</property>
+ <property name="valign">start</property>
+ <property name="hexpand">True</property>
+ <property name="margin_bottom">16</property>
+ <property name="xalign">0</property>
+ <property name="selectable">True</property>
+ <property name="wrap">True</property>
+ <property name="max-width-chars">60</property>
+ <style>
+ <class name="application-details-summary"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
--
2.30.2
From fa2f669a3df0c2cfcdff25285976f8d03665ca03 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 9 Sep 2019 17:10:51 +0200
Subject: [PATCH 08/46] librem5: details-page: Port to phones
---
src/gs-details-page.ui | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index ef376f622..0fc8eca92 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -54,7 +54,6 @@
<property name="preferred-width">860</property>
<child>
<object class="GtkBox" id="box_details">
- <property name="width_request">752</property>
<property name="orientation">vertical</property>
<property name="visible">True</property>
<property name="halign">fill</property>
@@ -244,7 +243,6 @@
<property name="fraction">0.5</property>
<property name="valign">center</property>
<property name="vexpand">True</property>
- <property name="width_request">624</property>
<style>
<class name="upgrade-progressbar"/>
</style>
@@ -461,6 +459,7 @@
<object class="GtkBox" id="box_details_details">
<property name="visible">True</property>
<property name="margin_bottom">26</property>
+ <property name="orientation">vertical</property>
<property name="spacing">30</property>
<child>
<object class="GtkGrid" id="grid_details_kudo">
--
2.30.2
From 91403fb937f28c267ea12a9984ee8c8643b748c9 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Tue, 3 Sep 2019 15:42:25 +0200
Subject: [PATCH 09/46] librem5: Drop the custom .needs-attention style class
This conflicts with the one from the view switcher.
---
src/gtk-style-hc.css | 6 ------
src/gtk-style.css | 6 ------
2 files changed, 12 deletions(-)
diff --git a/src/gtk-style-hc.css b/src/gtk-style-hc.css
index 1006649e0..6263c0bd0 100644
--- a/src/gtk-style-hc.css
+++ b/src/gtk-style-hc.css
@@ -22,12 +22,6 @@
font-size: 125%;
}
-.needs-attention {
- background-image: none;
- background-color: shade(@theme_selected_bg_color, 1.1);
- border-radius: 1px;
-}
-
.screenshot-image, .screenshot-image-thumb {
background-image: none;
background-color: shade(@theme_bg_color, 0.9);
diff --git a/src/gtk-style.css b/src/gtk-style.css
index 4b5fcef75..136e0e81c 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -38,12 +38,6 @@
font-size: x-small;
}
-.needs-attention {
- background-image: none;
- background-color: shade(@theme_selected_bg_color, 1.1);
- border-radius: 1px;
-}
-
.toolbar-primary-buttons-software {
padding-left: 26px;
padding-right: 26px;
--
2.30.2
From 4d5b9fec17c393c07744f01c18bbc5ea3756673f Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Wed, 4 Sep 2019 08:12:53 +0200