From bb67df716cfab257a6309df121e6399ddadcc78a Mon Sep 17 00:00:00 2001
From: Přemysl Eric Janouch
Date: Thu, 6 Jan 2022 08:15:26 +0100
Subject: Mildly improve Ubuntu 20.04 compatibility
---
fiv-sidebar.c | 15 +++-
fiv-thumbnail.c | 1 +
fiv.c | 5 +-
meson.build | 6 +-
resources/info-symbolic.svg | 150 ++++++++++++++++++++++++++++++++++++++
resources/resources.gresource.xml | 1 +
6 files changed, 172 insertions(+), 6 deletions(-)
create mode 100644 resources/info-symbolic.svg
diff --git a/fiv-sidebar.c b/fiv-sidebar.c
index c29ef4d..e956d08 100644
--- a/fiv-sidebar.c
+++ b/fiv-sidebar.c
@@ -244,10 +244,21 @@ resolve_location(FivSidebar *self, const char *text)
// Relative paths produce invalid GFile objects with this function.
// And even if they didn't, we have our own root for them.
GFile *file = g_file_parse_name(text);
- if (g_uri_is_valid(text, G_URI_FLAGS_PARSE_RELAXED, NULL) ||
- g_file_peek_path(file))
+ if (g_file_peek_path(file))
return file;
+ // Neither branch looks like a particularly good solution.
+ // Though in general, false positives are preferred over negatives.
+#if GLIB_CHECK_VERSION(2, 66, 0)
+ if (g_uri_is_valid(text, G_URI_FLAGS_PARSE_RELAXED, NULL))
+ return file;
+#else
+ gchar *scheme = g_uri_parse_scheme(text);
+ g_free(scheme);
+ if (scheme)
+ return file;
+#endif
+
GFile *absolute = g_file_get_child_for_display_name(
fiv_io_model_get_location(self->model), text, NULL);
if (!absolute)
diff --git a/fiv-thumbnail.c b/fiv-thumbnail.c
index 076a917..bd7e6e9 100644
--- a/fiv-thumbnail.c
+++ b/fiv-thumbnail.c
@@ -22,6 +22,7 @@
#include
#include
+#include
#include
#include
diff --git a/fiv.c b/fiv.c
index 3715907..cdebf6a 100644
--- a/fiv.c
+++ b/fiv.c
@@ -944,8 +944,9 @@ on_button_press_browser_paned(
static GtkWidget *
make_toolbar_button(const gchar *symbolic, const gchar *tooltip)
{
- GtkWidget *button =
- gtk_button_new_from_icon_name(symbolic, GTK_ICON_SIZE_BUTTON);
+ GtkWidget *button = gtk_button_new();
+ gtk_button_set_image(GTK_BUTTON(button),
+ gtk_image_new_from_icon_name(symbolic, GTK_ICON_SIZE_BUTTON));
gtk_widget_set_tooltip_text(button, tooltip);
gtk_widget_set_focus_on_click(button, FALSE);
gtk_style_context_add_class(
diff --git a/meson.build b/meson.build
index d862493..7b0762c 100644
--- a/meson.build
+++ b/meson.build
@@ -30,11 +30,13 @@ dependencies = [
dependency('libjpeg', required : get_option('jpeg-qs')),
dependency('libwebp'),
dependency('libwebpdemux'),
- dependency('libwebpdecoder'),
+ dependency('libwebpdecoder', required : false),
dependency('libwebpmux'),
# https://github.com/google/wuffs/issues/58
dependency('spng', version : '>=0.7.0',
- default_options: 'default_library=static'),
+ default_options: 'default_library=static',
+ # fallback : ['spng', 'spng_dep'],
+ ),
lcms2,
libraw,
diff --git a/resources/info-symbolic.svg b/resources/info-symbolic.svg
new file mode 100644
index 0000000..502a98a
--- /dev/null
+++ b/resources/info-symbolic.svg
@@ -0,0 +1,150 @@
+
+
diff --git a/resources/resources.gresource.xml b/resources/resources.gresource.xml
index 45439b6..b189ced 100644
--- a/resources/resources.gresource.xml
+++ b/resources/resources.gresource.xml
@@ -6,5 +6,6 @@
blend-tool-symbolic.svg
checkerboard-symbolic.svg
heal-symbolic.svg
+ info-symbolic.svg
--
cgit v1.2.3-70-g09d2