[gnome-control-center] background: Try to fix original state
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] background: Try to fix original state
- Date: Thu, 16 Dec 2010 18:38:26 +0000 (UTC)
commit 30d878cfd5cd720fc1bf090532f77531e9da76da
Author: Bastien Nocera <hadess hadess net>
Date: Thu Dec 16 13:07:55 2010 +0000
background: Try to fix original state
panels/background/cc-background-panel.c | 27 ++++++++++++++++++++++++---
1 files changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index 81ffa04..ba3badd 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -221,7 +221,6 @@ cc_background_panel_class_init (CcBackgroundPanelClass *klass)
static void
cc_background_panel_class_finalize (CcBackgroundPanelClass *klass)
{
-
}
static void
@@ -256,6 +255,27 @@ source_update_edit_box (CcBackgroundPanelPrivate *priv)
}
static void
+setup_edit_box (CcBackgroundPanelPrivate *priv)
+{
+ g_assert (priv->current_background);
+
+ if (g_str_equal (priv->current_background->filename, "(none)"))
+ {
+ gtk_widget_hide (WID ("style-combobox"));
+ gtk_widget_show (WID ("style-pcolor"));
+
+ if (priv->current_background->shade_type == G_DESKTOP_BACKGROUND_SHADING_SOLID)
+ gtk_widget_hide (WID ("style-scolor"));
+ else
+ gtk_widget_show (WID ("style-scolor"));
+ }
+ else
+ {
+ /* FIXME other cases */
+ }
+}
+
+static void
source_changed_cb (GtkComboBox *combo,
CcBackgroundPanelPrivate *priv)
{
@@ -814,9 +834,10 @@ cc_background_panel_init (CcBackgroundPanel *self)
gnome_wp_item_ensure_gnome_bg (priv->current_background);
gnome_wp_item_update_size (priv->current_background, priv->thumb_factory);
- /* FIXME hide the edit box as appropriate for the current background */
-
update_preview (priv, NULL, TRUE);
+
+ /* Setup the edit box with our current settings */
+ setup_edit_box (priv);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]