diff options
author | Vincent Noel <vnoel@cox.net> | 2005-01-20 16:41:29 +0000 |
---|---|---|
committer | Vincent Noel <vnoel@src.gnome.org> | 2005-01-20 16:41:29 +0000 |
commit | 46ededed08b0b9c516db58bf44a9698bff8da643 (patch) | |
tree | 9d3d987ebb2980294d8eebe7245ca89bd72112b8 | |
parent | 47221dcce222dac942882a59575e272663f24987 (diff) | |
download | metacity-46ededed08b0b9c516db58bf44a9698bff8da643.tar.gz |
Show labels in bold for windows that demand attention. Fixes #164590.
2005-01-20 Vincent Noel <vnoel@cox.net>
* src/screen.c: (meta_screen_ensure_tab_popup),
(meta_screen_ensure_workspace_popup):
* src/tabpopup.c: (meta_ui_tab_popup_new), (display_entry):
* src/tabpopup.h: Show labels in bold for windows that demand
attention. Fixes #164590.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/screen.c | 5 | ||||
-rw-r--r-- | src/tabpopup.c | 23 | ||||
-rw-r--r-- | src/tabpopup.h | 1 |
4 files changed, 29 insertions, 8 deletions
@@ -1,3 +1,11 @@ +2005-01-20 Vincent Noel <vnoel@cox.net> + + * src/screen.c: (meta_screen_ensure_tab_popup), + (meta_screen_ensure_workspace_popup): + * src/tabpopup.c: (meta_ui_tab_popup_new), (display_entry): + * src/tabpopup.h: Show labels in bold for windows that demand + attention. Fixes #164590. + 2005-01-18 Vincent Noel <vnoel@cox.net> * src/screen.c: (meta_screen_ensure_tab_popup), diff --git a/src/screen.c b/src/screen.c index 3ee1f997..793c8153 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1164,6 +1164,7 @@ meta_screen_ensure_tab_popup (MetaScreen *screen, entries[i].icon = window->icon; entries[i].blank = FALSE; entries[i].minimized = window->minimized; + entries[i].demands_attention = window->wm_state_demands_attention; if (!window->minimized || !meta_window_get_icon_geometry (window, &r)) meta_window_get_outer_rect (window, &r); @@ -1256,7 +1257,6 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen) entries[i].title = meta_workspace_get_name (workspace); entries[i].icon = NULL; entries[i].blank = FALSE; - entries[i].minimized = FALSE; g_assert (entries[i].title != NULL); } @@ -1266,8 +1266,9 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen) entries[i].title = NULL; entries[i].icon = NULL; entries[i].blank = TRUE; - entries[i].minimized = FALSE; } + entries[i].minimized = FALSE; + entries[i].demands_attention = FALSE; ++i; } diff --git a/src/tabpopup.c b/src/tabpopup.c index a0fde7e5..da3a3a18 100644 --- a/src/tabpopup.c +++ b/src/tabpopup.c @@ -221,17 +221,28 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, te->title = NULL; if (entries[i].title) { + gchar *tmp; if (entries[i].minimized) { - gchar *tmp; tmp = g_strdup_printf ("[%s]", entries[i].title); - te->title = utf8_strndup (tmp, max_chars_per_title); - g_free (tmp); } else { - te->title = utf8_strndup (entries[i].title, max_chars_per_title); + tmp = g_strdup (entries[i].title); + } + + if (entries[i].demands_attention) + { + gchar *escaped, *markup; + escaped = g_markup_escape_text (tmp, -1); + markup = g_strdup_printf ("<b>%s</b>", escaped); + g_free (escaped); + g_free (tmp); + tmp = markup; } + + te->title = utf8_strndup (tmp, max_chars_per_title); + g_free (tmp); } te->widget = NULL; te->icon = entries[i].icon; @@ -347,7 +358,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, 0, 0); /* Efficiency rules! */ - gtk_label_set_text (GTK_LABEL (popup->label), + gtk_label_set_markup (GTK_LABEL (popup->label), te->title); gtk_widget_size_request (popup->label, &req); max_label_width = MAX (max_label_width, req.width); @@ -441,7 +452,7 @@ display_entry (MetaTabPopup *popup, unselect_workspace (popup->current_selected_entry->widget); } - gtk_label_set_text (GTK_LABEL (popup->label), te->title); + gtk_label_set_markup (GTK_LABEL (popup->label), te->title); if (popup->outline) select_image (te->widget); diff --git a/src/tabpopup.h b/src/tabpopup.h index fe6a3ed3..c220003c 100644 --- a/src/tabpopup.h +++ b/src/tabpopup.h @@ -41,6 +41,7 @@ struct _MetaTabEntry int inner_x, inner_y, inner_width, inner_height; guint blank : 1; guint minimized : 1; + guint demands_attention : 1; }; MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries, |