conversation-viewer: Use HdyStatusPage for empty states

Libhandy now has a pre-built widget for empty states.
We should use that instead of a custom empty state.
This commit is contained in:
Christopher Davis 2021-02-06 03:51:09 -08:00 committed by Christopher Davis
parent 7359cdb20a
commit d0e8fb5f4a

View file

@ -76,56 +76,68 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
base_ref(); base_ref();
this.config = config; this.config = config;
Components.PlaceholderPane no_conversations = Hdy.StatusPage no_conversations =
new Components.PlaceholderPane(); new Hdy.StatusPage();
no_conversations.icon_name = "folder-symbolic"; no_conversations.icon_name = "folder-symbolic";
// Translators: Title label for placeholder when no // Translators: Title label for placeholder when no
// conversations have been selected. // conversations have been selected.
no_conversations.title = _("No conversations selected"); no_conversations.title = _("No Conversations Selected");
// Translators: Sub-title label for placeholder when no // Translators: Sub-title label for placeholder when no
// conversations have been selected. // conversations have been selected.
no_conversations.subtitle = _( no_conversations.description = _(
"Selecting a conversation from the list will display it here" "Selecting a conversation from the list will display it here."
); );
no_conversations.hexpand = true;
no_conversations.vexpand = true;
no_conversations.show ();
this.no_conversations_page.add(no_conversations); this.no_conversations_page.add(no_conversations);
Components.PlaceholderPane multi_conversations = Hdy.StatusPage multi_conversations =
new Components.PlaceholderPane(); new Hdy.StatusPage();
multi_conversations.icon_name = "folder-symbolic"; multi_conversations.icon_name = "folder-symbolic";
// Translators: Title label for placeholder when multiple // Translators: Title label for placeholder when multiple
// conversations have been selected. // conversations have been selected.
multi_conversations.title = _("Multiple conversations selected"); multi_conversations.title = _("Multiple Conversations Selected");
// Translators: Sub-title label for placeholder when multiple // Translators: Sub-title label for placeholder when multiple
// conversations have been selected. // conversations have been selected.
multi_conversations.subtitle = _( multi_conversations.description = _(
"Choosing an action will apply to all selected conversations" "Choosing an action will apply to all selected conversations."
); );
multi_conversations.hexpand = true;
multi_conversations.vexpand = true;
multi_conversations.show ();
this.multiple_conversations_page.add(multi_conversations); this.multiple_conversations_page.add(multi_conversations);
Components.PlaceholderPane empty_folder = Hdy.StatusPage empty_folder =
new Components.PlaceholderPane(); new Hdy.StatusPage();
empty_folder.icon_name = "folder-symbolic"; empty_folder.icon_name = "folder-symbolic";
// Translators: Title label for placeholder when no // Translators: Title label for placeholder when no
// conversations have exist in a folder. // conversations have exist in a folder.
empty_folder.title = _("No conversations found"); empty_folder.title = _("No Conversations Found");
// Translators: Sub-title label for placeholder when no // Translators: Sub-title label for placeholder when no
// conversations have exist in a folder. // conversations have exist in a folder.
empty_folder.subtitle = _( empty_folder.description = _(
"This folder does not contain any conversations" "This folder does not contain any conversations."
); );
empty_folder.hexpand = true;
empty_folder.vexpand = true;
empty_folder.show ();
this.empty_folder_page.add(empty_folder); this.empty_folder_page.add(empty_folder);
Components.PlaceholderPane empty_search = Hdy.StatusPage empty_search =
new Components.PlaceholderPane(); new Hdy.StatusPage();
empty_search.icon_name = "folder-symbolic"; empty_search.icon_name = "folder-symbolic";
// Translators: Title label for placeholder when no // Translators: Title label for placeholder when no
// conversations have been found in a search. // conversations have been found in a search.
empty_search.title = _("No conversations found"); empty_search.title = _("No Conversations Found");
// Translators: Sub-title label for placeholder when no // Translators: Sub-title label for placeholder when no
// conversations have been found in a search. // conversations have been found in a search.
empty_search.subtitle = _( empty_search.description = _(
"Your search returned no results, try refining your search terms" "Your search returned no results, try refining your search terms."
); );
empty_search.hexpand = true;
empty_search.vexpand = true;
empty_search.show ();
this.empty_search_page.add(empty_search); this.empty_search_page.add(empty_search);
this.conversation_find_undo = new Components.EntryUndo( this.conversation_find_undo = new Components.EntryUndo(