Revert "Add Add-fallbacks-for-GtkSwitch-state-labels.patch:"

This reverts commit e2a33c8676.

This will be included in gtk 3.24.4
This commit is contained in:
Jeremy Bicha
2019-01-21 11:20:51 -05:00
parent e2a33c8676
commit cb239a5ae5
2 changed files with 0 additions and 69 deletions

View File

@ -1,68 +0,0 @@
From: Emmanuele Bassi <ebassi@gnome.org>
Date: Tue, 15 Jan 2019 15:22:09 +0000
Subject: Add fallbacks for GtkSwitch state labels
While the IEC power symbols have been part of Unicode since version 9.0,
released in 2016, not every font supports them.
We can use the old symbols as a fallback, as they seem to have the
better coverage, if not the best appearance.
---
gtk/gtkswitch.c | 41 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index bf63f34..1d42f57 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -298,11 +298,48 @@ gtk_switch_create_pango_layouts (GtkSwitch *self)
{
GtkSwitchPrivate *priv = self->priv;
+ /* Glyphs for the ON state, in descending order of preference */
+ const char *on_glyphs[] = {
+ "", /* U+23FD POWER ON SYMBOL */
+ "❙", /* U+2759 MEDIUM VERTICAL BAR */
+ };
+
+ /* Glyphs for the OFF state, in descending order of preference */
+ const char *off_glyphs[] = {
+ "⭘", /* U+2B58 HEAVY CIRCLE */
+ "○", /* U+25CB WHITE CIRCLE */
+ };
+ int i;
+
g_clear_object (&priv->on_layout);
- priv->on_layout = gtk_widget_create_pango_layout (GTK_WIDGET (self), "");
+
+ for (i = 0; i < G_N_ELEMENTS (on_glyphs); i++)
+ {
+ PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (self), on_glyphs[i]);
+
+ if (pango_layout_get_unknown_glyphs_count (layout) == 0)
+ {
+ priv->on_layout = layout;
+ break;
+ }
+
+ g_object_unref (layout);
+ }
g_clear_object (&priv->off_layout);
- priv->off_layout = gtk_widget_create_pango_layout (GTK_WIDGET (self), "⭘");
+
+ for (i = 0; i < G_N_ELEMENTS (off_glyphs); i++)
+ {
+ PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (self), off_glyphs[i]);
+
+ if (pango_layout_get_unknown_glyphs_count (layout) == 0)
+ {
+ priv->off_layout = layout;
+ break;
+ }
+
+ g_object_unref (layout);
+ }
}
static void

View File

@ -7,4 +7,3 @@ reftest-known-fail.patch
Don-t-test-default-constructed-GdkPixbuf-properties.patch Don-t-test-default-constructed-GdkPixbuf-properties.patch
Revert-Update-some-a11y-test-results.patch Revert-Update-some-a11y-test-results.patch
Revert-Update-a11y-test-output.patch Revert-Update-a11y-test-output.patch
Add-fallbacks-for-GtkSwitch-state-labels.patch