[Xfce4-commits] [xfce/xfce4-panel] 01/01: tasklist: Make workaround for int->double less silly
noreply at xfce.org
noreply at xfce.org
Sun Dec 2 23:56:53 CET 2018
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-panel.
commit 6e458db8c06e46dab9dac95e5ef29b88b0ec6efd
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Sun Dec 2 23:56:11 2018 +0100
tasklist: Make workaround for int->double less silly
---
plugins/tasklist/tasklist-widget.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index df9c65f..fbb9f55 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -2203,13 +2203,9 @@ xfce_tasklist_child_new (XfceTasklist *tasklist)
provider = gtk_css_provider_new ();
/* silly workaround for gtkcss only accepting "." as decimal separator and floats returning
with "," as decimal separator in some locales */
- if (tasklist->minimized_icon_lucency < 100
- && tasklist->minimized_icon_lucency > 0)
- css_string = g_strdup_printf ("image { padding: 3px; } image.minimized { opacity: 0.%d; }", tasklist->minimized_icon_lucency / 10);
- else if (tasklist->minimized_icon_lucency == 100)
- css_string = g_strdup_printf ("image { padding: 3px; } image.minimized { opacity: %f; }", 1.0);
- else if (tasklist->minimized_icon_lucency == 0)
- css_string = g_strdup_printf ("image { padding: 3px; } image.minimized { opacity: %f; }", 0.0);
+ css_string = g_strdup_printf ("image { padding: 3px; } image.minimized { opacity: %d.%02d; }",
+ tasklist->minimized_icon_lucency / 100,
+ tasklist->minimized_icon_lucency % 100);
gtk_css_provider_load_from_data (provider, css_string, -1, NULL);
child->icon = gtk_image_new ();
gtk_style_context_add_provider (gtk_widget_get_style_context (child->icon),
@@ -3058,13 +3054,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS
provider = gtk_css_provider_new ();
/* silly workaround for gtkcss only accepting "." as decimal separator and floats returning
with "," as decimal separator in some locales */
- if (tasklist->minimized_icon_lucency < 100
- && tasklist->minimized_icon_lucency > 0)
- css_string = g_strdup_printf ("image.minimized { opacity: 0.%d; }", tasklist->minimized_icon_lucency / 10);
- else if (tasklist->minimized_icon_lucency == 100)
- css_string = g_strdup_printf ("image.minimized { opacity: %f; }", 1.0);
- else if (tasklist->minimized_icon_lucency == 0)
- css_string = g_strdup_printf ("image.minimized { opacity: %f; }", 0.0);
+ css_string = g_strdup_printf ("image { padding: 3px; } image.minimized { opacity: %d.%02d; }",
+ tasklist->minimized_icon_lucency / 100,
+ tasklist->minimized_icon_lucency % 100);
gtk_css_provider_load_from_data (provider, css_string, -1, NULL);
gtk_style_context_add_provider (context_menuitem,
GTK_STYLE_PROVIDER (provider),
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list