diff options
author | Ujjwal Kumar <ujjwalkumar0501@gmail.com> | 2020-03-09 02:37:02 +0530 |
---|---|---|
committer | António Fernandes <antoniojpfernandes@gmail.com> | 2020-03-28 20:29:00 +0000 |
commit | a700db42bb4afbd0b6f9ff7ee016ea728301b56f (patch) | |
tree | 8d94d86007dfad9b180b60fd98ecf14a17db9257 /src/nautilus-view.c | |
parent | f5ad5015689e0aae7d77f43f9414bad037127b65 (diff) | |
download | nautilus-a700db42bb4afbd0b6f9ff7ee016ea728301b56f.tar.gz |
usability: Change tooltip for view_toggle_button
Currently, the tooltip says 'Toggle view', which isn't clear.
Usability testers had difficulty finding out how to change between
list and grid view.
Change tooltip to say 'Show list' or 'Show grid', depending on which
view it can change to.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/893
Diffstat (limited to 'src/nautilus-view.c')
-rw-r--r-- | src/nautilus-view.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nautilus-view.c b/src/nautilus-view.c index b4c6bc347..3efeeca05 100644 --- a/src/nautilus-view.c +++ b/src/nautilus-view.c @@ -19,6 +19,7 @@ #include "config.h" #include "nautilus-view.h" +#include <glib/gi18n.h> G_DEFINE_INTERFACE (NautilusView, nautilus_view, GTK_TYPE_WIDGET) @@ -138,6 +139,35 @@ nautilus_view_get_icon (guint view_id) } /** + * nautilus_view_get_tooltip: + * @view: a #NautilusView + * + * Retrieves the static string that represents @view. + * + * Returns: (transfer none): a static string + */ +const gchar * +nautilus_view_get_tooltip (guint view_id) +{ + if (view_id == NAUTILUS_VIEW_GRID_ID) + { + return _("Show grid"); + } + else if (view_id == NAUTILUS_VIEW_LIST_ID) + { + return _("Show list"); + } + else if (view_id == NAUTILUS_VIEW_OTHER_LOCATIONS_ID) + { + return _("Show List"); + } + else + { + return NULL; + } +} + +/** * nautilus_view_get_view_id: * @view: a #NautilusView * |