Mercurial > geeqie
changeset 1765:650915809048
use text renderer for editor->hidden
The toggle was too confusing because it was not dirrectly editable.
author | nadvornik |
---|---|
date | Sat, 10 Oct 2009 10:15:23 +0000 |
parents | 91ec4714b905 |
children | 6e0f6d5e4c25 |
files | src/desktop_file.c src/editors.c |
diffstat | 2 files changed, 6 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/src/desktop_file.c Thu Oct 01 18:40:34 2009 +0000 +++ b/src/desktop_file.c Sat Oct 10 10:15:23 2009 +0000 @@ -383,6 +383,7 @@ case DESKTOP_FILE_COLUMN_KEY: case DESKTOP_FILE_COLUMN_NAME: case DESKTOP_FILE_COLUMN_PATH: + case DESKTOP_FILE_COLUMN_HIDDEN: { gchar *s1, *s2; @@ -404,22 +405,6 @@ } break; - case DESKTOP_FILE_COLUMN_HIDDEN: - { - gint *v1, *v2; - - gtk_tree_model_get(model, a, n, &v1, -1); - gtk_tree_model_get(model, b, n, &v2, -1); - - if (v1 == v2) - ret = 0; - else if (v1 < v2) - ret = 1; - else - ret = -1; - } - break; - default: g_return_val_if_reached(0); } @@ -510,13 +495,9 @@ column = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(column, _("Hidden")); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - renderer = gtk_cell_renderer_toggle_new(); - g_object_set(G_OBJECT(renderer), - "activatable", FALSE, // not clickable for now - "xalign", 0.5, // centered - NULL); - gtk_tree_view_column_pack_start(column, renderer, TRUE); // TRUE needed for centering - gtk_tree_view_column_add_attribute(column, renderer, "active", DESKTOP_FILE_COLUMN_HIDDEN); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(column, renderer, FALSE); + gtk_tree_view_column_add_attribute(column, renderer, "text", DESKTOP_FILE_COLUMN_HIDDEN); gtk_tree_view_append_column(GTK_TREE_VIEW(ewl->view), column); gtk_tree_view_column_set_sort_column_id(column, DESKTOP_FILE_COLUMN_HIDDEN); gtk_tree_view_column_set_alignment(column, 0.5);
--- a/src/editors.c Thu Oct 01 18:40:34 2009 +0000 +++ b/src/editors.c Sat Oct 10 10:15:23 2009 +0000 @@ -331,7 +331,7 @@ gtk_list_store_set(desktop_file_list, &iter, DESKTOP_FILE_COLUMN_KEY, key, DESKTOP_FILE_COLUMN_NAME, editor->name, - DESKTOP_FILE_COLUMN_HIDDEN, editor->hidden, + DESKTOP_FILE_COLUMN_HIDDEN, editor->hidden ? _("yes") : _("no"), DESKTOP_FILE_COLUMN_WRITABLE, access_file(path, W_OK), DESKTOP_FILE_COLUMN_PATH, path, -1); @@ -358,7 +358,7 @@ } else { - desktop_file_list = gtk_list_store_new(DESKTOP_FILE_COLUMN_COUNT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING); + desktop_file_list = gtk_list_store_new(DESKTOP_FILE_COLUMN_COUNT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING); } if (editors) {