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.
This commit is contained in:
Vincent Noel 2005-01-20 16:41:29 +00:00 committed by Vincent Noel
parent 47221dcce2
commit 46ededed08
4 changed files with 29 additions and 8 deletions

View File

@ -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> 2005-01-18 Vincent Noel <vnoel@cox.net>
* src/screen.c: (meta_screen_ensure_tab_popup), * src/screen.c: (meta_screen_ensure_tab_popup),

View File

@ -1164,6 +1164,7 @@ meta_screen_ensure_tab_popup (MetaScreen *screen,
entries[i].icon = window->icon; entries[i].icon = window->icon;
entries[i].blank = FALSE; entries[i].blank = FALSE;
entries[i].minimized = window->minimized; entries[i].minimized = window->minimized;
entries[i].demands_attention = window->wm_state_demands_attention;
if (!window->minimized || !meta_window_get_icon_geometry (window, &r)) if (!window->minimized || !meta_window_get_icon_geometry (window, &r))
meta_window_get_outer_rect (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].title = meta_workspace_get_name (workspace);
entries[i].icon = NULL; entries[i].icon = NULL;
entries[i].blank = FALSE; entries[i].blank = FALSE;
entries[i].minimized = FALSE;
g_assert (entries[i].title != NULL); g_assert (entries[i].title != NULL);
} }
@ -1266,8 +1266,9 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen)
entries[i].title = NULL; entries[i].title = NULL;
entries[i].icon = NULL; entries[i].icon = NULL;
entries[i].blank = TRUE; entries[i].blank = TRUE;
entries[i].minimized = FALSE;
} }
entries[i].minimized = FALSE;
entries[i].demands_attention = FALSE;
++i; ++i;
} }

View File

@ -221,17 +221,28 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
te->title = NULL; te->title = NULL;
if (entries[i].title) if (entries[i].title)
{ {
gchar *tmp;
if (entries[i].minimized) if (entries[i].minimized)
{ {
gchar *tmp;
tmp = g_strdup_printf ("[%s]", entries[i].title); tmp = g_strdup_printf ("[%s]", entries[i].title);
te->title = utf8_strndup (tmp, max_chars_per_title);
g_free (tmp);
} }
else 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->widget = NULL;
te->icon = entries[i].icon; te->icon = entries[i].icon;
@ -347,7 +358,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
0, 0); 0, 0);
/* Efficiency rules! */ /* Efficiency rules! */
gtk_label_set_text (GTK_LABEL (popup->label), gtk_label_set_markup (GTK_LABEL (popup->label),
te->title); te->title);
gtk_widget_size_request (popup->label, &req); gtk_widget_size_request (popup->label, &req);
max_label_width = MAX (max_label_width, req.width); max_label_width = MAX (max_label_width, req.width);
@ -441,7 +452,7 @@ display_entry (MetaTabPopup *popup,
unselect_workspace (popup->current_selected_entry->widget); 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) if (popup->outline)
select_image (te->widget); select_image (te->widget);

View File

@ -41,6 +41,7 @@ struct _MetaTabEntry
int inner_x, inner_y, inner_width, inner_height; int inner_x, inner_y, inner_width, inner_height;
guint blank : 1; guint blank : 1;
guint minimized : 1; guint minimized : 1;
guint demands_attention : 1;
}; };
MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries, MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries,