diff --git a/ChangeLog b/ChangeLog index c471cd76c..34da0506f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-08-08 Seth Nickell + + Try my best to throw a monkey wrench in things. Checkin + Windows capplet, and add window related settings to + the font capplet and theme capplet. + + Also fix button alignments on all capplets. + 2002-07-27 Mark McLoughlin * configure.in: add check for gtk+ with multihead diff --git a/capplets/font/ChangeLog b/capplets/font/ChangeLog index 596e53010..5d7dc1789 100644 --- a/capplets/font/ChangeLog +++ b/capplets/font/ChangeLog @@ -1,3 +1,11 @@ +2002-06-24 Seth Nickell + + * font-properties.glade: + * main.c: (setup_dialog): + + Add a font picker for controlling the window title font (and size). + Set border widths nicely so things align. + 2002-07-24 jacob berkman * Makefile.am (EXTRA_DIST): dist the pixel icons diff --git a/capplets/font/font-properties.glade b/capplets/font/font-properties.glade index b0ff17551..70a5a80ce 100644 --- a/capplets/font/font-properties.glade +++ b/capplets/font/font-properties.glade @@ -15,7 +15,6 @@ - 2 True False 0 @@ -65,7 +64,7 @@ 5 True - 3 + 4 2 False 8 @@ -452,9 +451,53 @@ 0 2 + 3 + 4 + fill + + + + + + True + _Window title font: + True + False + GTK_JUSTIFY_RIGHT + False + False + 0 + 0.5 + 0 + 0 + desktop_font + + + 0 + 1 2 3 fill + + + + + + + True + True + GNOME_FONT_PICKER_MODE_FONT_INFO + True + True + 14 + + + 1 + 2 + 2 + 3 + fill + @@ -479,7 +522,6 @@ - 2 True False 0 diff --git a/capplets/font/main.c b/capplets/font/main.c index efdfad3f4..cd33af7db 100644 --- a/capplets/font/main.c +++ b/capplets/font/main.c @@ -20,14 +20,14 @@ #include "activate-settings-daemon.h" #include "gconf-property-editor.h" - #ifdef HAVE_XFT2 static void cb_show_details (GtkWidget *button, GtkWindow *parent); #endif /* HAVE_XFT2 */ -#define GTK_FONT_KEY "/desktop/gnome/interface/font_name" -#define DESKTOP_FONT_KEY "/apps/nautilus/preferences/desktop_font" +#define GTK_FONT_KEY "/desktop/gnome/interface/font_name" +#define DESKTOP_FONT_KEY "/apps/nautilus/preferences/desktop_font" +#define WINDOW_TITLE_FONT_KEY "/desktop/gnome/applications/window_manager/titlebar_font" #ifdef HAVE_XFT2 #define FONT_RENDER_DIR "/desktop/gnome/font_rendering" @@ -421,6 +421,10 @@ setup_dialog (GladeXML *dialog) WID ("desktop_font"), PEDITOR_FONT_COMBINED, NULL); + peditor = gconf_peditor_new_font (NULL, WINDOW_TITLE_FONT_KEY, + WID ("window_title_font"), + PEDITOR_FONT_COMBINED, NULL); + widget = WID ("font_dialog"); capplet_set_icon (widget, "font-capplet.png"); diff --git a/capplets/keybindings/ChangeLog b/capplets/keybindings/ChangeLog index 5fd7e9649..89edf398a 100644 --- a/capplets/keybindings/ChangeLog +++ b/capplets/keybindings/ChangeLog @@ -1,3 +1,9 @@ +2002-08-08 Seth Nickell + + * gnome-keybinding-properties.glade: + + Set border widths correctly so things align nicely. + 2002-06-27 Jody Goldberg * gnome-keybinding-properties.c (setup_dialog) : fix and move the code diff --git a/capplets/keybindings/gnome-keybinding-properties.glade b/capplets/keybindings/gnome-keybinding-properties.glade index f9d81d19b..e7094e07b 100644 --- a/capplets/keybindings/gnome-keybinding-properties.glade +++ b/capplets/keybindings/gnome-keybinding-properties.glade @@ -10,11 +10,10 @@ False True False - True + False - 2 True False 0 @@ -61,7 +60,7 @@ - 8 + 5 True False 8 diff --git a/capplets/keyboard/ChangeLog b/capplets/keyboard/ChangeLog index 054676fd8..9e68a48e9 100644 --- a/capplets/keyboard/ChangeLog +++ b/capplets/keyboard/ChangeLog @@ -1,3 +1,9 @@ +2002-08-08 Seth Nickell + + * gnome-keyboard-properties.glade: + + Set border widths nicely so things align. + 2002-08-01 Federico Mena Quintero * gnome-keyboard-properties.glade: Made the file entry modal. diff --git a/capplets/keyboard/gnome-keyboard-properties.glade b/capplets/keyboard/gnome-keyboard-properties.glade index 223f80b17..dd9eafba4 100644 --- a/capplets/keyboard/gnome-keyboard-properties.glade +++ b/capplets/keyboard/gnome-keyboard-properties.glade @@ -15,10 +15,9 @@ - 2 True False - 8 + 0 @@ -130,6 +129,7 @@ + 5 True True True @@ -152,7 +152,7 @@ True 0 0.5 - GTK_SHADOW_ETCHED_IN + GTK_SHADOW_NONE @@ -408,7 +408,7 @@ True 0 0.5 - GTK_SHADOW_ETCHED_IN + GTK_SHADOW_NONE @@ -634,7 +634,7 @@ 0 0.5 - GTK_SHADOW_ETCHED_IN + GTK_SHADOW_NONE @@ -845,7 +845,7 @@ True 0 0.5 - GTK_SHADOW_ETCHED_IN + GTK_SHADOW_NONE diff --git a/capplets/mouse/ChangeLog b/capplets/mouse/ChangeLog index d509f3604..e74ac181a 100644 --- a/capplets/mouse/ChangeLog +++ b/capplets/mouse/ChangeLog @@ -1,3 +1,9 @@ +2002-08-08 Seth Nickell + + * gnome-mouse-properties.glade: + + Fix alignments. + 2002-07-16 Jody Goldberg * gnome-mouse-properties.c (main) : set icon. diff --git a/capplets/mouse/gnome-mouse-properties.glade b/capplets/mouse/gnome-mouse-properties.glade index 31ab8d001..902bd3eb4 100644 --- a/capplets/mouse/gnome-mouse-properties.glade +++ b/capplets/mouse/gnome-mouse-properties.glade @@ -62,6 +62,7 @@ + 5 True True True diff --git a/capplets/network/ChangeLog b/capplets/network/ChangeLog index 55c3e56f0..54af80077 100644 --- a/capplets/network/ChangeLog +++ b/capplets/network/ChangeLog @@ -1,3 +1,9 @@ +2002-08-08 Seth Nickell + + * gnome-network-preferences.glade: + + Fix alignment. + 2002-07-10 Jody Goldberg http://bugzilla.gnome.org/show_bug.cgi?id=85929 diff --git a/capplets/network/gnome-network-preferences.glade b/capplets/network/gnome-network-preferences.glade index 91f32861a..d35db607b 100644 --- a/capplets/network/gnome-network-preferences.glade +++ b/capplets/network/gnome-network-preferences.glade @@ -64,7 +64,7 @@ - 8 + 5 True False 2 diff --git a/capplets/sound/sound-properties.glade b/capplets/sound/sound-properties.glade index 5cb910162..bfdb2c04e 100644 --- a/capplets/sound/sound-properties.glade +++ b/capplets/sound/sound-properties.glade @@ -1,114 +1,130 @@ - + - - Sound Preferences - GTK_WINDOW_TOPLEVEL - no - no - yes - no - GTK_WIN_POS_NONE - - - yes - yes - yes - GTK_POS_TOP - no - 2 - 2 - no - yes + + Sound Preferences + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False - - - no - 5 - yes + + + 5 + True + True + True + True + GTK_POS_TOP + False + 2 + 2 + False - - - yes - E_nable sound server startup - no - yes - yes - yes + + + True + False + 5 - - - - 0 - no - no - - + + + True + True + E_nable sound server startup + True + GTK_RELIEF_NORMAL + False + False + True + + + + 0 + False + False + + - - - yes - _Sounds for events - no - yes - yes - yes + + + True + True + _Sounds for events + True + GTK_RELIEF_NORMAL + False + False + True + + + + 0 + False + False + + + + + False + True + + - - - - 0 - no - no - - - - + + + True + _General + True + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + - - - _General - GTK_JUSTIFY_CENTER - no - 0.5 - 0.5 - 0 - 0 - yes - yes - - - tab - - + + + True + False + 0 + + + False + True + + - - - no - 0 - yes - - + + + True + Sound _Events + True + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + + + + - - - Sound _Events - GTK_JUSTIFY_CENTER - no - 0.5 - 0.5 - 0 - 0 - yes - yes - - - tab - - - - - diff --git a/capplets/theme-switcher/Makefile.am b/capplets/theme-switcher/Makefile.am index 9bdc2149a..3185ece92 100644 --- a/capplets/theme-switcher/Makefile.am +++ b/capplets/theme-switcher/Makefile.am @@ -1,6 +1,9 @@ bin_PROGRAMS = gnome-theme-properties -gnome_theme_properties_LDADD = $(GNOMECC_CAPPLETS_LIBS) +gnome_theme_properties_LDADD = \ + $(GNOMECC_CAPPLETS_LIBS) \ + -L$(top_builddir)/libwindow-settings/ -lgnome-window-settings + gnome_theme_properties_SOURCES = \ theme-switcher.c gnome_theme_properties_LDFLAGS = -export-dynamic @@ -14,7 +17,8 @@ desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) gladedir = $(GNOMECC_GLADE_DIR) glade_DATA = theme-properties.glade theme-install.glade -INCLUDES = \ +INCLUDES = \ + -I$(top_srcdir) \ $(GNOMECC_CAPPLETS_CFLAGS) \ -DGLADEDIR=\""$(gladedir)"\" diff --git a/capplets/theme-switcher/theme-properties.glade b/capplets/theme-switcher/theme-properties.glade index 4abc68ef4..c8bc14425 100644 --- a/capplets/theme-switcher/theme-properties.glade +++ b/capplets/theme-switcher/theme-properties.glade @@ -2,7 +2,6 @@ - True @@ -16,7 +15,6 @@ - 2 True False 0 @@ -63,18 +61,23 @@ - - 8 + + 5 True - False - 8 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False - + True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN + False + 8 @@ -106,9 +109,6 @@ False False True - - List of available GTK+ themes - @@ -168,43 +168,143 @@ True + + + 0 + True + True + + + + + + True + False + 8 - + + True + gtk-dialog-info + 6 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + New themes can also be installed by dragging them into the window. + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + False + True + + + + + + True + Widget Theme + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + + + + + 8 + True + False + 8 + + + + True + False + 8 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + + + + + 0 + True + True + + + + + True False 8 - + True - gtk-dialog-info - 6 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - New themes can also be installed by dragging them into the window. - False - False - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 + True + _Go to theme folder + True + GTK_RELIEF_NORMAL 0 @@ -216,35 +316,39 @@ 0 False - True + False - - - - - True - Installed Themes - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - label_item + 0 + True + True - 0 - True - True + False + True + + + + + + True + Window Border Theme + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + tab diff --git a/capplets/theme-switcher/theme-switcher.c b/capplets/theme-switcher/theme-switcher.c index 557986552..338ff264a 100644 --- a/capplets/theme-switcher/theme-switcher.c +++ b/capplets/theme-switcher/theme-switcher.c @@ -11,13 +11,16 @@ #include #include +#include + #include "theme-common.h" #include "capplet-util.h" #include "activate-settings-daemon.h" #include "gconf-property-editor.h" #include "file-transfer-dialog.h" -#define GTK_THEME_KEY "/desktop/gnome/interface/gtk_theme" +#define GTK_THEME_KEY "/desktop/gnome/interface/gtk_theme" +#define WINDOW_THEME_KEY "/desktop/gnome/applications/window_manager/theme" #define MAX_ELEMENTS_BEFORE_SCROLLING 8 @@ -40,8 +43,11 @@ static GtkTargetEntry drop_types[] = }; static gint n_drop_types = sizeof (drop_types) / sizeof (GtkTargetEntry); + static gboolean setting_model = FALSE; static gboolean initial_scroll = TRUE; +static gboolean window_setting_model = FALSE; +static gboolean window_initial_scroll = TRUE; static GladeXML * create_dialog (void) @@ -97,6 +103,50 @@ theme_selection_changed (GtkTreeSelection *selection, g_free (new_key); } +static void +window_theme_selection_changed (GtkTreeSelection *selection, + gpointer data) +{ + GtkTreeModel *model; + gchar *new_key; + GConfClient *client; + GtkTreeIter iter; + + if (window_setting_model) + return; + + client = gconf_client_get_default (); + + if (gtk_tree_selection_get_selected (selection, &model, &iter)) + { + gtk_tree_model_get (model, &iter, + THEME_NAME_COLUMN, &new_key, + -1); + } + else + /* This shouldn't happen */ + { + new_key = NULL; + } + + if (new_key != NULL) + { + gchar *old_key; + + old_key = gconf_client_get_string (client, WINDOW_THEME_KEY, NULL); + if (old_key && strcmp (old_key, new_key)) + { + gconf_client_set_string (client, WINDOW_THEME_KEY, new_key, NULL); + } + g_free (old_key); + } + else + { + gconf_client_unset (client, WINDOW_THEME_KEY, NULL); + } + g_free (new_key); +} + static void read_themes (GladeXML *dialog) { @@ -194,6 +244,115 @@ read_themes (GladeXML *dialog) g_free (current_theme); } +static void +window_read_themes (GladeXML *dialog) +{ + GConfClient *client; + GList *window_theme_list; + GList *list; + GtkTreeModel *model; + GtkTreeView *tree_view; + gchar *current_theme; + gint i = 0; + gboolean current_theme_found = FALSE; + GtkTreeRowReference *row_ref = NULL; + GnomeWindowManager *wm; + + client = gconf_client_get_default (); + + wm = gnome_wm_manager_get_current (); + window_theme_list = gnome_window_manager_get_theme_list (wm); + g_object_unref (G_OBJECT (wm)); + + tree_view = GTK_TREE_VIEW (WID ("window_theme_treeview")); + model = gtk_tree_view_get_model (tree_view); + + window_setting_model = TRUE; + gtk_list_store_clear (GTK_LIST_STORE (model)); + + current_theme = gconf_client_get_string (client, WINDOW_THEME_KEY, NULL); + if (current_theme == NULL) + current_theme = g_strdup ("Default"); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (WID ("window_theme_swindow")), + GTK_POLICY_NEVER, GTK_POLICY_NEVER); + gtk_widget_set_usize (WID ("window_theme_swindow"), -1, -1); + + for (list = window_theme_list; list; list = list->next) + { + char *theme_name = list->data; + GtkTreeIter iter; + + gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + THEME_NAME_COLUMN, theme_name, + -1); + + if (strcmp (current_theme, theme_name) == 0) + { + GtkTreeSelection *selection; + + selection = gtk_tree_view_get_selection (tree_view); + gtk_tree_selection_select_iter (selection, &iter); + if (window_initial_scroll) + { + GtkTreePath *path; + + 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 (GTK_WIDGET (tree_view), &rectangle); + gtk_widget_set_usize (WID ("window_theme_swindow"), -1, rectangle.height); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (WID ("window_theme_swindow")), + GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + } + i++; + } + + if (! current_theme_found) + { + GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view); + GtkTreeIter iter; + + 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); + if (window_initial_scroll) + { + GtkTreePath *path; + + 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 && window_initial_scroll) + { + 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); + initial_scroll = FALSE; + } + window_setting_model = FALSE; + + g_free (current_theme); +} + static void theme_key_changed (GConfClient *client, guint cnxn_id, @@ -206,6 +365,17 @@ theme_key_changed (GConfClient *client, read_themes ((GladeXML *)user_data); } +static void +window_theme_key_changed (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) +{ + if (strcmp (entry->key, WINDOW_THEME_KEY)) + return; + + window_read_themes ((GladeXML *)user_data); +} static void theme_changed_func (gpointer uri, @@ -273,6 +443,34 @@ transfer_done_idle_cb (gpointer data) return FALSE; } +static void +window_show_manage_themes (GtkWidget *button, gpointer data) +{ + gchar *path, *command; + GnomeVFSURI *uri; + GnomeWindowManager *wm; + + wm = gnome_wm_manager_get_current (); + + path = gnome_window_manager_get_user_theme_folder (wm); + g_object_unref (G_OBJECT (wm)); + + uri = gnome_vfs_uri_new (path); + + if (!gnome_vfs_uri_exists (uri)) { + /* Create the directory */ + gnome_vfs_make_directory_for_uri (uri, 0775); + } + gnome_vfs_uri_unref (uri); + + + command = g_strdup_printf ("nautilus --no-desktop %s", path); + g_free (path); + + g_spawn_command_line_async (command, NULL); + g_free (command); +} + static void transfer_done_cb (GtkWidget *dlg, gchar *path) { @@ -435,37 +633,55 @@ cb_dialog_response (GtkDialog *dialog, gint response_id) gtk_main_quit (); } +void +setup_theme_tree (GtkTreeView *tree_view, GCallback theme_selection_changed_cb) +{ + GtkTreeModel *model; + GtkTreeSelection *selection; + + gtk_tree_view_insert_column_with_attributes (tree_view, + -1, NULL, + gtk_cell_renderer_text_new (), + "text", THEME_NAME_COLUMN, + NULL); + + model = (GtkTreeModel *) gtk_list_store_new (N_COLUMNS, G_TYPE_STRING); + gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), 0, sort_func, NULL, NULL); + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), 0, GTK_SORT_ASCENDING); + gtk_tree_view_set_model (tree_view, model); + selection = gtk_tree_view_get_selection (tree_view); + gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); + g_signal_connect (G_OBJECT (selection), "changed", (GCallback) theme_selection_changed_cb, NULL);} + + static void setup_dialog (GladeXML *dialog) { GConfClient *client; GtkWidget *widget, *parent; - GtkTreeModel *model; - GtkTreeSelection *selection; client = gconf_client_get_default (); parent = WID ("theme_dialog"); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (WID ("theme_treeview")), - -1, NULL, - gtk_cell_renderer_text_new (), - "text", THEME_NAME_COLUMN, - NULL); + setup_theme_tree (GTK_TREE_VIEW (WID ("theme_treeview")), (GCallback)theme_selection_changed); + setup_theme_tree (GTK_TREE_VIEW (WID ("window_theme_treeview")), (GCallback)window_theme_selection_changed); + gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + gconf_client_add_dir (client, "/desktop/gnome/applications/window_manager", + GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + gconf_client_notify_add (client, GTK_THEME_KEY, (GConfClientNotifyFunc) &theme_key_changed, dialog, NULL, NULL); - - model = (GtkTreeModel *) gtk_list_store_new (N_COLUMNS, G_TYPE_STRING); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), 0, sort_func, NULL, NULL); - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), 0, GTK_SORT_ASCENDING); - gtk_tree_view_set_model (GTK_TREE_VIEW (WID ("theme_treeview")), model); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("theme_treeview"))); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); - g_signal_connect (G_OBJECT (selection), "changed", (GCallback) theme_selection_changed, NULL); + gconf_client_notify_add (client, + WINDOW_THEME_KEY, + (GConfClientNotifyFunc) &window_theme_key_changed, + dialog, NULL, NULL); read_themes (dialog); + window_read_themes (dialog); + theme_common_register_theme_change (theme_changed_func, dialog); widget = WID ("install_button"); @@ -474,10 +690,17 @@ setup_dialog (GladeXML *dialog) widget = WID ("manage_button"); g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (show_manage_themes), dialog); + g_signal_connect (G_OBJECT (WID ("window_manage_button")), "clicked", + G_CALLBACK (window_show_manage_themes), dialog); + + /* + g_signal_connect (G_OBJECT (WID ("install_dialog")), "response", + G_CALLBACK (install_dialog_response), dialog); + */ g_signal_connect (G_OBJECT (parent), - "response", - G_CALLBACK (cb_dialog_response), NULL); + "response", + G_CALLBACK (cb_dialog_response), NULL); gtk_drag_dest_set (parent, GTK_DEST_DEFAULT_ALL, drop_types, n_drop_types, @@ -512,6 +735,8 @@ main (int argc, char *argv[]) activate_settings_daemon (); dialog = create_dialog (); + gnome_wm_manager_init (WID ("theme_dialog")); + setup_dialog (dialog); gtk_main (); diff --git a/capplets/ui-properties/gnome-ui-properties.glade b/capplets/ui-properties/gnome-ui-properties.glade index 6e8044882..801ac6b49 100644 --- a/capplets/ui-properties/gnome-ui-properties.glade +++ b/capplets/ui-properties/gnome-ui-properties.glade @@ -11,7 +11,7 @@ 400 True False - True + False @@ -21,8 +21,10 @@ + 5 True GTK_BUTTONBOX_END + 10 diff --git a/capplets/windows/ChangeLog b/capplets/windows/ChangeLog index 458463c21..ef5e203d6 100644 --- a/capplets/windows/ChangeLog +++ b/capplets/windows/ChangeLog @@ -1,3 +1,14 @@ +2002-08-08 Seth Nickell + + * metacity-window-manager.c: (metacity_set_theme), + (add_themes_from_dir), (metacity_get_theme_list), + (metacity_set_font), (metacity_set_focus_follows_mouse), + (metacity_get_user_theme_folder), + (metacity_window_manager_class_init): + + Implement all calls for metacity, and check more error + stuff. + 2002-06-17 Jody Goldberg * Release 2.0.0 diff --git a/capplets/windows/gnome-window-properties.glade b/capplets/windows/gnome-window-properties.glade index e4f061440..780f5c78d 100644 --- a/capplets/windows/gnome-window-properties.glade +++ b/capplets/windows/gnome-window-properties.glade @@ -15,7 +15,7 @@ - 9 + 5 True False 5 diff --git a/capplets/windows/metacity-window-manager.c b/capplets/windows/metacity-window-manager.c index c0955e218..1f4d3bb04 100644 --- a/capplets/windows/metacity-window-manager.c +++ b/capplets/windows/metacity-window-manager.c @@ -7,6 +7,8 @@ #define METACITY_THEME_KEY "/apps/metacity/general/theme" #define METACITY_FONT_KEY "/apps/metacity/general/titlebar_font" #define METACITY_FOCUS_KEY "/apps/metacity/general/focus_mode" +#define METACITY_USE_SYSTEM_FONT_KEY "/apps/metacity/titlebar_uses_system_font" + static GnomeWindowManagerClass *parent_class; struct _MetacityWindowManagerPrivate { @@ -24,7 +26,7 @@ window_manager_new (void) } static void -metacity_set_theme (const char *theme_name) +metacity_set_theme (GnomeWindowManager *wm, const char *theme_name) { gconf_client_set_string (gconf_client_get_default (), METACITY_THEME_KEY, @@ -40,6 +42,10 @@ add_themes_from_dir (GList *current_list, const char *path) GList *node; gboolean found = FALSE; + if (!(g_file_test (path, G_FILE_TEST_EXISTS) && g_file_test (path, G_FILE_TEST_IS_DIR))) { + return current_list; + } + theme_dir = opendir (path); for (entry = readdir (theme_dir); entry != NULL; entry = readdir (theme_dir)) { @@ -66,7 +72,7 @@ add_themes_from_dir (GList *current_list, const char *path) } static GList * -metacity_get_theme_list (void) +metacity_get_theme_list (GnomeWindowManager *wm) { GList *themes = NULL; char *home_dir_themes; @@ -83,15 +89,18 @@ metacity_get_theme_list (void) } static void -metacity_set_font (const char *font) +metacity_set_font (GnomeWindowManager *wm, const char *font) { - gconf_client_set_string (gconf_client_get_default (), - METACITY_FONT_KEY, - font, NULL); + GConfClient *client; + + client = gconf_client_get_default (); + + gconf_client_set_bool (client, METACITY_USE_SYSTEM_FONT_KEY, FALSE, NULL); + gconf_client_set_string (client, METACITY_FONT_KEY, font, NULL); } static void -metacity_set_focus_follows_mouse (gboolean focus_follows_mouse) +metacity_set_focus_follows_mouse (GnomeWindowManager *wm, gboolean focus_follows_mouse) { const char *focus_mode; @@ -106,6 +115,11 @@ metacity_set_focus_follows_mouse (gboolean focus_follows_mouse) focus_mode, NULL); } +static char * +metacity_get_user_theme_folder (GnomeWindowManager *wm) +{ + return g_build_filename (g_get_home_dir (), ".metacity/themes", NULL); +} static void metacity_window_manager_init (MetacityWindowManager *metacity_window_manager, MetacityWindowManagerClass *class) @@ -144,6 +158,7 @@ metacity_window_manager_class_init (MetacityWindowManagerClass *class) wm_class->get_theme_list = metacity_get_theme_list; wm_class->set_font = metacity_set_font; wm_class->set_focus_follows_mouse = metacity_set_focus_follows_mouse; + wm_class->get_user_theme_folder = metacity_get_user_theme_folder; parent_class = g_type_class_peek_parent (class); } diff --git a/configure.in b/configure.in index ddfa6cea6..6bfc7aa84 100644 --- a/configure.in +++ b/configure.in @@ -54,7 +54,7 @@ dnl ============================================== COMMON_MODULES="gtk+-2.0 gconf-2.0 libgnomeui-2.0 libglade-2.0 >= 1.99.12 libbonobo-2.0 libbonoboui-2.0 libglade-2.0 gconf-2.0 gnome-desktop-2.0" PKG_CHECK_MODULES(CAPPLET, $COMMON_MODULES) PKG_CHECK_MODULES(GNOMECC, $COMMON_MODULES libxml-2.0 gnome-desktop-2.0 gnome-vfs-2.0) -PKG_CHECK_MODULES(GNOME_SETTINGS_DAEMON, gtk+-2.0 gconf-2.0 libgnomeui-2.0 esound) +PKG_CHECK_MODULES(GNOME_SETTINGS_DAEMON, gtk+-2.0 gconf-2.0 libgnomeui-2.0 esound gnome-desktop-2.0) PKG_CHECK_MODULES(OLD_CAPPLET, libgnomeui-2.0 libglade-2.0) PKG_CHECK_MODULES(GNOME, libgnomeui-2.0) PKG_CHECK_MODULES(VFS_CAPPLET, $COMMON_MODULES gnome-vfs-module-2.0 gnome-vfs-2.0) diff --git a/gnome-settings-daemon/Makefile.am b/gnome-settings-daemon/Makefile.am index 1e9dc8205..4af1bed42 100644 --- a/gnome-settings-daemon/Makefile.am +++ b/gnome-settings-daemon/Makefile.am @@ -41,9 +41,10 @@ gnome_settings_daemon_SOURCES = \ # $(AccessX_files) gnome_settings_daemon_LDADD = \ - $(GNOME_SETTINGS_DAEMON_LIBS) \ - $(top_builddir)/libbackground/libbackground.la \ - $(top_builddir)/libsounds/libsounds.a \ + $(GNOME_SETTINGS_DAEMON_LIBS) \ + $(top_builddir)/libbackground/libbackground.la \ + $(top_builddir)/libsounds/libsounds.a \ + -L$(top_builddir)/libwindow-settings/ -lgnome-window-settings \ $(XF86MISC_LIBS) #AccessX_files = \ diff --git a/gnome-settings-daemon/gnome-settings-wm.c b/gnome-settings-daemon/gnome-settings-wm.c index 36acf27ac..c26a498ed 100644 --- a/gnome-settings-daemon/gnome-settings-wm.c +++ b/gnome-settings-daemon/gnome-settings-wm.c @@ -5,6 +5,8 @@ #include #include +#include + static void set_number_of_workspaces (int workspaces) { @@ -61,6 +63,8 @@ set_workspace_names (GSList *values) static void wm_callback (GConfEntry *entry) { + GnomeWindowManager *wm; + if (!strcmp (entry->key, "/desktop/gnome/applications/window_manager/number_of_workspaces")) { if (entry->value->type == GCONF_VALUE_INT) set_number_of_workspaces (gconf_value_get_int (entry->value)); @@ -70,11 +74,26 @@ wm_callback (GConfEntry *entry) gconf_value_get_list_type (entry->value) == GCONF_VALUE_STRING) set_workspace_names (gconf_value_get_list (entry->value)); } + else if (!strcmp (entry->key, "/desktop/gnome/applications/window_manager/theme")) { + wm = gnome_wm_manager_get_current (); + if (wm != NULL) { + gnome_window_manager_set_theme (wm, gconf_value_get_string (entry->value)); + } + } + else if (!strcmp (entry->key, "/desktop/gnome/applications/window_manager/titlebar_font")) { + wm = gnome_wm_manager_get_current (); + gnome_window_manager_set_font (wm, gconf_value_get_string (entry->value)); + } + else if (!strcmp (entry->key, "/desktop/gnome/applications/window_manager/focus_follows_mouse")) { + wm = gnome_wm_manager_get_current (); + gnome_window_manager_set_focus_follows_mouse (wm, gconf_value_get_bool (entry->value)); + } } void gnome_settings_wm_init (GConfClient *client) { + gnome_wm_manager_init (NULL); gnome_settings_daemon_register_callback ("/desktop/gnome/applications/window_manager", wm_callback); } diff --git a/libwindow-settings/ChangeLog b/libwindow-settings/ChangeLog index 983749c60..65d0b14db 100644 --- a/libwindow-settings/ChangeLog +++ b/libwindow-settings/ChangeLog @@ -1,3 +1,15 @@ +2002-08-08 Seth Nickell + + * gnome-window-manager.c: (gnome_window_manager_set_theme), + (gnome_window_manager_get_theme_list), + (gnome_window_manager_set_font), + (gnome_window_manager_set_focus_follows_mouse), + (gnome_window_manager_get_user_theme_folder), + (gnome_window_manager_class_init): + * gnome-window-manager.h: + + Add get_user_theme_folder, fix some minor bugs. + 2002-06-17 Jody Goldberg * Release 2.0.0 diff --git a/libwindow-settings/gnome-window-manager.c b/libwindow-settings/gnome-window-manager.c index aae755098..7a8b1eaf7 100644 --- a/libwindow-settings/gnome-window-manager.c +++ b/libwindow-settings/gnome-window-manager.c @@ -62,28 +62,35 @@ void gnome_window_manager_set_theme (GnomeWindowManager *wm, const char *theme_name) { GnomeWindowManagerClass *klass = GNOME_WINDOW_MANAGER_GET_CLASS (wm); - klass->set_theme (theme_name); + klass->set_theme (wm, theme_name); } GList * gnome_window_manager_get_theme_list (GnomeWindowManager *wm) { GnomeWindowManagerClass *klass = GNOME_WINDOW_MANAGER_GET_CLASS (wm); - return klass->get_theme_list (); + return klass->get_theme_list (wm); } void gnome_window_manager_set_font (GnomeWindowManager *wm, const char *font) { GnomeWindowManagerClass *klass = GNOME_WINDOW_MANAGER_GET_CLASS (wm); - klass->set_font (font); + klass->set_font (wm, font); } void gnome_window_manager_set_focus_follows_mouse (GnomeWindowManager *wm, gboolean focus_follows_mouse) { GnomeWindowManagerClass *klass = GNOME_WINDOW_MANAGER_GET_CLASS (wm); - klass->set_focus_follows_mouse (focus_follows_mouse); + klass->set_focus_follows_mouse (wm, focus_follows_mouse); +} + +char * +gnome_window_manager_get_user_theme_folder (GnomeWindowManager *wm) +{ + GnomeWindowManagerClass *klass = GNOME_WINDOW_MANAGER_GET_CLASS (wm); + return klass->get_user_theme_folder (wm); } static void @@ -123,6 +130,7 @@ gnome_window_manager_class_init (GnomeWindowManagerClass *class) wm_class->get_theme_list = NULL; wm_class->set_font = NULL; wm_class->set_focus_follows_mouse = NULL; + wm_class->get_user_theme_folder = NULL; parent_class = g_type_class_peek_parent (class); } diff --git a/libwindow-settings/gnome-window-manager.h b/libwindow-settings/gnome-window-manager.h index 8c78f6c4a..f8a5842f6 100644 --- a/libwindow-settings/gnome-window-manager.h +++ b/libwindow-settings/gnome-window-manager.h @@ -30,11 +30,11 @@ struct _GnomeWindowManagerClass { GObjectClass klass; - void (*set_theme) (const char *theme_name); - GList * (*get_theme_list) (void); - void (*set_font) (const char *font); - void (*set_focus_follows_mouse) (gboolean focus_follows_mouse); - + void (*set_theme) (GnomeWindowManager *wm, const char *theme_name); + GList * (*get_theme_list) (GnomeWindowManager *wm); + void (*set_font) (GnomeWindowManager *wm, const char *font); + void (*set_focus_follows_mouse) (GnomeWindowManager *wm, gboolean focus_follows_mouse); + char * (*get_user_theme_folder) (GnomeWindowManager *wm); }; @@ -48,6 +48,7 @@ void gnome_window_manager_set_theme (GnomeWindowMana GList * gnome_window_manager_get_theme_list (GnomeWindowManager *wm); void gnome_window_manager_set_font (GnomeWindowManager *wm, const char *font); void gnome_window_manager_set_focus_follows_mouse (GnomeWindowManager *wm, gboolean focus_follows_mouse); +char * gnome_window_manager_get_user_theme_folder (GnomeWindowManager *wm); G_END_DECLS