More fixes. Change layout in glade a bit, make DND work, fix widget

2002-02-06  Seth Nickell  <snickell@stanford.edu>

	* 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.
This commit is contained in:
Seth Nickell 2002-02-07 05:46:36 +00:00 committed by Seth Nickell
parent 35522f6f30
commit 54d7e22f60
4 changed files with 240 additions and 207 deletions

View file

@ -1,3 +1,15 @@
2002-02-06 Seth Nickell <snickell@stanford.edu>
* 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 <lauris@ximian.com>
* background-properties-capplet.c (setup_color_widgets): Kill warning

View file

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

View file

@ -191,167 +191,18 @@ background picture.</property>
</child>
<child>
<widget class="GtkHBox" id="hbox17">
<property name="homogeneous">no</property>
<property name="spacing">0</property>
<property name="visible">yes</property>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0.75</property>
<property name="yscale">1</property>
<property name="visible">yes</property>
<child>
<widget class="GtkHBox" id="color_box">
<property name="homogeneous">no</property>
<property name="spacing">10</property>
<property name="visible">yes</property>
<child>
<widget class="GtkHBox" id="color1_box">
<property name="border_width">4</property>
<property name="homogeneous">no</property>
<property name="spacing">5</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="color1_label">
<property name="label" translatable="yes">Color 1</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
<child>
<widget class="GnomeColorPicker" id="color1">
<property name="can_focus">yes</property>
<property name="dither">yes</property>
<property name="use_alpha">no</property>
<property name="title" translatable="yes">Pick a color</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="color2_box">
<property name="border_width">4</property>
<property name="homogeneous">no</property>
<property name="spacing">5</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="color2_label">
<property name="label" translatable="yes">Color 2</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
<child>
<widget class="GnomeColorPicker" id="color2">
<property name="can_focus">yes</property>
<property name="dither">yes</property>
<property name="use_alpha">no</property>
<property name="title" translatable="yes">Pick a color</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox10">
<widget class="GtkVBox" id="vbox22">
<property name="border_width">10</property>
<property name="homogeneous">no</property>
<property name="spacing">0</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="label34">
<property name="label" translatable="yes"></property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="border_shading_label">
<property name="label" translatable="yes">Border the picture with a </property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="label" translatable="yes">Border the picture with a:</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">no</property>
<property name="xalign">0.5</property>
<property name="xalign">7.45058e-09</property>
<property name="yalign">0.5</property>
<property name="xpad">3</property>
<property name="ypad">0</property>
@ -364,6 +215,18 @@ background picture.</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox10">
<property name="homogeneous">no</property>
<property name="spacing">0</property>
<property name="visible">yes</property>
<child>
<widget class="GtkVBox" id="vbox23">
<property name="homogeneous">no</property>
<property name="spacing">0</property>
<property name="visible">yes</property>
<child>
<widget class="GtkOptionMenu" id="border_shading">
<property name="can_focus">yes</property>
@ -431,6 +294,143 @@ background picture.</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="color_box">
<property name="homogeneous">no</property>
<property name="spacing">10</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="label40">
<property name="label" translatable="yes"></property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">no</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="color1_box">
<property name="homogeneous">no</property>
<property name="spacing">3</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="color1_label">
<property name="label" translatable="yes">Color 1</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
<child>
<widget class="GnomeColorPicker" id="color1">
<property name="can_focus">yes</property>
<property name="dither">yes</property>
<property name="use_alpha">no</property>
<property name="title" translatable="yes">Pick a color</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="color2_box">
<property name="homogeneous">no</property>
<property name="spacing">3</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="color2_label">
<property name="label" translatable="yes">Color 2</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
<child>
<widget class="GnomeColorPicker" id="color2">
<property name="can_focus">yes</property>
<property name="dither">yes</property>
<property name="use_alpha">no</property>
<property name="title" translatable="yes">Pick a color</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>

View file

@ -191,8 +191,9 @@ background picture.</label>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox17</name>
<class>GtkVBox</class>
<name>vbox22</name>
<border_width>10</border_width>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
@ -203,30 +204,94 @@ background picture.</label>
</child>
<widget>
<class>GtkAlignment</class>
<name>alignment1</name>
<xalign>0.5</xalign>
<class>GtkLabel</class>
<name>border_shading_label</name>
<label>Border the picture with a:</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>7.45058e-09</xalign>
<yalign>0.5</yalign>
<xscale>0.75</xscale>
<yscale>1</yscale>
<xpad>3</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox10</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkVBox</class>
<name>vbox23</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkOptionMenu</class>
<name>border_shading</name>
<can_focus>True</can_focus>
<items>Solid Colour
Horizontal Gradient
Vertical Gradient
</items>
<initial_choice>0</initial_choice>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>color_box</name>
<homogeneous>False</homogeneous>
<spacing>10</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label40</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>color1_box</name>
<border_width>4</border_width>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<spacing>3</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
@ -268,9 +333,8 @@ background picture.</label>
<widget>
<class>GtkHBox</class>
<name>color2_box</name>
<border_width>4</border_width>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
<spacing>3</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
@ -312,70 +376,6 @@ background picture.</label>
</widget>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox10</name>
<border_width>10</border_width>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkLabel</class>
<name>label34</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>border_shading_label</name>
<label>Border the picture with a </label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>3</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkOptionMenu</class>
<name>border_shading</name>
<can_focus>True</can_focus>
<items>Solid Colour
Horizontal Gradient
Vertical Gradient
</items>
<initial_choice>0</initial_choice>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame5</name>