summaryrefslogtreecommitdiff
path: root/capplets/theme-switcher
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2002-05-14 16:34:14 +0000
committerJonathan Blandford <jrb@src.gnome.org>2002-05-14 16:34:14 +0000
commitb87cde513f7c512586f3739679ee193ce304cc55 (patch)
tree7fdd710e9969277a01c08b8b8f762d8820e5ba43 /capplets/theme-switcher
parent331ec2dfa38f4ba54fba7477af9e0fb8393894c3 (diff)
downloadgnome-control-center-b87cde513f7c512586f3739679ee193ce304cc55.tar.gz
try to scroll to theme. Currently appears to be a little broken somewhere.
Tue May 14 12:29:35 2002 Jonathan Blandford <jrb@redhat.com> * theme-switcher.c (read_themes): try to scroll to theme. Currently appears to be a little broken somewhere. Tue May 14 12:08:17 2002 Jonathan Blandford <jrb@redhat.com> * theme-common.c (theme_common_init): confirm that the ~/.themes/ directory exists. Also: Clean up ui-props a little. commit fix to mouse properties
Diffstat (limited to 'capplets/theme-switcher')
-rw-r--r--capplets/theme-switcher/ChangeLog7
-rw-r--r--capplets/theme-switcher/theme-properties.glade5
-rw-r--r--capplets/theme-switcher/theme-switcher.c34
3 files changed, 40 insertions, 6 deletions
diff --git a/capplets/theme-switcher/ChangeLog b/capplets/theme-switcher/ChangeLog
index f6624309f..0c87c5aa0 100644
--- a/capplets/theme-switcher/ChangeLog
+++ b/capplets/theme-switcher/ChangeLog
@@ -1,3 +1,10 @@
+Tue May 14 12:29:35 2002 Jonathan Blandford <jrb@redhat.com>
+
+ * theme-switcher.c (read_themes): try to scroll to theme.
+ Currently appears to be a little broken somewhere.
+
+ * theme-properties.glade: clean up, and add an atk relation, #76416
+
2002-05-10 Anders Carlsson <andersca@gnu.org>
* theme-properties.glade:
diff --git a/capplets/theme-switcher/theme-properties.glade b/capplets/theme-switcher/theme-properties.glade
index 9ab2f1872..0670048e6 100644
--- a/capplets/theme-switcher/theme-properties.glade
+++ b/capplets/theme-switcher/theme-properties.glade
@@ -6,7 +6,7 @@
<widget class="GtkDialog" id="theme_dialog">
<property name="visible">True</property>
- <property name="title" translatable="yes">Theme Properties</property>
+ <property name="title" translatable="yes">Gtk+ Theme Preferences</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
@@ -104,6 +104,9 @@
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
+ <accessibility>
+ <atkproperty name="AtkObject::accessible_description" translatable="yes">List of available GTK+ themes</atkproperty>
+ </accessibility>
</widget>
</child>
</widget>
diff --git a/capplets/theme-switcher/theme-switcher.c b/capplets/theme-switcher/theme-switcher.c
index 214340770..432b7eaf8 100644
--- a/capplets/theme-switcher/theme-switcher.c
+++ b/capplets/theme-switcher/theme-switcher.c
@@ -103,14 +103,17 @@ read_themes (GladeXML *dialog)
GList *gtk_theme_list;
GList *list;
GtkTreeModel *model;
+ GtkTreeView *tree_view;
gchar *current_theme;
gint i = 0;
gboolean current_theme_found = FALSE;
+ GtkTreeRowReference *row_ref = NULL;
client = gconf_client_get_default ();
gtk_theme_list = theme_common_get_list ();
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (WID ("theme_treeview")));
+ tree_view = GTK_TREE_VIEW (WID ("theme_treeview"));
+ model = gtk_tree_view_get_model (tree_view);
setting_model = TRUE;
gtk_list_store_clear (GTK_LIST_STORE (model));
@@ -137,15 +140,21 @@ read_themes (GladeXML *dialog)
if (strcmp (current_theme, info->name) == 0)
{
- GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("theme_treeview")));
+ GtkTreeSelection *selection;
+ GtkTreePath *path;
+
+ selection = gtk_tree_view_get_selection (tree_view);
gtk_tree_selection_select_iter (selection, &iter);
+ path = gtk_tree_model_get_path (model, &iter);
+ row_ref = gtk_tree_row_reference_new (model, path);
+ gtk_tree_path_free (path);
current_theme_found = TRUE;
}
if (i == MAX_ELEMENTS_BEFORE_SCROLLING)
{
GtkRequisition rectangle;
- gtk_widget_size_request (WID ("theme_treeview"), &rectangle);
+ gtk_widget_size_request (GTK_WIDGET (tree_view), &rectangle);
gtk_widget_set_usize (WID ("theme_swindow"), -1, rectangle.height);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (WID ("theme_swindow")),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
@@ -155,14 +164,29 @@ read_themes (GladeXML *dialog)
if (! current_theme_found)
{
- GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("theme_treeview")));
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view);
GtkTreeIter iter;
+ GtkTreePath *path;
gtk_list_store_prepend (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
THEME_NAME_COLUMN, current_theme,
-1);
gtk_tree_selection_select_iter (selection, &iter);
+ path = gtk_tree_model_get_path (model, &iter);
+ row_ref = gtk_tree_row_reference_new (model, path);
+ gtk_tree_path_free (path);
+ }
+
+
+ if (row_ref)
+ {
+ GtkTreePath *path;
+
+ path = gtk_tree_row_reference_get_path (row_ref);
+ gtk_tree_view_scroll_to_cell (tree_view, path, NULL, TRUE, 0.5, 0.0);
+ gtk_tree_path_free (path);
+ gtk_tree_row_reference_free (row_ref);
}
setting_model = FALSE;
@@ -276,7 +300,7 @@ show_manage_themes (GtkWidget *button, gpointer data)
if (!gnome_vfs_uri_exists (uri)) {
/* Create the directory */
- gnome_vfs_make_directory_for_uri (uri, 775);
+ gnome_vfs_make_directory_for_uri (uri, 0775);
}
gnome_vfs_uri_unref (uri);