diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2008-09-22 07:32:45 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2008-09-22 07:32:45 +0000 |
| commit | b8e0c9c5086952cfce987ceb685d90aebfd36f4a (patch) | |
| tree | 1206cc53d17b4ecba849cdc0d0845506f2efebc9 /src/text-context.cpp | |
| parent | hide item instead of unreffing, and unref arena to prevent memory leak (diff) | |
| download | inkscape-b8e0c9c5086952cfce987ceb685d90aebfd36f4a.tar.gz inkscape-b8e0c9c5086952cfce987ceb685d90aebfd36f4a.zip | |
Adjust blink time and base frequency on gtk setting. Fixes bug #272605.
(bzr r6869)
Diffstat (limited to 'src/text-context.cpp')
| -rw-r--r-- | src/text-context.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/text-context.cpp b/src/text-context.cpp index 28384b620..9d7fe3c03 100644 --- a/src/text-context.cpp +++ b/src/text-context.cpp @@ -208,6 +208,14 @@ sp_text_context_setup(SPEventContext *ec) { SPTextContext *tc = SP_TEXT_CONTEXT(ec); SPDesktop *desktop = ec->desktop; + GtkSettings* settings = gtk_settings_get_default(); + gint timeout = 0; + g_object_get( settings, "gtk-cursor-blink-time", &timeout, NULL ); + if (timeout < 0) { + timeout = 200; + } else { + timeout /= 2; + } tc->cursor = sp_canvas_item_new(sp_desktop_controls(desktop), SP_TYPE_CTRLLINE, NULL); sp_ctrlline_set_coords(SP_CTRLLINE(tc->cursor), 100, 0, 100, 100); @@ -224,7 +232,7 @@ sp_text_context_setup(SPEventContext *ec) SP_CTRLRECT(tc->frame)->setColor(0x0000ff7f, false, 0); sp_canvas_item_hide(tc->frame); - tc->timeout = gtk_timeout_add(200, (GtkFunction) sp_text_context_timeout, ec); + tc->timeout = gtk_timeout_add(timeout, (GtkFunction) sp_text_context_timeout, ec); tc->imc = gtk_im_multicontext_new(); if (tc->imc) { @@ -1655,12 +1663,13 @@ static gint sp_text_context_timeout(SPTextContext *tc) { if (tc->show) { + sp_canvas_item_show(tc->cursor); if (tc->phase) { tc->phase = 0; - sp_canvas_item_hide(tc->cursor); + sp_ctrlline_set_rgba32(SP_CTRLLINE(tc->cursor), 0xffffffff); } else { tc->phase = 1; - sp_canvas_item_show(tc->cursor); + sp_ctrlline_set_rgba32(SP_CTRLLINE(tc->cursor), 0x000000ff); } } |
