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
This commit is contained in:
Jonathan Blandford 2002-05-14 16:34:14 +00:00 committed by Jonathan Blandford
parent 331ec2dfa3
commit b87cde513f
7 changed files with 64 additions and 14 deletions

View file

@ -1,3 +1,8 @@
Tue May 14 12:08:17 2002 Jonathan Blandford <jrb@redhat.com>
* theme-common.c (theme_common_init): confirm that the ~/.themes/
directory exists.
2002-04-29 Rachel Hestilow <hestilow@ximian.com>
* file-transfer-dialog.c (file_transfer_dialog_update_cb):

View file

@ -175,12 +175,21 @@ theme_common_init (void)
{
static gboolean initted = FALSE;
gchar *dir;
GnomeVFSURI *uri;
if (initted)
return;
initted = TRUE;
dir = g_build_filename (g_get_home_dir (), ".themes", NULL);
/* Make sure it exists */
uri = gnome_vfs_uri_new (dir);
if (!gnome_vfs_uri_exists (uri))
gnome_vfs_make_directory_for_uri (uri, 0775);
gnome_vfs_uri_unref (uri);
themes_common_list_add_dir (dir);
g_free (dir);

View file

@ -377,7 +377,7 @@ read_cursor_font (void)
gchar *dir_name;
struct dirent *file_dirent;
dir_name = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome/share/cursor-fonts", NULL);
dir_name = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome2/share/cursor-fonts", NULL);
if (! g_file_test (dir_name, G_FILE_TEST_EXISTS))
return NULL;

View file

@ -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:

View file

@ -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>

View file

@ -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);

View file

@ -4,10 +4,11 @@
<glade-interface>
<widget class="GtkDialog" id="gnome_ui_properties_dialog">
<property name="title" translatable="yes">Toolbar and Menu Properties</property>
<property name="title" translatable="yes">Toolbar and Menu Preferences</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">True</property>
@ -37,6 +38,7 @@
<property name="response_id">-11</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="closebutton1">
<property name="visible">True</property>
@ -73,10 +75,10 @@
<child>
<widget class="GtkVBox" id="vbox3">
<property name="border_width">4</property>
<property name="border_width">8</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">4</property>
<property name="spacing">8</property>
<child>
<widget class="GtkHBox" id="hbox1">
@ -191,7 +193,7 @@
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<accessibility>
<atkproperty name="AtkObject::accessible_description" translatable="yes">A preview of what a toolbar looks like with these settings.</atkproperty>
</accessibility>
@ -308,10 +310,10 @@
<child>
<widget class="GtkVBox" id="vbox4">
<property name="border_width">4</property>
<property name="border_width">8</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">4</property>
<property name="spacing">8</property>
<child>
<widget class="GtkCheckButton" id="menu_icons_toggle">
@ -336,7 +338,7 @@
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<accessibility>
<atkproperty name="AtkObject::accessible_description" translatable="yes">A preview of what a menubar looks like with these settings.</atkproperty>
</accessibility>