static void update_preview (CcBackgroundPanelPrivate *priv, CcBackgroundItem *item) { gboolean changes_with_time; if (item && priv->current_background) { g_object_unref (priv->current_background); priv->current_background = cc_background_item_copy (item); cc_background_item_load (priv->current_background, NULL); } changes_with_time = FALSE; if (priv->current_background) { changes_with_time = cc_background_item_changes_with_time (priv->current_background); } gtk_widget_set_visible (WID ("slide_image"), changes_with_time); gtk_widget_set_visible (WID ("slide-label"), changes_with_time); gtk_widget_queue_draw (WID ("background-desktop-drawingarea")); }
static void update_preview (CcBackgroundPanelPrivate *priv, CcBackgroundItem *item) { gchar *markup; gboolean changes_with_time; if (item && priv->current_background) { g_object_unref (priv->current_background); priv->current_background = cc_background_item_copy (item); cc_background_item_load (priv->current_background, NULL); } source_update_edit_box (priv, FALSE); changes_with_time = FALSE; if (priv->current_background) { GdkColor pcolor, scolor; markup = g_strdup_printf ("<b>%s</b>", cc_background_item_get_name (priv->current_background)); gtk_label_set_markup (GTK_LABEL (WID ("background-label")), markup); g_free (markup); gtk_label_set_text (GTK_LABEL (WID ("size_label")), cc_background_item_get_size (priv->current_background)); gdk_color_parse (cc_background_item_get_pcolor (priv->current_background), &pcolor); gdk_color_parse (cc_background_item_get_scolor (priv->current_background), &scolor); gtk_color_button_set_color (GTK_COLOR_BUTTON (WID ("style-pcolor")), &pcolor); gtk_color_button_set_color (GTK_COLOR_BUTTON (WID ("style-scolor")), &scolor); select_style (GTK_COMBO_BOX (WID ("style-combobox")), cc_background_item_get_placement (priv->current_background)); changes_with_time = cc_background_item_changes_with_time (priv->current_background); } gtk_widget_set_visible (WID ("slide_image"), changes_with_time); gtk_widget_set_visible (WID ("slide-label"), changes_with_time); gtk_widget_queue_draw (WID ("preview-area")); }
static void update_preview (CcBackgroundPanelPrivate *priv, GSettings *settings, CcBackgroundItem *item) { gboolean changes_with_time; CcBackgroundItem *current_background; current_background = CURRENT_BG; if (item && current_background) { g_object_unref (current_background); current_background = cc_background_item_copy (item); if (settings == priv->settings) priv->current_background = current_background; else priv->current_lock_background = current_background; cc_background_item_load (current_background, NULL); } changes_with_time = FALSE; if (current_background) { changes_with_time = cc_background_item_changes_with_time (current_background); } if (settings == priv->settings) { gtk_widget_set_visible (WID ("slide_image"), changes_with_time); gtk_widget_set_visible (WID ("slide-label"), changes_with_time); gtk_widget_queue_draw (WID ("background-desktop-drawingarea")); } else { gtk_widget_set_visible (WID ("slide_image1"), changes_with_time); gtk_widget_set_visible (WID ("slide-label1"), changes_with_time); gtk_widget_queue_draw (WID ("background-lock-drawingarea")); } }