2007-05-07 19:09:24 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 The GNOME Foundation
|
|
|
|
* Written by Thomas Wood <thos@gnome.org>
|
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2007-05-09 19:50:39 +00:00
|
|
|
#include "appearance.h"
|
|
|
|
|
2007-05-07 19:09:24 +00:00
|
|
|
#include <string.h>
|
2007-05-25 14:44:03 +00:00
|
|
|
#include <pango/pango.h>
|
2007-05-07 19:09:24 +00:00
|
|
|
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
#include "theme-util.h"
|
2007-06-09 14:34:33 +00:00
|
|
|
#include "gtkrc-utils.h"
|
2007-05-07 22:00:05 +00:00
|
|
|
#include "gconf-property-editor.h"
|
2007-05-25 14:44:03 +00:00
|
|
|
#include "theme-thumbnail.h"
|
2007-05-07 19:09:24 +00:00
|
|
|
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
static gchar *
|
|
|
|
find_string_in_model (GtkTreeModel *model, const gchar *value, gint column)
|
|
|
|
{
|
|
|
|
GtkTreeIter iter;
|
|
|
|
gboolean valid;
|
|
|
|
gchar *path = NULL, *test;
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
if (!value)
|
|
|
|
return NULL;
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
for (valid = gtk_tree_model_get_iter_first (model, &iter); valid;
|
|
|
|
valid = gtk_tree_model_iter_next (model, &iter))
|
|
|
|
{
|
|
|
|
gtk_tree_model_get (model, &iter, column, &test, -1);
|
2007-05-13 21:26:03 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
if (test)
|
|
|
|
{
|
|
|
|
gint cmp = strcmp (test, value);
|
|
|
|
g_free (test);
|
|
|
|
|
|
|
|
if (!cmp)
|
|
|
|
{
|
|
|
|
path = gtk_tree_model_get_string_from_iter (model, &iter);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
don't destroy the window on "delete-event"
2007-06-06 Jens Granseuer <jensgr@gmx.net>
* appearance-style.c: (style_response_cb), (style_init): don't
destroy the window on "delete-event"
* appearance-themes.c: (theme_load_from_gconf),
(theme_thumbnail_generate), (theme_queue_for_thumbnail),
(theme_get_selected), (theme_set_custom_from_selected),
(theme_remove_custom), (theme_thumbnail_done_cb),
(theme_selection_changed_cb), (theme_custom_cb),
(theme_details_changed_cb), (themes_init): hook up more of the
customization functionality; don't unref generated thumbnails
because they are still held in a cache by the thumbnailer
svn path=/trunk/; revision=7696
2007-06-05 22:20:33 +00:00
|
|
|
}
|
2007-06-23 14:22:45 +00:00
|
|
|
|
|
|
|
return path;
|
don't destroy the window on "delete-event"
2007-06-06 Jens Granseuer <jensgr@gmx.net>
* appearance-style.c: (style_response_cb), (style_init): don't
destroy the window on "delete-event"
* appearance-themes.c: (theme_load_from_gconf),
(theme_thumbnail_generate), (theme_queue_for_thumbnail),
(theme_get_selected), (theme_set_custom_from_selected),
(theme_remove_custom), (theme_thumbnail_done_cb),
(theme_selection_changed_cb), (theme_custom_cb),
(theme_details_changed_cb), (themes_init): hook up more of the
customization functionality; don't unref generated thumbnails
because they are still held in a cache by the thumbnailer
svn path=/trunk/; revision=7696
2007-06-05 22:20:33 +00:00
|
|
|
}
|
2007-05-13 21:26:03 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
static GConfValue *
|
|
|
|
conv_to_widget_cb (GConfPropertyEditor *peditor, const GConfValue *value)
|
2007-06-22 18:25:21 +00:00
|
|
|
{
|
2007-06-23 14:22:45 +00:00
|
|
|
GtkTreeModel *store;
|
|
|
|
GtkTreeView *list;
|
|
|
|
const gchar *curr_value;
|
|
|
|
GConfValue *new_value;
|
|
|
|
gchar *path;
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
/* find value in model */
|
|
|
|
curr_value = gconf_value_get_string (value);
|
|
|
|
list = GTK_TREE_VIEW (gconf_property_editor_get_ui_control (peditor));
|
|
|
|
store = gtk_tree_view_get_model (list);
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
path = find_string_in_model (store, curr_value, COL_NAME);
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
/* Add a temporary item if we can't find a match
|
|
|
|
* TODO: delete this item if it is no longer selected?
|
|
|
|
*/
|
|
|
|
if (!path)
|
|
|
|
{
|
|
|
|
GtkListStore *list_store;
|
|
|
|
GtkTreeIter iter, sort_iter;
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
list_store = GTK_LIST_STORE (gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (store)));
|
|
|
|
|
|
|
|
gtk_list_store_insert_with_values (list_store, &iter, 0,
|
|
|
|
COL_LABEL, curr_value,
|
|
|
|
COL_NAME, curr_value, -1);
|
|
|
|
/* convert the tree store iter for use with the sort model */
|
|
|
|
gtk_tree_model_sort_convert_child_iter_to_iter (GTK_TREE_MODEL_SORT (store),
|
|
|
|
&sort_iter, &iter);
|
|
|
|
path = gtk_tree_model_get_string_from_iter (store, &sort_iter);
|
2007-06-22 18:25:21 +00:00
|
|
|
}
|
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
new_value = gconf_value_new (GCONF_VALUE_STRING);
|
|
|
|
gconf_value_set_string (new_value, path);
|
|
|
|
g_free (path);
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
return new_value;
|
2007-06-22 18:25:21 +00:00
|
|
|
}
|
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
static GConfValue *
|
|
|
|
conv_from_widget_cb (GConfPropertyEditor *peditor, const GConfValue *value)
|
2007-06-22 18:25:21 +00:00
|
|
|
{
|
2007-06-23 14:22:45 +00:00
|
|
|
GConfValue *new_value;
|
|
|
|
gchar *list_value = NULL;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeSelection *selection;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeView *list;
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
list = GTK_TREE_VIEW (gconf_property_editor_get_ui_control (peditor));
|
|
|
|
model = gtk_tree_view_get_model (list);
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
selection = gtk_tree_view_get_selection (list);
|
|
|
|
gtk_tree_selection_get_selected (selection, NULL, &iter);
|
|
|
|
gtk_tree_model_get (model, &iter, COL_NAME, &list_value, -1);
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
new_value = gconf_value_new (GCONF_VALUE_STRING);
|
|
|
|
gconf_value_set_string (new_value, list_value);
|
|
|
|
g_free (list_value);
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
return new_value;
|
2007-06-22 18:25:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-06-23 14:22:45 +00:00
|
|
|
update_color_buttons_from_string (const gchar *color_scheme, AppearanceData *data)
|
2007-06-22 18:25:21 +00:00
|
|
|
{
|
2007-06-23 14:22:45 +00:00
|
|
|
GdkColor color_scheme_colors[6];
|
|
|
|
gchar **color_scheme_strings, **color_scheme_pair, *current_string;
|
|
|
|
gint i;
|
|
|
|
GtkWidget *widget;
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
if (!color_scheme || !strcmp (color_scheme, "")) return;
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
/* The color scheme string consists of name:color pairs, seperated by
|
|
|
|
* newlines, so first we split the string up by new line */
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
color_scheme_strings = g_strsplit (color_scheme, "\n", 0);
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
/* loop through the name:color pairs, and save the colour if we recognise the name */
|
|
|
|
i = 0;
|
|
|
|
while ((current_string = color_scheme_strings[i++]))
|
|
|
|
{
|
|
|
|
color_scheme_pair = g_strsplit (current_string, ":", 0);
|
2007-06-22 18:25:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
if (color_scheme_pair[0] != NULL && color_scheme_pair[1] != NULL)
|
|
|
|
{
|
|
|
|
g_strstrip (color_scheme_pair[0]);
|
|
|
|
g_strstrip (color_scheme_pair[1]);
|
|
|
|
|
|
|
|
if (!strcmp ("fg_color", color_scheme_pair[0]))
|
|
|
|
gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[0]);
|
|
|
|
else if (!strcmp ("bg_color", color_scheme_pair[0]))
|
|
|
|
gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[1]);
|
|
|
|
else if (!strcmp ("text_color", color_scheme_pair[0]))
|
|
|
|
gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[2]);
|
|
|
|
else if (!strcmp ("base_color", color_scheme_pair[0]))
|
|
|
|
gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[3]);
|
|
|
|
else if (!strcmp ("selected_fg_color", color_scheme_pair[0]))
|
|
|
|
gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[4]);
|
|
|
|
else if (!strcmp ("selected_bg_color", color_scheme_pair[0]))
|
|
|
|
gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[5]);
|
2007-06-22 18:25:21 +00:00
|
|
|
}
|
2007-06-23 14:22:45 +00:00
|
|
|
|
|
|
|
g_strfreev (color_scheme_pair);
|
2007-06-22 18:25:21 +00:00
|
|
|
}
|
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
g_strfreev (color_scheme_strings);
|
|
|
|
|
|
|
|
/* not sure whether we need to do this, but it can't hurt */
|
|
|
|
for (i = 0; i < 6; i++)
|
|
|
|
gdk_colormap_alloc_color (gdk_colormap_get_system (), &color_scheme_colors[i], FALSE, TRUE);
|
|
|
|
|
|
|
|
/* now set all the buttons to the correct settings */
|
|
|
|
widget = glade_xml_get_widget (data->xml, "fg_colorbutton");
|
|
|
|
gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[0]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "bg_colorbutton");
|
|
|
|
gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[1]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "text_colorbutton");
|
|
|
|
gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[2]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "base_colorbutton");
|
|
|
|
gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[3]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "selected_fg_colorbutton");
|
|
|
|
gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[4]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "selected_bg_colorbutton");
|
|
|
|
gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[5]);
|
2007-06-22 18:25:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-06-23 14:22:45 +00:00
|
|
|
update_color_buttons_from_settings (GtkSettings *settings,
|
|
|
|
AppearanceData *data)
|
2007-06-22 18:25:21 +00:00
|
|
|
{
|
2007-06-23 14:22:45 +00:00
|
|
|
gchar *scheme;
|
|
|
|
scheme = gconf_client_get_string (data->client, COLOR_SCHEME_KEY, NULL);
|
|
|
|
if (scheme == NULL || strcmp (scheme, "") == 0)
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "color_scheme_defaults_button"), FALSE);
|
|
|
|
g_free (scheme);
|
|
|
|
g_object_get (G_OBJECT (settings), "gtk-color-scheme", &scheme, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
update_color_buttons_from_string (scheme, data);
|
|
|
|
g_free (scheme);
|
2007-06-22 18:25:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-06-23 14:22:45 +00:00
|
|
|
color_scheme_changed (GObject *settings,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
AppearanceData *data)
|
2007-06-22 18:25:21 +00:00
|
|
|
{
|
2007-06-23 14:22:45 +00:00
|
|
|
update_color_buttons_from_settings (GTK_SETTINGS (settings), data);
|
2007-06-22 18:25:21 +00:00
|
|
|
}
|
|
|
|
|
2007-06-23 11:08:21 +00:00
|
|
|
static void
|
2007-06-23 14:22:45 +00:00
|
|
|
check_color_schemes_enabled (GtkSettings *settings,
|
|
|
|
AppearanceData *data)
|
2007-06-23 11:08:21 +00:00
|
|
|
{
|
2007-06-23 14:22:45 +00:00
|
|
|
gchar *theme = NULL;
|
|
|
|
gchar *filename;
|
|
|
|
GSList *symbolic_colors = NULL;
|
|
|
|
gboolean fg, bg, base, text, fg_s, bg_s, enable_colors;
|
2007-06-23 11:08:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
g_object_get (G_OBJECT (settings), "gtk-theme-name", &theme, NULL);
|
|
|
|
filename = gtkrc_find_named (theme);
|
|
|
|
g_free (theme);
|
2007-06-23 11:08:21 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
gtkrc_get_details (filename, NULL, &symbolic_colors);
|
|
|
|
g_free (filename);
|
|
|
|
|
|
|
|
fg = (g_slist_find_custom (symbolic_colors, "fg_color", g_str_equal) != NULL);
|
|
|
|
bg = (g_slist_find_custom (symbolic_colors, "bg_color", g_str_equal) != NULL);
|
|
|
|
base = (g_slist_find_custom (symbolic_colors, "base_color", g_str_equal) != NULL);
|
|
|
|
text = (g_slist_find_custom (symbolic_colors, "text_color", g_str_equal) != NULL);
|
|
|
|
fg_s = (g_slist_find_custom (symbolic_colors, "selected_fg_color", g_str_equal) != NULL);
|
|
|
|
bg_s = (g_slist_find_custom (symbolic_colors, "selected_bg_color", g_str_equal) != NULL);
|
|
|
|
g_slist_foreach (symbolic_colors, (GFunc) g_free, NULL);
|
|
|
|
g_slist_free (symbolic_colors);
|
|
|
|
|
|
|
|
enable_colors = (fg && bg && base && text && fg_s && bg_s);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "color_scheme_table"), enable_colors);
|
|
|
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "color_scheme_defaults_button"), enable_colors);
|
|
|
|
|
|
|
|
if (enable_colors)
|
|
|
|
gtk_widget_hide (glade_xml_get_widget (data->xml, "color_scheme_message_hbox"));
|
|
|
|
else
|
|
|
|
gtk_widget_show (glade_xml_get_widget (data->xml, "color_scheme_message_hbox"));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_button_clicked_cb (GtkWidget *colorbutton, AppearanceData *data)
|
|
|
|
{
|
|
|
|
gchar *new_scheme;
|
|
|
|
GdkColor colors[6];
|
|
|
|
gchar *bg, *fg, *text, *base, *selected_fg, *selected_bg;
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
widget = glade_xml_get_widget (data->xml, "fg_colorbutton");
|
|
|
|
gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[0]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "bg_colorbutton");
|
|
|
|
gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[1]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "text_colorbutton");
|
|
|
|
gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[2]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "base_colorbutton");
|
|
|
|
gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[3]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "selected_fg_colorbutton");
|
|
|
|
gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[4]);
|
|
|
|
widget = glade_xml_get_widget (data->xml, "selected_bg_colorbutton");
|
|
|
|
gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[5]);
|
|
|
|
|
|
|
|
fg = g_strdup_printf ("fg_color:#%04x%04x%04x\n", colors[0].red, colors[0].green, colors[0].blue);
|
|
|
|
bg = g_strdup_printf ("bg_color:#%04x%04x%04x\n", colors[1].red, colors[1].green, colors[1].blue);
|
|
|
|
text = g_strdup_printf ("text_color:#%04x%04x%04x\n", colors[2].red, colors[2].green, colors[2].blue);
|
|
|
|
base = g_strdup_printf ("base_color:#%04x%04x%04x\n", colors[3].red, colors[3].green, colors[3].blue);
|
|
|
|
selected_fg = g_strdup_printf ("selected_fg_color:#%04x%04x%04x\n", colors[4].red, colors[4].green, colors[4].blue);
|
|
|
|
selected_bg = g_strdup_printf ("selected_bg_color:#%04x%04x%04x", colors[5].red, colors[5].green, colors[5].blue);
|
|
|
|
|
|
|
|
new_scheme = g_strconcat (fg, bg, text, base, selected_fg, selected_bg, NULL);
|
|
|
|
|
|
|
|
/* Currently we assume this has only been called when one of the colours has
|
|
|
|
* actually changed, so we don't check the original key first */
|
|
|
|
gconf_client_set_string (data->client, COLOR_SCHEME_KEY, new_scheme, NULL);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "color_scheme_defaults_button"), TRUE);
|
|
|
|
|
|
|
|
g_free (fg);
|
|
|
|
g_free (bg);
|
|
|
|
g_free (text);
|
|
|
|
g_free (base);
|
|
|
|
g_free (selected_fg);
|
|
|
|
g_free (selected_bg);
|
|
|
|
g_free (new_scheme);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_scheme_defaults_button_clicked_cb (GtkWidget *button, AppearanceData *data)
|
|
|
|
{
|
|
|
|
gconf_client_set_string (data->client, COLOR_SCHEME_KEY, "", NULL);
|
|
|
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "color_scheme_defaults_button"), FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
style_response_cb (GtkDialog *dialog, gint response_id)
|
|
|
|
{
|
|
|
|
if (response_id == GTK_RESPONSE_HELP) {
|
|
|
|
/* FIXME: help */
|
|
|
|
} else {
|
|
|
|
gtk_widget_hide (GTK_WIDGET (dialog));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_theme_changed (GConfPropertyEditor *peditor,
|
|
|
|
const gchar *key,
|
|
|
|
const GConfValue *value,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
GnomeThemeInfo *theme = NULL;
|
|
|
|
const gchar *name;
|
|
|
|
gchar *current_theme;
|
|
|
|
GtkSettings *settings = gtk_settings_get_default ();
|
|
|
|
|
|
|
|
if (value && (name = gconf_value_get_string (value))) {
|
|
|
|
theme = gnome_theme_info_find (name);
|
|
|
|
|
|
|
|
/* manually update GtkSettings to new gtk+ theme. */
|
|
|
|
g_object_get (settings, "gtk-theme-name", ¤t_theme, NULL);
|
|
|
|
|
|
|
|
if (strcmp (current_theme, name) != 0)
|
|
|
|
g_object_set (settings, "gtk-theme-name", name, NULL);
|
|
|
|
|
|
|
|
g_free (current_theme);
|
|
|
|
}
|
|
|
|
|
|
|
|
check_color_schemes_enabled (settings, data);
|
|
|
|
update_color_buttons_from_settings (settings, data);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "gtk_themes_delete"),
|
|
|
|
gnome_theme_is_writable (theme, GNOME_THEME_TYPE_REGULAR));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
window_theme_changed (GConfPropertyEditor *peditor,
|
|
|
|
const gchar *key,
|
|
|
|
const GConfValue *value,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
GnomeThemeInfo *theme = NULL;
|
|
|
|
const gchar *name;
|
|
|
|
|
|
|
|
if (value && (name = gconf_value_get_string (value)))
|
|
|
|
theme = gnome_theme_info_find (name);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "window_themes_delete"),
|
|
|
|
gnome_theme_is_writable (theme, GNOME_THEME_TYPE_REGULAR));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
icon_theme_changed (GConfPropertyEditor *peditor,
|
|
|
|
const gchar *key,
|
|
|
|
const GConfValue *value,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
GnomeThemeIconInfo *theme = NULL;
|
|
|
|
const gchar *name;
|
|
|
|
|
|
|
|
if (value && (name = gconf_value_get_string (value)))
|
|
|
|
theme = gnome_theme_icon_info_find (name);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "icon_themes_delete"),
|
|
|
|
gnome_theme_is_writable (theme, GNOME_THEME_TYPE_ICON));
|
|
|
|
}
|
|
|
|
|
2007-07-05 17:49:01 +00:00
|
|
|
static void
|
|
|
|
update_cursor_size_scale (GnomeThemeCursorInfo *theme,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
GtkWidget *cursor_size_scale;
|
|
|
|
|
|
|
|
cursor_size_scale = glade_xml_get_widget (data->xml, "cursor_size_scale");
|
|
|
|
|
|
|
|
if (theme->sizes->len == 1)
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive (cursor_size_scale, FALSE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GtkAdjustment *adjustment;
|
|
|
|
gint gconf_size, i;
|
|
|
|
gboolean size_found = FALSE;
|
|
|
|
|
|
|
|
adjustment = gtk_range_get_adjustment (GTK_RANGE (cursor_size_scale));
|
|
|
|
g_object_set (G_OBJECT (adjustment), "upper", (gdouble) theme->sizes->len - 1, NULL);
|
|
|
|
gtk_widget_set_sensitive (cursor_size_scale, TRUE);
|
|
|
|
|
|
|
|
gconf_size = gconf_client_get_int (data->client, CURSOR_SIZE_KEY, NULL);
|
|
|
|
|
|
|
|
/* set the slider to the cursor size which matches the gconf setting best */
|
|
|
|
for (i = 0; i < theme->sizes->len; i++)
|
|
|
|
{
|
|
|
|
gint size;
|
|
|
|
size = g_array_index (theme->sizes, gint, i);
|
|
|
|
|
|
|
|
if (size == gconf_size)
|
|
|
|
{
|
|
|
|
gtk_range_set_value (GTK_RANGE (cursor_size_scale), (gdouble) i);
|
|
|
|
size_found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (size > gconf_size)
|
|
|
|
{
|
|
|
|
if (i == 0)
|
|
|
|
{
|
|
|
|
gtk_range_set_value (GTK_RANGE (cursor_size_scale), 0);
|
|
|
|
size_found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gint diff, diff_to_last;
|
|
|
|
|
|
|
|
diff = size - gconf_size;
|
|
|
|
diff_to_last = gconf_size - g_array_index (theme->sizes, gint, i - 1);
|
|
|
|
|
|
|
|
gtk_range_set_value (GTK_RANGE (cursor_size_scale), (gdouble) (diff < diff_to_last) ? diff : diff_to_last);
|
|
|
|
size_found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set to the biggest size if the gconf value is bigger than
|
|
|
|
all available sizes */
|
|
|
|
if (!size_found)
|
|
|
|
gtk_range_set_value (GTK_RANGE (cursor_size_scale), (gdouble) g_array_index (theme->sizes, gint, theme->sizes->len - 1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cursor_theme_changed (GConfPropertyEditor *peditor,
|
|
|
|
const gchar *key,
|
|
|
|
const GConfValue *value,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
GnomeThemeCursorInfo *theme = NULL;
|
|
|
|
const gchar *name;
|
|
|
|
|
|
|
|
if (value && (name = gconf_value_get_string (value)))
|
|
|
|
theme = gnome_theme_cursor_info_find (name);
|
|
|
|
|
|
|
|
update_cursor_size_scale (theme, data);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (glade_xml_get_widget (data->xml, "cursor_themes_delete"),
|
|
|
|
gnome_theme_is_writable (theme, GNOME_THEME_TYPE_CURSOR));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
static void
|
|
|
|
generic_theme_delete (const gchar *tv_name, ThemeType type, AppearanceData *data)
|
|
|
|
{
|
|
|
|
GtkTreeView *treeview = GTK_TREE_VIEW (glade_xml_get_widget (data->xml, tv_name));
|
|
|
|
GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview);
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
|
|
|
|
gchar *name;
|
|
|
|
|
|
|
|
gtk_tree_model_get (model, &iter, COL_NAME, &name, -1);
|
|
|
|
|
|
|
|
if (name != NULL && theme_delete (name, type)) {
|
|
|
|
/* remove theme from the model, too */
|
|
|
|
GtkTreeIter child;
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
|
|
|
path = gtk_tree_model_get_path (model, &iter);
|
|
|
|
gtk_tree_model_sort_convert_iter_to_child_iter (
|
|
|
|
GTK_TREE_MODEL_SORT (model), &child, &iter);
|
|
|
|
gtk_list_store_remove (GTK_LIST_STORE (
|
|
|
|
gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (model))), &child);
|
|
|
|
|
|
|
|
if (gtk_tree_model_get_iter (model, &iter, path) ||
|
|
|
|
theme_model_iter_last (model, &iter)) {
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
path = gtk_tree_model_get_path (model, &iter);
|
|
|
|
gtk_tree_selection_select_path (selection, path);
|
|
|
|
gtk_tree_view_scroll_to_cell (treeview, path, NULL, FALSE, 0, 0);
|
|
|
|
}
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
|
|
|
g_free (name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_theme_delete_cb (GtkWidget *button, AppearanceData *data)
|
|
|
|
{
|
|
|
|
generic_theme_delete ("gtk_themes_list", THEME_TYPE_GTK, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
window_theme_delete_cb (GtkWidget *button, AppearanceData *data)
|
|
|
|
{
|
|
|
|
generic_theme_delete ("window_themes_list", THEME_TYPE_WINDOW, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
icon_theme_delete_cb (GtkWidget *button, AppearanceData *data)
|
|
|
|
{
|
|
|
|
generic_theme_delete ("icon_themes_list", THEME_TYPE_ICON, data);
|
|
|
|
}
|
|
|
|
|
2007-07-05 17:49:01 +00:00
|
|
|
static void
|
|
|
|
cursor_size_scale_value_changed_cb (GtkRange *range, AppearanceData *data)
|
|
|
|
{
|
|
|
|
GnomeThemeCursorInfo *theme;
|
|
|
|
gint size;
|
|
|
|
|
|
|
|
theme = gnome_theme_cursor_info_find (gconf_client_get_string (data->client, CURSOR_THEME_KEY, NULL));
|
|
|
|
|
|
|
|
size = g_array_index (theme->sizes, gint, (int) gtk_range_get_value (range));
|
|
|
|
gconf_client_set_int (data->client, CURSOR_SIZE_KEY, size, NULL);
|
|
|
|
}
|
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
static void
|
|
|
|
add_to_treeview (const gchar *tv_name,
|
|
|
|
const gchar *theme_name,
|
|
|
|
const gchar *theme_label,
|
|
|
|
GdkPixbuf *theme_thumbnail,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
GtkTreeView *treeview;
|
|
|
|
GtkListStore *model;
|
|
|
|
|
|
|
|
treeview = GTK_TREE_VIEW (glade_xml_get_widget (data->xml, tv_name));
|
|
|
|
model = GTK_LIST_STORE (
|
|
|
|
gtk_tree_model_sort_get_model (
|
|
|
|
GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (treeview))));
|
|
|
|
|
|
|
|
gtk_list_store_insert_with_values (model, NULL, 0,
|
|
|
|
COL_LABEL, theme_label,
|
|
|
|
COL_NAME, theme_name,
|
|
|
|
COL_THUMBNAIL, theme_thumbnail,
|
|
|
|
-1);
|
|
|
|
}
|
2007-06-23 11:08:21 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
remove_from_treeview (const gchar *tv_name,
|
|
|
|
const gchar *theme_name,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
GtkTreeView *treeview;
|
|
|
|
GtkListStore *model;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
treeview = GTK_TREE_VIEW (glade_xml_get_widget (data->xml, tv_name));
|
|
|
|
model = GTK_LIST_STORE (
|
|
|
|
gtk_tree_model_sort_get_model (
|
|
|
|
GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (treeview))));
|
|
|
|
|
|
|
|
if (theme_find_in_model (GTK_TREE_MODEL (model), theme_name, &iter))
|
|
|
|
gtk_list_store_remove (model, &iter);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
update_in_treeview (const gchar *tv_name,
|
|
|
|
const gchar *theme_name,
|
|
|
|
const gchar *theme_label,
|
|
|
|
GdkPixbuf *theme_thumbnail,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
GtkTreeView *treeview;
|
|
|
|
GtkListStore *model;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
treeview = GTK_TREE_VIEW (glade_xml_get_widget (data->xml, tv_name));
|
|
|
|
model = GTK_LIST_STORE (
|
|
|
|
gtk_tree_model_sort_get_model (
|
|
|
|
GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (treeview))));
|
|
|
|
|
|
|
|
if (theme_find_in_model (GTK_TREE_MODEL (model), theme_name, &iter)) {
|
|
|
|
gtk_list_store_set (model, &iter,
|
|
|
|
COL_LABEL, theme_label,
|
|
|
|
COL_NAME, theme_name,
|
|
|
|
COL_THUMBNAIL, theme_thumbnail,
|
|
|
|
-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-06-25 15:22:45 +00:00
|
|
|
static void
|
|
|
|
update_thumbnail_in_treeview (const gchar *tv_name,
|
|
|
|
const gchar *theme_name,
|
|
|
|
GdkPixbuf *theme_thumbnail,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
GtkTreeView *treeview;
|
|
|
|
GtkListStore *model;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
treeview = GTK_TREE_VIEW (glade_xml_get_widget (data->xml, tv_name));
|
|
|
|
model = GTK_LIST_STORE (
|
|
|
|
gtk_tree_model_sort_get_model (
|
|
|
|
GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (treeview))));
|
|
|
|
|
|
|
|
if (theme_find_in_model (GTK_TREE_MODEL (model), theme_name, &iter)) {
|
|
|
|
gtk_list_store_set (model, &iter,
|
|
|
|
COL_THUMBNAIL, theme_thumbnail,
|
|
|
|
-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-06-23 11:08:21 +00:00
|
|
|
static void
|
|
|
|
changed_on_disk_cb (GnomeThemeType type,
|
|
|
|
gpointer theme,
|
|
|
|
GnomeThemeChangeType change_type,
|
|
|
|
GnomeThemeElement element,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
if (type == GNOME_THEME_TYPE_REGULAR) {
|
|
|
|
GnomeThemeInfo *info = theme;
|
|
|
|
|
|
|
|
if (change_type == GNOME_THEME_CHANGE_DELETED) {
|
|
|
|
if (info->has_gtk)
|
|
|
|
remove_from_treeview ("gtk_themes_list", info->name, data);
|
|
|
|
if (info->has_metacity)
|
2007-06-25 15:22:45 +00:00
|
|
|
remove_from_treeview ("window_themes_list", info->name, data);
|
2007-06-23 11:08:21 +00:00
|
|
|
|
|
|
|
} else {
|
|
|
|
GdkPixbuf *thumbnail;
|
|
|
|
|
|
|
|
if (info->has_gtk) {
|
|
|
|
thumbnail = generate_gtk_theme_thumbnail (info);
|
|
|
|
|
|
|
|
if (change_type == GNOME_THEME_CHANGE_CREATED)
|
|
|
|
add_to_treeview ("gtk_themes_list", info->name, info->name, thumbnail, data);
|
|
|
|
else if (change_type == GNOME_THEME_CHANGE_CHANGED)
|
|
|
|
update_in_treeview ("gtk_themes_list", info->name, info->name, thumbnail, data);
|
|
|
|
|
|
|
|
if (thumbnail)
|
|
|
|
g_object_unref (thumbnail);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (info->has_metacity) {
|
|
|
|
thumbnail = generate_metacity_theme_thumbnail (info);
|
|
|
|
|
|
|
|
if (change_type == GNOME_THEME_CHANGE_CREATED)
|
2007-06-25 15:22:45 +00:00
|
|
|
add_to_treeview ("window_themes_list", info->name, info->name, thumbnail, data);
|
2007-06-23 11:08:21 +00:00
|
|
|
else if (change_type == GNOME_THEME_CHANGE_CHANGED)
|
2007-06-25 15:22:45 +00:00
|
|
|
update_in_treeview ("window_themes_list", info->name, info->name, thumbnail, data);
|
2007-06-23 11:08:21 +00:00
|
|
|
|
|
|
|
if (thumbnail)
|
|
|
|
g_object_unref (thumbnail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (type == GNOME_THEME_TYPE_ICON) {
|
|
|
|
GnomeThemeIconInfo *info = theme;
|
|
|
|
|
|
|
|
if (change_type == GNOME_THEME_CHANGE_DELETED) {
|
|
|
|
remove_from_treeview ("icon_themes_list", info->name, data);
|
|
|
|
} else {
|
|
|
|
GdkPixbuf *thumbnail = generate_icon_theme_thumbnail (info);
|
|
|
|
|
|
|
|
if (change_type == GNOME_THEME_CHANGE_CREATED)
|
|
|
|
add_to_treeview ("icon_themes_list", info->name, info->readable_name, thumbnail, data);
|
|
|
|
else if (change_type == GNOME_THEME_CHANGE_CHANGED)
|
|
|
|
update_in_treeview ("icon_themes_list", info->name, info->readable_name, thumbnail, data);
|
|
|
|
|
|
|
|
if (thumbnail)
|
|
|
|
g_object_unref (thumbnail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-06-25 15:22:45 +00:00
|
|
|
static void
|
|
|
|
gtk_theme_thumbnail_cb (GdkPixbuf *pixbuf,
|
|
|
|
gchar *theme_name,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
update_thumbnail_in_treeview ("gtk_themes_list", theme_name, pixbuf, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
metacity_theme_thumbnail_cb (GdkPixbuf *pixbuf,
|
|
|
|
gchar *theme_name,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
update_thumbnail_in_treeview ("window_themes_list", theme_name, pixbuf, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
icon_theme_thumbnail_cb (GdkPixbuf *pixbuf,
|
|
|
|
gchar *theme_name,
|
|
|
|
AppearanceData *data)
|
|
|
|
{
|
|
|
|
update_thumbnail_in_treeview ("icon_themes_list", theme_name, pixbuf, data);
|
|
|
|
}
|
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
static void
|
|
|
|
prepare_list (AppearanceData *data, GtkWidget *list, ThemeType type, GCallback callback)
|
2007-05-13 18:23:12 +00:00
|
|
|
{
|
2007-06-23 14:22:45 +00:00
|
|
|
GtkListStore *store;
|
|
|
|
GList *l, *themes = NULL;
|
|
|
|
GtkCellRenderer *renderer;
|
|
|
|
GtkTreeViewColumn *column;
|
|
|
|
GtkTreeModel *sort_model;
|
2007-06-26 17:49:37 +00:00
|
|
|
GdkPixbuf *thumbnail;
|
2007-06-23 14:22:45 +00:00
|
|
|
const gchar *key;
|
|
|
|
GObject *peditor;
|
|
|
|
GConfValue *value;
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case THEME_TYPE_GTK:
|
|
|
|
themes = gnome_theme_info_find_by_type (GNOME_THEME_GTK_2);
|
2007-06-26 17:49:37 +00:00
|
|
|
thumbnail = data->gtk_theme_icon;
|
2007-06-23 14:22:45 +00:00
|
|
|
key = GTK_THEME_KEY;
|
|
|
|
break;
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
case THEME_TYPE_WINDOW:
|
|
|
|
themes = gnome_theme_info_find_by_type (GNOME_THEME_METACITY);
|
2007-06-26 17:49:37 +00:00
|
|
|
thumbnail = data->window_theme_icon;
|
2007-06-23 14:22:45 +00:00
|
|
|
key = METACITY_THEME_KEY;
|
|
|
|
break;
|
2007-05-13 18:23:12 +00:00
|
|
|
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
case THEME_TYPE_ICON:
|
2007-05-25 14:44:03 +00:00
|
|
|
themes = gnome_theme_icon_info_find_all ();
|
2007-06-26 17:49:37 +00:00
|
|
|
thumbnail = data->icon_theme_icon;
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
key = ICON_THEME_KEY;
|
2007-05-13 18:23:12 +00:00
|
|
|
break;
|
|
|
|
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
case THEME_TYPE_CURSOR:
|
2007-07-05 17:49:01 +00:00
|
|
|
themes = gnome_theme_cursor_info_find_all ();
|
2007-06-26 17:49:37 +00:00
|
|
|
thumbnail = NULL;
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
key = CURSOR_THEME_KEY;
|
2007-07-05 17:49:01 +00:00
|
|
|
break;
|
2007-05-13 18:23:12 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
/* we don't deal with any other type of themes here */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-05-25 20:22:44 +00:00
|
|
|
store = gtk_list_store_new (NUM_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-05-25 14:44:03 +00:00
|
|
|
for (l = themes; l; l = g_list_next (l))
|
2007-05-13 18:23:12 +00:00
|
|
|
{
|
2007-05-25 20:22:44 +00:00
|
|
|
const gchar *name = NULL;
|
|
|
|
const gchar *label = NULL;
|
2007-05-13 18:23:12 +00:00
|
|
|
GtkTreeIter i;
|
|
|
|
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
if (type == THEME_TYPE_GTK || type == THEME_TYPE_WINDOW) {
|
2007-05-25 20:22:44 +00:00
|
|
|
name = ((GnomeThemeInfo *) l->data)->name;
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
} else if (type == THEME_TYPE_ICON) {
|
2007-05-25 20:22:44 +00:00
|
|
|
name = ((GnomeThemeIconInfo *) l->data)->name;
|
|
|
|
label = ((GnomeThemeIconInfo *) l->data)->readable_name;
|
|
|
|
}
|
2007-07-05 17:49:01 +00:00
|
|
|
else if (type == THEME_TYPE_CURSOR) {
|
|
|
|
name = ((GnomeThemeCursorInfo *) l->data)->name;
|
|
|
|
}
|
2007-05-13 18:23:12 +00:00
|
|
|
|
|
|
|
if (!name)
|
|
|
|
continue; /* just in case... */
|
|
|
|
|
2007-05-25 14:44:03 +00:00
|
|
|
switch (type)
|
|
|
|
{
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
case THEME_TYPE_GTK:
|
2007-06-25 15:22:45 +00:00
|
|
|
generate_gtk_theme_thumbnail_async ((GnomeThemeInfo *) l->data,
|
|
|
|
(ThemeThumbnailFunc) gtk_theme_thumbnail_cb,
|
|
|
|
data,
|
|
|
|
NULL);
|
2007-05-25 14:44:03 +00:00
|
|
|
break;
|
|
|
|
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
case THEME_TYPE_ICON:
|
2007-06-25 15:22:45 +00:00
|
|
|
generate_icon_theme_thumbnail_async ((GnomeThemeIconInfo *) l->data,
|
|
|
|
(ThemeThumbnailFunc) icon_theme_thumbnail_cb,
|
|
|
|
data,
|
|
|
|
NULL);
|
2007-05-25 14:44:03 +00:00
|
|
|
break;
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
|
|
|
|
case THEME_TYPE_WINDOW:
|
2007-06-25 15:22:45 +00:00
|
|
|
generate_metacity_theme_thumbnail_async ((GnomeThemeInfo *) l->data,
|
|
|
|
(ThemeThumbnailFunc) metacity_theme_thumbnail_cb,
|
|
|
|
data,
|
|
|
|
NULL);
|
2007-05-25 14:44:03 +00:00
|
|
|
break;
|
2007-07-05 17:49:01 +00:00
|
|
|
|
|
|
|
case THEME_TYPE_CURSOR:
|
|
|
|
thumbnail = ((GnomeThemeCursorInfo *) l->data)->thumbnail;
|
|
|
|
break;
|
|
|
|
|
2007-05-25 14:44:03 +00:00
|
|
|
default:
|
2007-06-25 16:00:24 +00:00
|
|
|
break;
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
}
|
2007-05-25 14:44:03 +00:00
|
|
|
|
2007-05-25 20:22:44 +00:00
|
|
|
gtk_list_store_insert_with_values (store, &i, 0,
|
|
|
|
COL_LABEL, label ? label : name,
|
2007-06-26 14:45:57 +00:00
|
|
|
COL_NAME, name,
|
|
|
|
COL_THUMBNAIL, thumbnail,
|
|
|
|
-1);
|
2007-07-05 17:49:01 +00:00
|
|
|
|
|
|
|
if (type == THEME_TYPE_CURSOR)
|
|
|
|
g_object_unref (thumbnail);
|
2007-05-13 18:23:12 +00:00
|
|
|
}
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
g_list_free (themes);
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-05-13 20:24:14 +00:00
|
|
|
sort_model = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (store));
|
2007-05-25 20:22:44 +00:00
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model),
|
|
|
|
COL_LABEL, GTK_SORT_ASCENDING);
|
2007-05-25 14:44:03 +00:00
|
|
|
|
|
|
|
gtk_tree_view_set_model (GTK_TREE_VIEW (list), GTK_TREE_MODEL (sort_model));
|
|
|
|
|
|
|
|
renderer = gtk_cell_renderer_pixbuf_new ();
|
2007-06-22 18:25:21 +00:00
|
|
|
g_object_set (G_OBJECT (renderer), "xpad", 3, "ypad", 3, NULL);
|
2007-05-13 20:24:14 +00:00
|
|
|
|
2007-05-25 14:44:03 +00:00
|
|
|
column = gtk_tree_view_column_new ();
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
gtk_tree_view_column_pack_start (column, renderer, FALSE);
|
2007-05-25 20:22:44 +00:00
|
|
|
gtk_tree_view_column_add_attribute (column, renderer, "pixbuf", COL_THUMBNAIL);
|
2007-05-25 14:44:03 +00:00
|
|
|
gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
|
2007-05-16 16:48:59 +00:00
|
|
|
|
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2007-05-25 14:44:03 +00:00
|
|
|
|
|
|
|
column = gtk_tree_view_column_new ();
|
new files
2007-06-14 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* theme-util.c: (theme_delete), (theme_model_iter_last):
* theme-util.h: new files
* appearance.glade: default delete buttons to insensitive,
change label for "Custom" key, adjust column ids for icon view
* appearance-style.c: (style_init), (prepare_list),
(update_color_buttons_from_settings), (theme_name_changed),
(color_button_clicked_cb),
(color_scheme_defaults_button_clicked_cb):
* appearance-themes.c: (theme_get_selected_name),
(theme_get_selected), (theme_select_iter), (theme_select_name),
(theme_is_equal), (theme_set_custom_from_theme),
(theme_changed_on_disk_cb), (theme_custom_cb), (theme_delete_cb),
(theme_details_changed_cb), (theme_color_scheme_changed_cb),
(theme_gconf_changed), (theme_postinit), (themes_init),
(themes_shutdown):
* appearance.h: improvements all around the block (metatheme
deletion now working, and custom theme working much better)
svn path=/trunk/; revision=7725
2007-06-14 21:20:25 +00:00
|
|
|
gtk_tree_view_column_pack_start (column, renderer, FALSE);
|
2007-05-25 20:22:44 +00:00
|
|
|
gtk_tree_view_column_add_attribute (column, renderer, "text", COL_LABEL);
|
2007-05-25 14:44:03 +00:00
|
|
|
gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-22 18:25:21 +00:00
|
|
|
peditor = gconf_peditor_new_tree_view (NULL, key, list,
|
|
|
|
"conv-to-widget-cb", conv_to_widget_cb,
|
|
|
|
"conv-from-widget-cb", conv_from_widget_cb,
|
|
|
|
NULL);
|
|
|
|
g_signal_connect (peditor, "value-changed", callback, data);
|
|
|
|
|
|
|
|
/* init the delete buttons */
|
|
|
|
value = gconf_client_get (data->client, key, NULL);
|
|
|
|
(*((void (*) (GConfPropertyEditor *, const gchar *, const GConfValue *, gpointer)) callback))
|
|
|
|
(GCONF_PROPERTY_EDITOR (peditor), key, value, data);
|
|
|
|
if (value)
|
|
|
|
gconf_value_free (value);
|
2007-05-13 18:23:12 +00:00
|
|
|
}
|
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
void
|
|
|
|
style_init (AppearanceData *data)
|
2007-05-13 18:23:12 +00:00
|
|
|
{
|
2007-06-23 14:22:45 +00:00
|
|
|
GtkSettings *settings;
|
|
|
|
GtkWidget *w;
|
2007-07-05 17:49:01 +00:00
|
|
|
GtkAdjustment *adjustment;
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-26 14:45:57 +00:00
|
|
|
data->gtk_theme_icon = gdk_pixbuf_new_from_file (GNOMECC_PIXMAP_DIR "/gtk-theme-thumbnailing.png", NULL);
|
|
|
|
data->window_theme_icon = gdk_pixbuf_new_from_file (GNOMECC_PIXMAP_DIR "/window-theme-thumbnailing.png", NULL);
|
|
|
|
data->icon_theme_icon = gdk_pixbuf_new_from_file (GNOMECC_PIXMAP_DIR "/icon-theme-thumbnailing.png", NULL);
|
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
w = glade_xml_get_widget (data->xml, "theme_details");
|
|
|
|
g_signal_connect (w, "response", (GCallback) style_response_cb, NULL);
|
|
|
|
g_signal_connect (w, "delete_event", (GCallback) gtk_true, NULL);
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
prepare_list (data, glade_xml_get_widget (data->xml, "window_themes_list"), THEME_TYPE_WINDOW, (GCallback) window_theme_changed);
|
2007-06-25 15:22:45 +00:00
|
|
|
prepare_list (data, glade_xml_get_widget (data->xml, "gtk_themes_list"), THEME_TYPE_GTK, (GCallback) gtk_theme_changed);
|
2007-06-23 14:22:45 +00:00
|
|
|
prepare_list (data, glade_xml_get_widget (data->xml, "icon_themes_list"), THEME_TYPE_ICON, (GCallback) icon_theme_changed);
|
2007-07-05 17:49:01 +00:00
|
|
|
prepare_list (data, glade_xml_get_widget (data->xml, "cursor_themes_list"), THEME_TYPE_CURSOR, (GCallback) cursor_theme_changed);
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
w = glade_xml_get_widget (data->xml, "color_scheme_message_hbox");
|
|
|
|
gtk_widget_set_no_show_all (w, TRUE);
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
w = glade_xml_get_widget (data->xml, "color_scheme_defaults_button");
|
|
|
|
gtk_button_set_image (GTK_BUTTON (w),
|
|
|
|
gtk_image_new_from_stock (GTK_STOCK_REVERT_TO_SAVED,
|
|
|
|
GTK_ICON_SIZE_BUTTON));
|
2007-05-13 18:23:12 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
settings = gtk_settings_get_default ();
|
|
|
|
check_color_schemes_enabled (settings, data);
|
|
|
|
g_signal_connect (settings, "notify::gtk-color-scheme", (GCallback) color_scheme_changed, data);
|
|
|
|
update_color_buttons_from_settings (settings, data);
|
2007-06-09 14:34:33 +00:00
|
|
|
|
2007-07-05 17:49:01 +00:00
|
|
|
w = glade_xml_get_widget (data->xml, "cursor_size_scale");
|
|
|
|
GTK_RANGE (w)->round_digits = 0;
|
|
|
|
g_signal_connect (G_OBJECT (w), "value-changed", (GCallback) cursor_size_scale_value_changed_cb, data);
|
|
|
|
adjustment = gtk_range_get_adjustment (GTK_RANGE (w));
|
|
|
|
g_object_set (G_OBJECT (adjustment), "page-size", 0.0, NULL);
|
|
|
|
|
|
|
|
w = glade_xml_get_widget (data->xml, "cursor_size_small_label");
|
|
|
|
gtk_label_set_markup (GTK_LABEL (w), g_strdup_printf ("<small><i>%s</i></small>", gtk_label_get_text (GTK_LABEL (w))));
|
|
|
|
w = glade_xml_get_widget (data->xml, "cursor_size_large_label");
|
|
|
|
gtk_label_set_markup (GTK_LABEL (w), g_strdup_printf ("<small><i>%s</i></small>", gtk_label_get_text (GTK_LABEL (w))));
|
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
/* connect signals */
|
|
|
|
/* color buttons */
|
|
|
|
g_signal_connect (G_OBJECT (glade_xml_get_widget (data->xml, "fg_colorbutton")), "color-set", (GCallback) color_button_clicked_cb, data);
|
|
|
|
g_signal_connect (G_OBJECT (glade_xml_get_widget (data->xml, "bg_colorbutton")), "color-set", (GCallback) color_button_clicked_cb, data);
|
|
|
|
g_signal_connect (G_OBJECT (glade_xml_get_widget (data->xml, "text_colorbutton")), "color-set", (GCallback) color_button_clicked_cb, data);
|
|
|
|
g_signal_connect (G_OBJECT (glade_xml_get_widget (data->xml, "base_colorbutton")), "color-set", (GCallback) color_button_clicked_cb, data);
|
|
|
|
g_signal_connect (G_OBJECT (glade_xml_get_widget (data->xml, "selected_fg_colorbutton")), "color-set", (GCallback) color_button_clicked_cb, data);
|
|
|
|
g_signal_connect (G_OBJECT (glade_xml_get_widget (data->xml, "selected_bg_colorbutton")), "color-set", (GCallback) color_button_clicked_cb, data);
|
|
|
|
/* revert button */
|
|
|
|
g_signal_connect (G_OBJECT (glade_xml_get_widget (data->xml, "color_scheme_defaults_button")), "clicked", (GCallback) color_scheme_defaults_button_clicked_cb, data);
|
|
|
|
/* delete buttons */
|
|
|
|
g_signal_connect (glade_xml_get_widget (data->xml, "gtk_themes_delete"), "clicked", (GCallback) gtk_theme_delete_cb, data);
|
|
|
|
g_signal_connect (glade_xml_get_widget (data->xml, "window_themes_delete"), "clicked", (GCallback) window_theme_delete_cb, data);
|
|
|
|
g_signal_connect (glade_xml_get_widget (data->xml, "icon_themes_delete"), "clicked", (GCallback) icon_theme_delete_cb, data);
|
2007-06-09 14:34:33 +00:00
|
|
|
|
2007-06-23 14:22:45 +00:00
|
|
|
gnome_theme_info_register_theme_change ((ThemeChangedCallback) changed_on_disk_cb, data);
|
2007-06-09 14:34:33 +00:00
|
|
|
}
|
2007-06-26 14:45:57 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
style_shutdown (AppearanceData *data)
|
|
|
|
{
|
|
|
|
if (data->gtk_theme_icon)
|
|
|
|
g_object_unref (data->gtk_theme_icon);
|
|
|
|
if (data->window_theme_icon)
|
|
|
|
g_object_unref (data->window_theme_icon);
|
|
|
|
if (data->icon_theme_icon)
|
|
|
|
g_object_unref (data->icon_theme_icon);
|
|
|
|
}
|