X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Ftint2conf%2Ftheme_view.c;h=05fad6be4588d2950e00abcb18f033ec51910052;hb=b0daed8dd52ebaa40fa993e5b9f23c823937c120;hp=8cce3f83ea53154ffe2c5e50e94ca0273037b247;hpb=350abde2b1c72e4b580a34ca1f0ff2380d9ea419;p=chaz%2Ftint2 diff --git a/src/tint2conf/theme_view.c b/src/tint2conf/theme_view.c index 8cce3f8..05fad6b 100644 --- a/src/tint2conf/theme_view.c +++ b/src/tint2conf/theme_view.c @@ -1,8 +1,24 @@ - -#include -#include -#include - +/************************************************************************** +* +* Tint2conf +* +* Copyright (C) 2009 Thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +**************************************************************************/ + + +#include "main.h" #include "theme_view.h" // The data columns that we export via the tree model interface @@ -19,7 +35,7 @@ GtkWidget *create_view() GtkCellRenderer *renderer; GtkWidget *view; - g_store = gtk_list_store_new(NB_COL, G_TYPE_STRING, GDK_TYPE_PIXBUF); + g_store = gtk_list_store_new(NB_COL, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF); view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(g_store)); gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), TRUE); @@ -34,6 +50,12 @@ GtkWidget *create_view() gtk_tree_view_column_set_visible(col, FALSE); gtk_tree_view_append_column(GTK_TREE_VIEW(view),col); + renderer = gtk_cell_renderer_text_new(); + col = gtk_tree_view_column_new(); + gtk_tree_view_column_pack_start(col, renderer, TRUE); + gtk_tree_view_column_add_attribute(col, renderer, "text", COL_THEME_NAME); + gtk_tree_view_append_column(GTK_TREE_VIEW(view),col); + g_width_list = 200; g_height_list = 30; g_renderer = gtk_cell_renderer_pixbuf_new(); @@ -59,6 +81,13 @@ void custom_list_append(const gchar *name) gtk_list_store_append(g_store, &iter); gtk_list_store_set(g_store, &iter, COL_THEME_FILE, name, -1); + + gchar *b, *n; + b = strrchr(name, '/'); + n = g_strdup(b+1); + b = strrchr(n, '.'); + *b = '\0'; + gtk_list_store_set(g_store, &iter, COL_THEME_NAME, n, -1); } @@ -109,12 +138,12 @@ gboolean update_snapshot() pixWidth = gdk_pixbuf_get_width(pixbuf); pixHeight = gdk_pixbuf_get_height(pixbuf); - if (g_width_list < pixWidth) { + if (g_width_list != pixWidth) { g_width_list = pixWidth; changeSize = TRUE; } - if (g_height_list < (pixHeight+6)) { - g_height_list = pixHeight+6; + if (g_height_list != (pixHeight+30)) { + g_height_list = pixHeight+30; changeSize = TRUE; } if (changeSize)