mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
Truncate the string to max_char_per_title before adding bold tags and fix
2007-10-27 Alex R.M. Turner <armtuk@gmail.com> * src/tabpopup.c (tab_entry_new): Truncate the string to max_char_per_title before adding bold tags and fix general flow of function. svn path=/trunk/; revision=3363
This commit is contained in:
parent
908715bd84
commit
1bf37776c3
@ -1,3 +1,9 @@
|
|||||||
|
2007-10-27 Alex R.M. Turner <armtuk@gmail.com>
|
||||||
|
|
||||||
|
* src/tabpopup.c (tab_entry_new): Truncate the string to
|
||||||
|
max_char_per_title before adding bold tags and fix general flow of
|
||||||
|
function.
|
||||||
|
|
||||||
2007-10-16 Thomas Thurman <thomas@thurman.org.uk>
|
2007-10-16 Thomas Thurman <thomas@thurman.org.uk>
|
||||||
|
|
||||||
* src/window.c (window_would_be_covered): new function.
|
* src/window.c (window_would_be_covered): new function.
|
||||||
|
@ -156,31 +156,34 @@ tab_entry_new (const MetaTabEntry *entry,
|
|||||||
te->title = NULL;
|
te->title = NULL;
|
||||||
if (entry->title)
|
if (entry->title)
|
||||||
{
|
{
|
||||||
|
gchar *str;
|
||||||
gchar *tmp;
|
gchar *tmp;
|
||||||
|
gchar *formatter = "%s";
|
||||||
|
|
||||||
|
str = meta_g_utf8_strndup (entry->title, max_chars_per_title);
|
||||||
|
|
||||||
if (entry->hidden)
|
if (entry->hidden)
|
||||||
{
|
{
|
||||||
tmp = g_markup_printf_escaped ("[%s]", entry->title);
|
formatter = "[%s]";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
tmp = g_markup_printf_escaped (formatter, str);
|
||||||
tmp = g_markup_printf_escaped ("%s", entry->title);
|
g_free (str);
|
||||||
}
|
str = tmp;
|
||||||
|
|
||||||
if (entry->demands_attention)
|
if (entry->demands_attention)
|
||||||
{
|
{
|
||||||
/* Escape the whole line of text then markup the text and
|
/* Escape the whole line of text then markup the text and
|
||||||
* copy it back into the original buffer.
|
* copy it back into the original buffer.
|
||||||
*/
|
*/
|
||||||
gchar *markup, *escaped;
|
tmp = g_strdup_printf ("<b>%s</b>", str);
|
||||||
escaped = g_markup_escape_text (tmp, -1);
|
g_free (str);
|
||||||
markup = g_strdup_printf ("<b>%s</b>", escaped);
|
str = tmp;
|
||||||
g_free (escaped);
|
|
||||||
g_free (tmp);
|
|
||||||
tmp = markup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
te->title = meta_g_utf8_strndup (tmp, max_chars_per_title);
|
te->title=g_strdup(str);
|
||||||
g_free (tmp);
|
|
||||||
|
g_free (str);
|
||||||
}
|
}
|
||||||
te->widget = NULL;
|
te->widget = NULL;
|
||||||
te->icon = entry->icon;
|
te->icon = entry->icon;
|
||||||
|
Loading…
Reference in New Issue
Block a user