5518
|
1 |
--- eel-2.10.1/eel/eel-string.c 2002-03-19 03:05:08.000000000 +0530
|
|
2 |
+++ eel-2.10.1-new/eel/eel-string.c 2005-05-13 15:09:48.219632000 +0530
|
11725
|
3 |
@@ -29,6 +29,8 @@
|
4737
|
4 |
#include <locale.h>
|
|
5 |
#include <stdlib.h>
|
11725
|
6 |
#include <string.h>
|
4737
|
7 |
+#include <ctype.h>
|
|
8 |
+#include <glib.h>
|
|
9 |
|
|
10 |
#if !defined (EEL_OMIT_SELF_CHECK)
|
|
11 |
#include "eel-lib-self-check-functions.h"
|
11349
|
12 |
@@ -326,9 +326,10 @@
|
|
13 |
guint truncate_length)
|
4737
|
14 |
{
|
|
15 |
char *truncated;
|
|
16 |
- guint length;
|
|
17 |
+ guint length, i;
|
|
18 |
guint num_left_chars;
|
|
19 |
guint num_right_chars;
|
|
20 |
+ gboolean is_ascii = TRUE, valid_utf8 = TRUE;
|
|
21 |
|
|
22 |
const char delimter[] = "...";
|
|
23 |
const guint delimter_length = strlen (delimter);
|
11349
|
24 |
@@ -353,10 +354,41 @@
|
4737
|
25 |
return g_strdup (string);
|
|
26 |
}
|
11349
|
27 |
|
4737
|
28 |
+ for (i=0; i<length; i++) {
|
|
29 |
+ if (!isascii (string[i])) {
|
|
30 |
+ is_ascii = FALSE;
|
|
31 |
+ break;
|
|
32 |
+ }
|
|
33 |
+ }
|
5518
|
34 |
+
|
4737
|
35 |
+ if (!is_ascii && g_utf8_validate (string, -1, NULL)) {
|
|
36 |
+ valid_utf8 = TRUE;
|
|
37 |
+ }
|
11349
|
38 |
+
|
4737
|
39 |
/* Find the 'middle' where the truncation will occur. */
|
|
40 |
num_left_chars = (truncate_length - delimter_length) / 2;
|
|
41 |
+
|
|
42 |
+ if (valid_utf8 && !g_utf8_validate (string + num_left_chars, -1, NULL)) {
|
11349
|
43 |
+ gchar *tc;
|
|
44 |
+ tc = g_utf8_find_next_char (string + num_left_chars, NULL);
|
4737
|
45 |
+ if (tc) {
|
|
46 |
+ num_left_chars = (gint) (tc - string);
|
|
47 |
+ }
|
|
48 |
+ }
|
11349
|
49 |
+
|
|
50 |
num_right_chars = truncate_length - num_left_chars - delimter_length;
|
4737
|
51 |
|
11349
|
52 |
+ if (valid_utf8 && !g_utf8_validate (string + length - num_right_chars +1, -1, NULL)) {
|
4737
|
53 |
+ gchar *tc;
|
|
54 |
+ tc = g_utf8_find_prev_char (string, string + length - num_right_chars + 1);
|
|
55 |
+ if (tc) {
|
|
56 |
+ num_right_chars = strlen (tc) + 1;
|
|
57 |
+ }
|
|
58 |
+ }
|
|
59 |
+
|
|
60 |
+ if (valid_utf8)
|
|
61 |
+ truncate_length = num_left_chars + num_right_chars + delimter_length;
|
|
62 |
+
|
11349
|
63 |
truncated = g_new (char, strlen (string) + 1);
|
4737
|
64 |
|
11349
|
65 |
g_utf8_strncpy (truncated, string, num_left_chars);
|
17516
|
66 |
diff -ruN eel-2.26.0.orig/eel/eel-background.c eel-2.26.0/eel/eel-background.c
|
|
67 |
--- eel-2.26.0.orig/eel/eel-background.c 2010-02-01 21:50:54.619020341 +0000
|
|
68 |
+++ eel-2.26.0/eel/eel-background.c 2010-02-01 21:51:12.253255236 +0000
|
|
69 |
@@ -1000,7 +1000,7 @@
|
|
70 |
gboolean
|
|
71 |
eel_background_is_dark (EelBackground *background)
|
|
72 |
{
|
|
73 |
- return gnome_bg_is_dark (background->details->bg);
|
|
74 |
+ return gnome_bg_is_dark (background->details->bg, NULL, NULL);
|
|
75 |
}
|
|
76 |
|
|
77 |
/* handle dropped colors */
|
|
78 |
diff -ruN eel-2.26.0.orig/eel/eel-background.c eel-2.26.0/eel/eel-background.c
|
|
79 |
--- eel-2.26.0.orig/eel/eel-background.c 2010-02-01 22:50:43.603262566 +0000
|
|
80 |
+++ eel-2.26.0/eel/eel-background.c 2010-02-01 22:51:24.969133823 +0000
|
|
81 |
@@ -368,7 +368,7 @@
|
|
82 |
|
|
83 |
set_image_properties (background);
|
|
84 |
|
|
85 |
- background->details->background_changes_with_size = gnome_bg_changes_with_size (background->details->bg);
|
|
86 |
+ //background->details->background_changes_with_size = gnome_bg_changes_with_size (background->details->bg);
|
|
87 |
background->details->background_pixmap = gnome_bg_create_pixmap (background->details->bg,
|
|
88 |
window,
|
|
89 |
entire_width, entire_height,
|
|
90 |
@@ -746,8 +746,8 @@
|
|
91 |
}
|
|
92 |
}
|
|
93 |
|
|
94 |
- background->details->background_changes_with_size =
|
|
95 |
- gnome_bg_changes_with_size (background->details->bg);
|
|
96 |
+ //background->details->background_changes_with_size =
|
|
97 |
+ // gnome_bg_changes_with_size (background->details->bg);
|
|
98 |
|
|
99 |
if (background->details->is_desktop && !in_fade) {
|
|
100 |
set_root_pixmap (background, window);
|