Use applier_render_color_p (real_realize_cb): Ditto
2001-09-14 Bradford Hovinen <hovinen@ximian.com> * background-properties-capplet.c (property_change_cb): Use applier_render_color_p (real_realize_cb): Ditto * applier.c (applier_render_color_p): Renamed from applier_render_gradient_p; check both solid color and gradient * preferences.c (preferences_need_color_opts): Removed; use applier_render_color_p instead
This commit is contained in:
parent
84cbbbff3e
commit
862ce9a11b
5 changed files with 23 additions and 59 deletions
|
@ -1,3 +1,15 @@
|
|||
2001-09-14 Bradford Hovinen <hovinen@ximian.com>
|
||||
|
||||
* background-properties-capplet.c (property_change_cb): Use
|
||||
applier_render_color_p
|
||||
(real_realize_cb): Ditto
|
||||
|
||||
* applier.c (applier_render_color_p): Renamed from
|
||||
applier_render_gradient_p; check both solid color and gradient
|
||||
|
||||
* preferences.c (preferences_need_color_opts): Removed; use
|
||||
applier_render_color_p instead
|
||||
|
||||
2001-09-13 Bradford Hovinen <hovinen@ximian.com>
|
||||
|
||||
* preferences.c (preferences_load_from_bonobo_db):
|
||||
|
|
|
@ -410,9 +410,14 @@ applier_apply_prefs (Applier *applier,
|
|||
}
|
||||
|
||||
gboolean
|
||||
applier_render_gradient_p (Applier *applier)
|
||||
applier_render_color_p (Applier *applier)
|
||||
{
|
||||
return render_gradient_p (applier->private->preview_renderer, applier->private->preview_prefs);
|
||||
return !(applier->private->preview_prefs->wallpaper_enabled &&
|
||||
!applier->private->preview_prefs->adjust_opacity &&
|
||||
((applier->private->preview_prefs->wallpaper_type == WPTYPE_TILED ||
|
||||
applier->private->preview_prefs->wallpaper_type == WPTYPE_SCALED) ||
|
||||
(applier->private->preview_renderer->wwidth >= applier->private->preview_renderer->width &&
|
||||
applier->private->preview_renderer->wheight >= applier->private->preview_renderer->height)));
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
|
|
|
@ -61,7 +61,7 @@ void applier_apply_prefs (Applier *applier,
|
|||
gboolean do_root,
|
||||
gboolean do_preview);
|
||||
|
||||
gboolean applier_render_gradient_p (Applier *applier);
|
||||
gboolean applier_render_color_p (Applier *applier);
|
||||
|
||||
GtkWidget *applier_get_preview_widget (Applier *applier);
|
||||
GdkPixbuf *applier_get_wallpaper_pixbuf (Applier *applier);
|
||||
|
|
|
@ -213,13 +213,8 @@ property_change_cb (BonoboListener *listener,
|
|||
if (!strcmp (event_name, "Bonobo/Property:change:wallpaper_type")
|
||||
|| !strcmp (event_name, "Bonobo/Property:change:wallpaper_filename")
|
||||
|| !strcmp (event_name, "Bonobo/Property:change:wallpaper_enabled"))
|
||||
{
|
||||
gtk_widget_set_sensitive (
|
||||
WID ("color_frame"),
|
||||
preferences_need_color_opts (
|
||||
prefs,
|
||||
applier_get_wallpaper_pixbuf (applier)));
|
||||
}
|
||||
gtk_widget_set_sensitive
|
||||
(WID ("color_frame"), applier_render_color_p (applier));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -237,11 +232,7 @@ real_realize_cb (Preferences *prefs)
|
|||
|
||||
applier_apply_prefs (applier, prefs, FALSE, TRUE);
|
||||
|
||||
gtk_widget_set_sensitive (
|
||||
WID ("color_frame"),
|
||||
preferences_need_color_opts (
|
||||
prefs,
|
||||
applier_get_wallpaper_pixbuf (applier)));
|
||||
gtk_widget_set_sensitive (WID ("color_frame"), applier_render_color_p (applier));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -432,50 +432,6 @@ bonobo_color_to_gdk (const Bonobo_Config_Color *color)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* It'd be nice if we could just get the pixbuf the applier uses, for
|
||||
* efficiency's sake */
|
||||
gboolean
|
||||
preferences_need_color_opts (Preferences *prefs, GdkPixbuf *wallpaper_pixbuf)
|
||||
{
|
||||
int s_width, s_height;
|
||||
int p_width, p_height;
|
||||
|
||||
g_return_val_if_fail (prefs != NULL, TRUE);
|
||||
|
||||
if (!(prefs->wallpaper_enabled && prefs->wallpaper_filename))
|
||||
return TRUE;
|
||||
|
||||
if (!wallpaper_pixbuf)
|
||||
return TRUE;
|
||||
|
||||
p_width = gdk_pixbuf_get_width (wallpaper_pixbuf);
|
||||
p_height = gdk_pixbuf_get_height (wallpaper_pixbuf);
|
||||
|
||||
s_width = gdk_screen_width ();
|
||||
s_height = gdk_screen_height ();
|
||||
|
||||
switch (prefs->wallpaper_type)
|
||||
{
|
||||
case WPTYPE_CENTERED:
|
||||
if (p_width >= s_width && p_height >= s_height)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
break;
|
||||
case WPTYPE_SCALED_ASPECT:
|
||||
if (s_width == p_width && s_height == p_height)
|
||||
return FALSE;
|
||||
else if (((double) s_width / (double) s_height)
|
||||
== ((double) p_width / (double) p_height))
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static gulong
|
||||
local_bonobo_property_bag_client_get_value_gulong (Bonobo_PropertyBag pb,
|
||||
const gchar *propname,
|
||||
|
|
Loading…
Add table
Reference in a new issue