diff options
author | Benedikt Meurer <benny@xfce.org> | 2005-08-29 21:35:24 +0000 |
---|---|---|
committer | Benedikt Meurer <benny@xfce.org> | 2005-08-29 21:35:24 +0000 |
commit | 35746deda19163cfa486bcd7d02cb1043e1d0a5c (patch) | |
tree | 9497a7532e3126bcc2105dc4fad3384c4742a698 /thunar/thunar-icon-view.c | |
parent | 03bd71fac9a6460593719ae3472653872b9ade9e (diff) | |
download | thunar-35746deda19163cfa486bcd7d02cb1043e1d0a5c.tar.gz |
2005-08-29 Benedikt Meurer <benny@xfce.org>
* thunar/thunar-details-view.c, thunar/thunar-icon-view.c,
thunar/thunar-standard-view.{c,h}: Turn the name cell renderer into
a property of the ThunarStandardView class, so related functionality
can be easily shared between the icon and details views.
* thunar/thunar-standard-view-ui.xml, thunar/thunar-window-ui.xml: Add
placeholder for alteration actions to the "Edit" menu in the thunar
window and fill this placeholder with the "Rename" action in the
standard view. In addition, add the "Rename" action to the file
context menu.
* thunar/thunar-file.{c,h}: Add rename functionality to the ThunarFile
interface.
* thunar/thunar-standard-view.c(thunar_standard_view_selection_changed):
Enable the "Rename" action if exactly one file is selected and that
file is renameable.
(Old svn revision: 17172)
Diffstat (limited to 'thunar/thunar-icon-view.c')
-rw-r--r-- | thunar/thunar-icon-view.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/thunar/thunar-icon-view.c b/thunar/thunar-icon-view.c index 69e9351b..5fd070bf 100644 --- a/thunar/thunar-icon-view.c +++ b/thunar/thunar-icon-view.c @@ -25,7 +25,6 @@ #include <thunar/thunar-icon-view.h> #include <thunar/thunar-icon-view-ui.h> -#include <thunar/thunar-text-renderer.h> @@ -120,8 +119,7 @@ thunar_icon_view_class_init (ThunarIconViewClass *klass) static void thunar_icon_view_init (ThunarIconView *icon_view) { - GtkCellRenderer *renderer; - GtkWidget *view; + GtkWidget *view; /* create the real view */ view = exo_icon_view_new (); @@ -136,19 +134,25 @@ thunar_icon_view_init (ThunarIconView *icon_view) exo_icon_view_set_selection_mode (EXO_ICON_VIEW (view), GTK_SELECTION_MULTIPLE); /* add the icon renderer */ - g_object_set (G_OBJECT (THUNAR_STANDARD_VIEW (icon_view)->icon_renderer), "follow-state", TRUE, "size", 48, "ypad", 3u, NULL); + g_object_set (G_OBJECT (THUNAR_STANDARD_VIEW (icon_view)->icon_renderer), + "follow-state", TRUE, + "size", 48, + "ypad", 3u, + NULL); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (view), THUNAR_STANDARD_VIEW (icon_view)->icon_renderer, FALSE); - gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (view), THUNAR_STANDARD_VIEW (icon_view)->icon_renderer, "file", THUNAR_LIST_MODEL_COLUMN_FILE); - - /* add the text renderer */ - renderer = g_object_new (THUNAR_TYPE_TEXT_RENDERER, - "follow-state", TRUE, - "wrap-mode", PANGO_WRAP_WORD_CHAR, - "wrap-width", 128, - "yalign", 0.0f, - NULL); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (view), renderer, TRUE); - gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (view), renderer, "text", THUNAR_LIST_MODEL_COLUMN_NAME); + gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (view), THUNAR_STANDARD_VIEW (icon_view)->icon_renderer, + "file", THUNAR_LIST_MODEL_COLUMN_FILE); + + /* add the name renderer */ + g_object_set (G_OBJECT (THUNAR_STANDARD_VIEW (icon_view)->name_renderer), + "follow-state", TRUE, + "wrap-mode", PANGO_WRAP_WORD_CHAR, + "wrap-width", 128, + "yalign", 0.0f, + NULL); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (view), THUNAR_STANDARD_VIEW (icon_view)->name_renderer, TRUE); + gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (view), THUNAR_STANDARD_VIEW (icon_view)->name_renderer, + "text", THUNAR_LIST_MODEL_COLUMN_NAME); /* setup the icon view actions */ gtk_action_group_add_actions (THUNAR_STANDARD_VIEW (icon_view)->action_group, |