Replace GnomeColorPicker with the GtkColorButton widget Some properties
2005-07-25 Sebastien Bacher <seb128@debian.org> * gnome-background-properties.glade: Replace GnomeColorPicker with the GtkColorButton widget Some properties were added by newer version of glade * gnome-wp-capplet.c (gnome_wp_props_wp_set): (gnome_wp_[s]color_changed, gnome_wp_color[12]_changed): (gnome_wp_load_stuffs, wallpaper_properties_init): Update to use the API for GtkColorButton instead of GnomeColorPicker Fixes #171676
This commit is contained in:
parent
84b6e2e24e
commit
06ca0fa30b
3 changed files with 93 additions and 41 deletions
|
@ -1,3 +1,16 @@
|
|||
2005-07-25 Sebastien Bacher <seb128@debian.org>
|
||||
|
||||
* gnome-background-properties.glade: Replace GnomeColorPicker with
|
||||
the GtkColorButton widget
|
||||
Some properties were added by newer version of glade
|
||||
|
||||
* gnome-wp-capplet.c (gnome_wp_props_wp_set):
|
||||
(gnome_wp_[s]color_changed, gnome_wp_color[12]_changed):
|
||||
(gnome_wp_load_stuffs, wallpaper_properties_init):
|
||||
Update to use the API for GtkColorButton instead of GnomeColorPicker
|
||||
|
||||
Fixes #171676
|
||||
|
||||
2005-07-14 Rodney Dawes <dobey@novell.com>
|
||||
|
||||
* gnome-wp-xml.c (gnome_wp_xml_load_xml): If xmlParseFile returns
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
<property name="default_height">418</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="has_separator">False</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
|
@ -35,6 +41,7 @@
|
|||
<property name="label">gtk-help</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-11</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
@ -47,6 +54,7 @@
|
|||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-7</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
@ -80,6 +88,10 @@
|
|||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">wp_tree</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -107,6 +119,10 @@
|
|||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -128,6 +144,10 @@
|
|||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -165,6 +185,9 @@
|
|||
<property name="rules_hint">False</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
<property name="fixed_height_mode">False</property>
|
||||
<property name="hover_selection">False</property>
|
||||
<property name="hover_expand">False</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -202,6 +225,10 @@
|
|||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">style_menu</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -230,6 +257,7 @@
|
|||
<property name="label">gtk-remove</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -244,6 +272,7 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
|
@ -252,6 +281,10 @@
|
|||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="yscale">0</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">0</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2">
|
||||
|
@ -289,6 +322,10 @@
|
|||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -343,6 +380,10 @@
|
|||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -365,6 +406,10 @@
|
|||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">color_menu</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -392,6 +437,10 @@
|
|||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -413,6 +462,10 @@
|
|||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -435,12 +488,14 @@
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GnomeColorPicker" id="pcpicker">
|
||||
<widget class="GtkColorButton" id="pcpicker">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="dither">True</property>
|
||||
<property name="use_alpha">False</property>
|
||||
<property name="title" translatable="yes">Pick a color</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<accessibility>
|
||||
<atkproperty name="AtkObject::accessible_description" translatable="yes">Open a dialog to specify the color</atkproperty>
|
||||
</accessibility>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -450,11 +505,14 @@
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GnomeColorPicker" id="scpicker">
|
||||
<widget class="GtkColorButton" id="scpicker">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="dither">True</property>
|
||||
<property name="use_alpha">False</property>
|
||||
<property name="title" translatable="yes">Pick a color</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<accessibility>
|
||||
<atkproperty name="AtkObject::accessible_description" translatable="yes">Open a dialog to specify the color</atkproperty>
|
||||
</accessibility>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
|
|
@ -306,14 +306,8 @@ static gboolean gnome_wp_props_wp_set (GnomeWPCapplet * capplet) {
|
|||
|
||||
gconf_change_set_unref (cs);
|
||||
|
||||
gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (capplet->pc_picker),
|
||||
item->pcolor->red,
|
||||
item->pcolor->green,
|
||||
item->pcolor->blue, 65535);
|
||||
gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (capplet->sc_picker),
|
||||
item->scolor->red,
|
||||
item->scolor->green,
|
||||
item->scolor->blue, 65535);
|
||||
gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->pc_picker), item->pcolor);
|
||||
gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->sc_picker), item->scolor);
|
||||
|
||||
g_free (wpfile);
|
||||
|
||||
|
@ -509,20 +503,18 @@ static void gnome_wp_color_changed (GnomeWPCapplet * capplet,
|
|||
}
|
||||
|
||||
g_free (item->pri_color);
|
||||
gnome_color_picker_get_i16 (GNOME_COLOR_PICKER (capplet->pc_picker),
|
||||
&item->pcolor->red,
|
||||
&item->pcolor->green,
|
||||
&item->pcolor->blue, NULL);
|
||||
|
||||
gtk_color_button_get_color (GTK_COLOR_BUTTON (capplet->pc_picker), item->pcolor);
|
||||
|
||||
item->pri_color = g_strdup_printf ("#%02X%02X%02X",
|
||||
item->pcolor->red >> 8,
|
||||
item->pcolor->green >> 8,
|
||||
item->pcolor->blue >> 8);
|
||||
|
||||
g_free (item->sec_color);
|
||||
gnome_color_picker_get_i16 (GNOME_COLOR_PICKER (capplet->sc_picker),
|
||||
&item->scolor->red,
|
||||
&item->scolor->green,
|
||||
&item->scolor->blue, NULL);
|
||||
|
||||
gtk_color_button_get_color (GTK_COLOR_BUTTON (capplet->sc_picker), item->scolor);
|
||||
|
||||
item->sec_color = g_strdup_printf ("#%02X%02X%02X",
|
||||
item->scolor->red >> 8,
|
||||
item->scolor->green >> 8,
|
||||
|
@ -553,7 +545,6 @@ static void gnome_wp_color_changed (GnomeWPCapplet * capplet,
|
|||
}
|
||||
|
||||
static void gnome_wp_scolor_changed (GtkWidget * widget,
|
||||
guint r, guint g, guint b, guint a,
|
||||
GnomeWPCapplet * capplet) {
|
||||
gnome_wp_color_changed (capplet, TRUE);
|
||||
}
|
||||
|
@ -620,14 +611,9 @@ static gboolean gnome_wp_load_stuffs (void * data) {
|
|||
gnome_wp_option_menu_set (capplet, item->options, FALSE);
|
||||
gnome_wp_option_menu_set (capplet, item->shade_type, TRUE);
|
||||
|
||||
gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (capplet->pc_picker),
|
||||
item->pcolor->red,
|
||||
item->pcolor->green,
|
||||
item->pcolor->blue, 65535);
|
||||
gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (capplet->sc_picker),
|
||||
item->scolor->red,
|
||||
item->scolor->green,
|
||||
item->scolor->blue, 65535);
|
||||
gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->pc_picker), item->pcolor);
|
||||
gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->sc_picker), item->pcolor);
|
||||
|
||||
} else if (strcmp (style, "none") != 0) {
|
||||
item = gnome_wp_add_image (capplet, imagepath);
|
||||
gnome_wp_capplet_scroll_to_item (capplet, item);
|
||||
|
@ -770,10 +756,8 @@ static void gnome_wp_color1_changed (GConfClient * client, guint id,
|
|||
|
||||
gdk_color_parse (colorhex, &color);
|
||||
|
||||
gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (capplet->pc_picker),
|
||||
color.red,
|
||||
color.green,
|
||||
color.blue, 65535);
|
||||
gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->pc_picker), &color);
|
||||
|
||||
|
||||
gnome_wp_color_changed (capplet, FALSE);
|
||||
}
|
||||
|
@ -788,10 +772,7 @@ static void gnome_wp_color2_changed (GConfClient * client, guint id,
|
|||
|
||||
gdk_color_parse (colorhex, &color);
|
||||
|
||||
gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (capplet->sc_picker),
|
||||
color.red,
|
||||
color.green,
|
||||
color.blue, 65535);
|
||||
gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->sc_picker), &color);
|
||||
|
||||
gnome_wp_color_changed (capplet, FALSE);
|
||||
}
|
||||
|
@ -1225,11 +1206,11 @@ static void wallpaper_properties_init (poptContext ctx) {
|
|||
G_CALLBACK (gnome_wp_shade_type_changed), capplet);
|
||||
|
||||
capplet->pc_picker = glade_xml_get_widget (dialog,"pcpicker");
|
||||
g_signal_connect (G_OBJECT (capplet->pc_picker), "color_set",
|
||||
g_signal_connect (G_OBJECT (capplet->pc_picker), "color-set",
|
||||
G_CALLBACK (gnome_wp_scolor_changed), capplet);
|
||||
|
||||
capplet->sc_picker = glade_xml_get_widget (dialog,"scpicker");
|
||||
g_signal_connect (G_OBJECT (capplet->sc_picker), "color_set",
|
||||
g_signal_connect (G_OBJECT (capplet->sc_picker), "color-set",
|
||||
G_CALLBACK (gnome_wp_scolor_changed), capplet);
|
||||
|
||||
g_signal_connect (G_OBJECT (capplet->window), "response",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue