From 54d7e22f6059d6c5762bc1a353e22e25c9d2f7e3 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Thu, 7 Feb 2002 05:46:36 +0000 Subject: [PATCH] More fixes. Change layout in glade a bit, make DND work, fix widget 2002-02-06 Seth Nickell * background-properties-capplet.c: (drag_motion_cb), (drag_leave_cb), (drag_data_received_cb), (change_background_type_toggles), (set_background_picture), (quit_cb), (main): * background-properties.glade: * background-properties.glade1: More fixes. Change layout in glade a bit, make DND work, fix widget previews. --- capplets/background/ChangeLog | 12 + .../background-properties-capplet.c | 31 ++- .../background/background-properties.glade | 254 +++++++++--------- .../background/background-properties.glade1 | 150 +++++------ 4 files changed, 240 insertions(+), 207 deletions(-) diff --git a/capplets/background/ChangeLog b/capplets/background/ChangeLog index b821adca5..a2625d2cb 100644 --- a/capplets/background/ChangeLog +++ b/capplets/background/ChangeLog @@ -1,3 +1,15 @@ +2002-02-06 Seth Nickell + + * background-properties-capplet.c: (drag_motion_cb), + (drag_leave_cb), (drag_data_received_cb), + (change_background_type_toggles), (set_background_picture), + (quit_cb), (main): + * background-properties.glade: + * background-properties.glade1: + + More fixes. Change layout in glade a bit, make DND work, + fix widget previews. + 2002-02-04 Lauris Kaplinski * background-properties-capplet.c (setup_color_widgets): Kill warning diff --git a/capplets/background/background-properties-capplet.c b/capplets/background/background-properties-capplet.c index a304251de..71a7382ee 100644 --- a/capplets/background/background-properties-capplet.c +++ b/capplets/background/background-properties-capplet.c @@ -182,6 +182,7 @@ static gboolean drag_motion_cb (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, gpointer data) { + printf ("motion\n"); return FALSE; } @@ -189,6 +190,7 @@ static void drag_leave_cb (GtkWidget *widget, GdkDragContext *context, guint time, gpointer data) { + printf ("left\n"); gtk_widget_queue_draw (widget); } @@ -202,6 +204,8 @@ drag_data_received_cb (GtkWidget *widget, GdkDragContext *context, GList *uris; GnomeVFSURI *uri; + printf ("received\n"); + if (info == TARGET_URI_LIST) { uris = gnome_vfs_uri_list_parse ((gchar *) selection_data-> data); @@ -620,9 +624,9 @@ change_background_type_toggles (BackgroundType background_type, GtkWidget **togg gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle_array[background_type]), TRUE); if (background_type == BACKGROUND_TYPE_NO_PICTURE) { - gtk_label_set_text (GTK_LABEL (border_shading_label), "Fill the background with a "); + gtk_label_set_text (GTK_LABEL (border_shading_label), "Fill the background with a:"); } else { - gtk_label_set_text (GTK_LABEL (border_shading_label), "Border the picture with a "); + gtk_label_set_text (GTK_LABEL (border_shading_label), "Border the picture with a:"); } } @@ -651,6 +655,12 @@ set_background_picture (const char *filename) bg_preferences_load (BG_PREFERENCES (bg_preferences)); update_preview_widgets (BG_PREFERENCES (bg_preferences), appliers, BG_APPLIER (bg_root_applier)); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle_array[BACKGROUND_TYPE_NO_PICTURE]))) { + /* no picture is selected, change to centered so people don't get confused as + to why the image isn't "taking */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle_array[BACKGROUND_TYPE_CENTERED]), TRUE); + } } @@ -762,6 +772,12 @@ dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *c } } +static void +quit_cb (GtkWidget *widget, gpointer data) +{ + gtk_main_quit(); +} + int main (int argc, char **argv) { @@ -826,14 +842,19 @@ main (int argc, char **argv) gtk_drag_dest_set (dialog_win, GTK_DEST_DEFAULT_ALL, drop_types, n_drop_types, GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_MOVE); - g_signal_connect (G_OBJECT (dialog_win), "drag_motion", + g_signal_connect (G_OBJECT (dialog_win), "drag-motion", G_CALLBACK (drag_motion_cb), NULL); - g_signal_connect (G_OBJECT (dialog_win), "drag_leave", + g_signal_connect (G_OBJECT (dialog_win), "drag-leave", G_CALLBACK (drag_leave_cb), NULL); - g_signal_connect (G_OBJECT (dialog_win), "drag_data_received", + g_signal_connect (G_OBJECT (dialog_win), "drag-data-received", G_CALLBACK (drag_data_received_cb), NULL); + g_signal_connect (G_OBJECT (dialog_win), "close", + G_CALLBACK (quit_cb), NULL); + g_signal_connect (G_OBJECT (dialog_win), "response", + G_CALLBACK (quit_cb), NULL); + gtk_widget_show_all (dialog_win); orientation = string_to_orientation (gconf_client_get_string (gconf_client, BG_PREFERENCES_COLOR_SHADING_TYPE, NULL)); diff --git a/capplets/background/background-properties.glade b/capplets/background/background-properties.glade index 499d60b6a..21505f632 100644 --- a/capplets/background/background-properties.glade +++ b/capplets/background/background-properties.glade @@ -191,18 +191,115 @@ background picture. - + + 10 no 0 yes - - 0.5 + + Border the picture with a: + GTK_JUSTIFY_LEFT + no + 7.45058e-09 0.5 - 0.75 - 1 + 3 + 0 yes + + + 0 + no + no + + + + + + no + 0 + yes + + + + no + 0 + yes + + + + yes + 0 + yes + + + + yes + + + + yes + + + + Solid Colour + 0.0 + convertwidget2 + yes + yes + + + + + + + + yes + + + + Horizontal Gradient + 0.0 + convertwidget3 + yes + yes + + + + + + + + yes + + + + Vertical Gradient + 0.0 + convertwidget4 + yes + yes + + + + + + + + + 0 + no + no + + + + + 0 + no + no + + @@ -210,11 +307,28 @@ background picture. 10 yes + + + + GTK_JUSTIFY_CENTER + no + 0.5 + 0.5 + 0 + 0 + yes + + + 0 + yes + no + + + - 4 no - 5 + 3 yes @@ -259,9 +373,8 @@ background picture. - 4 no - 5 + 3 yes @@ -304,6 +417,11 @@ background picture. + + 0 + yes + yes + @@ -321,124 +439,6 @@ background picture. - - - 10 - no - 0 - yes - - - - - GTK_JUSTIFY_CENTER - no - 0.5 - 0.5 - 0 - 0 - yes - - - 0 - yes - yes - - - - - - Border the picture with a - GTK_JUSTIFY_CENTER - no - 0.5 - 0.5 - 3 - 0 - yes - - - 0 - no - no - - - - - - yes - 0 - yes - - - - yes - - - - yes - - - - Solid Colour - 0.0 - convertwidget2 - yes - yes - - - - - - - - yes - - - - Horizontal Gradient - 0.0 - convertwidget3 - yes - yes - - - - - - - - yes - - - - Vertical Gradient - 0.0 - convertwidget4 - yes - yes - - - - - - - - - 0 - no - no - - - - - 0 - yes - yes - GTK_PACK_END - - - 10 diff --git a/capplets/background/background-properties.glade1 b/capplets/background/background-properties.glade1 index b6b3684ef..ef04d4260 100644 --- a/capplets/background/background-properties.glade1 +++ b/capplets/background/background-properties.glade1 @@ -191,8 +191,9 @@ background picture. - GtkHBox - hbox17 + GtkVBox + vbox22 + 10 False 0 @@ -203,30 +204,94 @@ background picture. - GtkAlignment - alignment1 - 0.5 + GtkLabel + border_shading_label + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 0.5 - 0.75 - 1 + 3 + 0 + + 0 + False + False + + + + + GtkHBox + hbox10 + False + 0 0 True True + + GtkVBox + vbox23 + False + 0 + + 0 + False + False + + + + GtkOptionMenu + border_shading + True + Solid Colour +Horizontal Gradient +Vertical Gradient + + 0 + + 0 + False + False + + + + GtkHBox color_box False 10 + + 0 + True + True + + + + GtkLabel + label40 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + True + False + + GtkHBox color1_box - 4 False - 5 + 3 0 False @@ -268,9 +333,8 @@ background picture. GtkHBox color2_box - 4 False - 5 + 3 0 False @@ -312,70 +376,6 @@ background picture. - - GtkHBox - hbox10 - 10 - False - 0 - - 0 - True - True - GTK_PACK_END - - - - GtkLabel - label34 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - True - True - - - - - GtkLabel - border_shading_label - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 3 - 0 - - 0 - False - False - - - - - GtkOptionMenu - border_shading - True - Solid Colour -Horizontal Gradient -Vertical Gradient - - 0 - - 0 - False - False - - - - GtkFrame frame5