gnome-terminal r2807 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r2807 - trunk/src
- Date: Thu, 29 May 2008 19:56:06 +0000 (UTC)
Author: chpe
Date: Thu May 29 19:56:06 2008
New Revision: 2807
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2807&view=rev
Log:
Add a setting for cursor blink mode. No UI, just GConf. Bug #533522.
Modified:
trunk/src/gnome-terminal.schemas.in
trunk/src/terminal-profile.c
trunk/src/terminal-profile.h
trunk/src/terminal-screen.c
Modified: trunk/src/gnome-terminal.schemas.in
==============================================================================
--- trunk/src/gnome-terminal.schemas.in (original)
+++ trunk/src/gnome-terminal.schemas.in Thu May 29 19:56:06 2008
@@ -385,7 +385,22 @@
</locale>
</schema>
- <schema>
+ <schema>
+ <key>/schemas/apps/gnome-terminal/profiles/Default/cursor_blink_mode</key>
+ <applyto>/apps/gnome-terminal/profiles/Default/cursor_blink_mode</applyto>
+ <owner>gnome-terminal</owner>
+ <type>string</type>
+ <default>system/default>
+ <locale name="C">
+ <short>Whether to blink the cursor</short>
+ <long>
+ The possible values are "system" to use the global cursor blinking
+ settings, or "on" or "off" to set the mode explicitly.
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/gnome-terminal/profiles/Default/custom_command</key>
<applyto>/apps/gnome-terminal/profiles/Default/custom_command</applyto>
<owner>gnome-terminal</owner>
@@ -594,7 +609,6 @@
</locale>
</schema>
-
<schema>
<key>/schemas/apps/gnome-terminal/profiles/Default/use_skey</key>
<applyto>/apps/gnome-terminal/profiles/Default/use_skey</applyto>
Modified: trunk/src/terminal-profile.c
==============================================================================
--- trunk/src/terminal-profile.c (original)
+++ trunk/src/terminal-profile.c Thu May 29 19:56:06 2008
@@ -59,6 +59,7 @@
PROP_BACKGROUND_IMAGE_FILE,
PROP_BACKGROUND_TYPE,
PROP_BACKSPACE_BINDING,
+ PROP_CURSOR_BLINK_MODE,
PROP_CUSTOM_COMMAND,
PROP_DEFAULT_SHOW_MENUBAR,
PROP_DELETE_BINDING,
@@ -93,6 +94,7 @@
#define KEY_BACKGROUND_IMAGE_FILE "background_image"
#define KEY_BACKGROUND_TYPE "background_type"
#define KEY_BACKSPACE_BINDING "backspace_binding"
+#define KEY_CURSOR_BLINK_MODE "cursor_blink_mode"
#define KEY_CUSTOM_COMMAND "custom_command"
#define KEY_DEFAULT_SHOW_MENUBAR "default_show_menubar"
#define KEY_DELETE_BINDING "delete_binding"
@@ -126,6 +128,7 @@
#define DEFAULT_BACKGROUND_IMAGE (NULL)
#define DEFAULT_BACKGROUND_TYPE (TERMINAL_BACKGROUND_SOLID)
#define DEFAULT_BACKSPACE_BINDING (VTE_ERASE_ASCII_DELETE)
+#define DEFAULT_CURSOR_BLINK_MODE (TERMINAL_CURSOR_BLINK_SYSTEM)
#define DEFAULT_CUSTOM_COMMAND ("")
#define DEFAULT_DEFAULT_SHOW_MENUBAR (TRUE)
#define DEFAULT_DELETE_BINDING (VTE_ERASE_DELETE_SEQUENCE)
@@ -1299,6 +1302,7 @@
TERMINAL_PROFILE_PROPERTY_ENUM (BACKGROUND_TYPE, TERMINAL_TYPE_BACKGROUND_TYPE, DEFAULT_BACKGROUND_TYPE, KEY_BACKGROUND_TYPE);
TERMINAL_PROFILE_PROPERTY_ENUM (BACKSPACE_BINDING, vte_terminal_erase_binding_get_type (), DEFAULT_BACKSPACE_BINDING, KEY_BACKSPACE_BINDING);
+ TERMINAL_PROFILE_PROPERTY_ENUM (CURSOR_BLINK_MODE, TERMINAL_TYPE_CURSOR_BLINK_MODE, DEFAULT_CURSOR_BLINK_MODE, KEY_CURSOR_BLINK_MODE);
TERMINAL_PROFILE_PROPERTY_ENUM (DELETE_BINDING, vte_terminal_erase_binding_get_type (), DEFAULT_DELETE_BINDING, KEY_DELETE_BINDING);
TERMINAL_PROFILE_PROPERTY_ENUM (EXIT_ACTION, TERMINAL_TYPE_EXIT_ACTION, DEFAULT_EXIT_ACTION, KEY_EXIT_ACTION);
TERMINAL_PROFILE_PROPERTY_ENUM (SCROLLBAR_POSITION, TERMINAL_TYPE_SCROLLBAR_POSITION, DEFAULT_SCROLLBAR_POSITION, KEY_SCROLLBAR_POSITION);
Modified: trunk/src/terminal-profile.h
==============================================================================
--- trunk/src/terminal-profile.h (original)
+++ trunk/src/terminal-profile.h Thu May 29 19:56:06 2008
@@ -56,6 +56,13 @@
TERMINAL_BACKGROUND_TRANSPARENT
} TerminalBackgroundType;
+typedef enum
+{
+ TERMINAL_CURSOR_BLINK_SYSTEM,
+ TERMINAL_CURSOR_BLINK_ON,
+ TERMINAL_CURSOR_BLINK_OFF
+} TerminalCursorBlinkMode;
+
#define TERMINAL_PALETTE_SIZE 16
#define TERMINAL_PALETTE_TANGO 0
@@ -72,6 +79,7 @@
#define TERMINAL_PROFILE_BACKGROUND_IMAGE_FILE "background-image-file"
#define TERMINAL_PROFILE_BACKGROUND_TYPE "background-type"
#define TERMINAL_PROFILE_BACKSPACE_BINDING "backspace-binding"
+#define TERMINAL_PROFILE_CURSOR_BLINK_MODE "cursor-blink-mode"
#define TERMINAL_PROFILE_CUSTOM_COMMAND "custom-command"
#define TERMINAL_PROFILE_DEFAULT_SHOW_MENUBAR "default-show-menubar"
#define TERMINAL_PROFILE_DELETE_BINDING "delete-binding"
Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c (original)
+++ trunk/src/terminal-screen.c Thu May 29 19:56:06 2008
@@ -225,20 +225,31 @@
}
static void
-terminal_screen_sync_settings (GtkSettings *settings,
- GParamSpec *pspec,
- TerminalScreen *screen)
+terminal_screen_update_cursor_blink (TerminalScreen *screen,
+ GtkSettings *settings)
{
+ TerminalScreenPrivate *priv = screen->priv;
+ TerminalCursorBlinkMode mode;
gboolean blink;
- g_object_get (G_OBJECT (settings),
- "gtk-cursor-blink", &blink,
- NULL);
+ mode = terminal_profile_get_property_enum (priv->profile, TERMINAL_PROFILE_CURSOR_BLINK_MODE);
+ if (mode == TERMINAL_CURSOR_BLINK_SYSTEM)
+ g_object_get (settings, "gtk-cursor-blink", &blink, NULL);
+ else
+ blink = (mode == TERMINAL_CURSOR_BLINK_ON);
vte_terminal_set_cursor_blinks (VTE_TERMINAL (screen), blink);
}
static void
+terminal_screen_sync_settings (GtkSettings *settings,
+ GParamSpec *pspec,
+ TerminalScreen *screen)
+{
+ terminal_screen_update_cursor_blink (screen, settings);
+}
+
+static void
terminal_screen_screen_changed (GtkWidget *widget, GdkScreen *previous_screen)
{
GdkScreen *screen;
@@ -791,6 +802,9 @@
vte_terminal_set_allow_bold (vte_terminal,
terminal_profile_get_property_boolean (profile, TERMINAL_PROFILE_ALLOW_BOLD));
+ if (!prop_name || prop_name == I_(TERMINAL_PROFILE_CURSOR_BLINK_MODE))
+ terminal_screen_update_cursor_blink (screen, gtk_widget_get_settings (GTK_WIDGET (screen)));
+
/* if (GTK_WIDGET_REALIZED (screen))
terminal_screen_change_font (screen);*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]