Commit 46ededed authored by Vincent Noel's avatar Vincent Noel Committed by Vincent Noel
Browse files

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.
parent 47221dcc
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),
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment