[Xfce4-commits] [apps/xfce4-screensaver] 311/425: Fix: idle slider display in all languages

noreply at xfce.org noreply at xfce.org
Mon Oct 15 01:52:38 CEST 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       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 apps/xfce4-screensaver.

commit 92e73b9d3d2fccd6f6c3f3f719f0fbee18a1ed11
Author: ZenWalker <scow at riseup.net>
Date:   Sat Sep 9 20:20:41 2017 +0200

     Fix: idle slider display in all languages
---
 src/mate-screensaver-preferences.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c
index f48a369..7f63430 100644
--- a/src/mate-screensaver-preferences.c
+++ b/src/mate-screensaver-preferences.c
@@ -942,7 +942,7 @@ time_to_string_text (long time)
 	char *secs, *mins, *hours, *string;
 	int   sec, min, hour;
 
-	int   inc_len, len_hour, len_minutes;
+	int   inc_len, len_minutes;
 
 	sec = time % 60;
 	time = time - sec;
@@ -965,9 +965,6 @@ time_to_string_text (long time)
 	                  g_strdup_printf (ngettext ("%d minute",
 	                                             "%d minutes", 59), 59))) - 1;
 
-	len_hour = strlen (g_strdup_printf (ngettext ("%d hour",
-	                                              "%d hours", 1), 1));
-
 	len_minutes = 0;
 
 	for (int n = 2; n < 60; n++)
@@ -990,6 +987,15 @@ time_to_string_text (long time)
 		}
 	}
 
+	if ((strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
+	                                                        "%d minutes", 1), 1), NULL)) - 2) > len_minutes)
+
+		len_minutes = strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
+	                                                                         "%d minutes", 1), 1), NULL)) - 2;
+
+	if (len_minutes < 1)
+		len_minutes = 1;
+
 	if (hour > 0)
 	{
 		if (sec > 0)
@@ -1023,7 +1029,7 @@ time_to_string_text (long time)
 			if (min < 10)
 			{
 				if (min == 1)
-					while (strlen (string) != (2 * len_hour + inc_len - 4))
+					while (strlen (string) != (len_minutes + inc_len + 3))
 					{
 						if (strlen (string) % 2 == 0)
 							string = g_strconcat (string, " ", NULL);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list