Commit 4bd08dfc authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

desktop: change home icon text

parent 1bf30268
Pipeline #131725 passed with stage
in 7 minutes and 38 seconds
......@@ -18,6 +18,8 @@
#include "config.h"
#include "gf-home-icon.h"
#include <glib/gi18n.h>
struct _GfHomeIcon
{
GfIcon parent;
......@@ -37,6 +39,12 @@ gf_home_icon_get_icon (GfIcon *icon,
return g_file_info_get_icon (info);
}
static const char *
gf_home_icon_get_text (GfIcon *icon)
{
return _("Home");
}
static gboolean
gf_home_icon_can_rename (GfIcon *icon)
{
......@@ -51,6 +59,7 @@ gf_home_icon_class_init (GfHomeIconClass *self_class)
icon_class = GF_ICON_CLASS (self_class);
icon_class->get_icon = gf_home_icon_get_icon;
icon_class->get_text = gf_home_icon_get_text;
icon_class->can_rename = gf_home_icon_can_rename;
}
......
......@@ -520,12 +520,7 @@ update_text (GfIcon *self)
priv = gf_icon_get_instance_private (self);
name = NULL;
if (priv->app_info != NULL)
name = g_app_info_get_name (G_APP_INFO (priv->app_info));
if (name == NULL)
name = g_file_info_get_display_name (priv->info);
name = GF_ICON_GET_CLASS (self)->get_text (self);
priv->name = g_strdup (name);
gtk_label_set_text (GTK_LABEL (priv->label), name);
......@@ -861,6 +856,24 @@ gf_icon_get_icon (GfIcon *self,
return icon;
}
static const char *
gf_icon_get_text (GfIcon *self)
{
GfIconPrivate *priv;
const char *name;
priv = gf_icon_get_instance_private (self);
name = NULL;
if (priv->app_info != NULL)
name = g_app_info_get_name (G_APP_INFO (priv->app_info));
if (name == NULL)
name = g_file_info_get_display_name (priv->info);
return name;
}
static gboolean
gf_icon_can_rename (GfIcon *self)
{
......@@ -948,6 +961,7 @@ gf_icon_class_init (GfIconClass *self_class)
widget_class->get_preferred_width = gf_icon_get_preferred_width;
self_class->get_icon = gf_icon_get_icon;
self_class->get_text = gf_icon_get_text;
self_class->can_rename = gf_icon_can_rename;
install_properties (object_class);
......
......@@ -29,10 +29,12 @@ struct _GfIconClass
{
GtkButtonClass parent_class;
GIcon * (* get_icon) (GfIcon *self,
gboolean *is_thumbnail);
GIcon * (* get_icon) (GfIcon *self,
gboolean *is_thumbnail);
gboolean (* can_rename) (GfIcon *self);
const char * (* get_text) (GfIcon *self);
gboolean (* can_rename) (GfIcon *self);
};
GtkWidget *gf_icon_new (GfIconView *icon_view,
......
......@@ -23,6 +23,7 @@ gnome-flashback/libautomount-manager/gsd-autorun.c
gnome-flashback/libbluetooth-applet/gf-bluetooth-applet.c
gnome-flashback/libdesktop/gf-create-folder-dialog.c
gnome-flashback/libdesktop/gf-desktop-window.c
gnome-flashback/libdesktop/gf-home-icon.c
gnome-flashback/libdesktop/gf-icon.c
gnome-flashback/libdesktop/gf-icon-view.c
gnome-flashback/libdesktop/gf-rename-popover.c
......
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