gnome-terminal r3218 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r3218 - trunk/src
- Date: Wed, 26 Nov 2008 15:19:55 +0000 (UTC)
Author: chpe
Date: Wed Nov 26 15:19:55 2008
New Revision: 3218
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=3218&view=rev
Log:
Use the background-image property for background images. That way, the
GdkPixbuf is shared between all tabs using the same profile.
Modified:
trunk/src/terminal-profile.c
trunk/src/terminal-screen.c
Modified: trunk/src/terminal-profile.c
==============================================================================
--- trunk/src/terminal-profile.c (original)
+++ trunk/src/terminal-profile.c Wed Nov 26 15:19:55 2008
@@ -284,6 +284,10 @@
guint prop_id,
const GValue *value,
GParamSpec *pspec);
+static void ensure_pixbuf_property (TerminalProfile *profile,
+ guint path_prop_id,
+ guint pixbuf_prop_id,
+ gboolean *load_failed);
static guint signals[LAST_SIGNAL];
static GQuark gconf_key_quark;
@@ -329,6 +333,9 @@
if (!pspec)
return NULL;
+ if (G_UNLIKELY (pspec->param_id == PROP_BACKGROUND_IMAGE))
+ ensure_pixbuf_property (profile, PROP_BACKGROUND_IMAGE_FILE, PROP_BACKGROUND_IMAGE, &priv->background_load_failed);
+
return g_value_array_get_nth (priv->properties, pspec->param_id);
}
@@ -444,7 +451,7 @@
pixbuf = gdk_pixbuf_new_from_file (path, &error);
if (!pixbuf)
{
- NOTE (g_printerr ("Failed to load image \"%s\": %s\n", filename_utf8, error->message);)
+ NOTE (g_printerr ("Failed to load image \"%s\": %s\n", path, error->message);)
g_error_free (error);
g_free (path);
goto failed;
@@ -1042,6 +1049,7 @@
return;
}
+ /* Note: When adding things here, do the same in get_prop_value_from_prop_name! */
switch (prop_id)
{
case PROP_BACKGROUND_IMAGE:
Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c (original)
+++ trunk/src/terminal-screen.c Wed Nov 26 15:19:55 2008
@@ -237,16 +237,6 @@
}
static void
-set_background_image_file (VteTerminal *terminal,
- const char *fname)
-{
- if (fname && fname[0])
- vte_terminal_set_background_image_file (terminal,fname);
- else
- vte_terminal_set_background_image (terminal, NULL);
-}
-
-static void
terminal_screen_class_enable_menu_bar_accel_notify_cb (TerminalApp *app,
GParamSpec *pspec,
TerminalScreenClass *klass)
@@ -927,23 +917,24 @@
if (!prop_name ||
prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TYPE) ||
- prop_name == I_(TERMINAL_PROFILE_BACKGROUND_IMAGE_FILE) ||
+ prop_name == I_(TERMINAL_PROFILE_BACKGROUND_IMAGE) ||
prop_name == I_(TERMINAL_PROFILE_BACKGROUND_DARKNESS) ||
prop_name == I_(TERMINAL_PROFILE_SCROLL_BACKGROUND))
{
bg_type = terminal_profile_get_property_enum (profile, TERMINAL_PROFILE_BACKGROUND_TYPE);
-
+
+ g_print ("changing bg type %d\n", bg_type);
if (bg_type == TERMINAL_BACKGROUND_IMAGE)
{
- /* FIXME: use the BACKGROUND property intead */
- set_background_image_file (vte_terminal,
- terminal_profile_get_property_string (profile, TERMINAL_PROFILE_BACKGROUND_IMAGE_FILE));
+ g_print ("Setting backgr %p\n", terminal_profile_get_property_object (profile, TERMINAL_PROFILE_BACKGROUND_IMAGE));
+ vte_terminal_set_background_image (vte_terminal,
+ terminal_profile_get_property_object (profile, TERMINAL_PROFILE_BACKGROUND_IMAGE));
vte_terminal_set_scroll_background (vte_terminal,
terminal_profile_get_property_boolean (profile, TERMINAL_PROFILE_SCROLL_BACKGROUND));
}
else
{
- set_background_image_file (vte_terminal, NULL);
+ vte_terminal_set_background_image (vte_terminal, NULL);
vte_terminal_set_scroll_background (vte_terminal, FALSE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]