add new terminology option to disable that infernal cursor blinking; this should...
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 26 Jun 2012 08:05:43 +0000 (08:05 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 26 Jun 2012 08:05:43 +0000 (08:05 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/terminology@72856 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

data/themes/default.edc
src/bin/config.c
src/bin/config.h
src/bin/options_behavior.c
src/bin/termio.c

index 38f906f..eba0cf8 100644 (file)
@@ -510,6 +510,13 @@ collections {
             }
          }
          programs {
+            program { name: "focus_in_noblink";
+               signal: "focus,in,noblink";
+               source: "terminology";
+               action: STATE_SET "focused" 0.0;
+               target: "fill";
+               target: "outline";
+            }
             program { name: "focus_in";
                signal: "focus,in";
                source: "terminology";
index 562eda2..6b86328 100644 (file)
@@ -63,6 +63,8 @@ config_init(void)
    EET_DATA_DESCRIPTOR_ADD_BASIC
      (edd_base, Config, "flicker_on_key", flicker_on_key, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC
+     (edd_base, Config, "disable_cursor_blink", disable_cursor_blink, EET_T_UCHAR);
+   EET_DATA_DESCRIPTOR_ADD_BASIC
      (edd_base, Config, "translucent", translucent, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC
      (edd_base, Config, "mute", mute, EET_T_UCHAR);
@@ -141,6 +143,7 @@ config_load(const char *key)
         config->translucent = EINA_FALSE;
         config->jump_on_change = EINA_FALSE;
         config->flicker_on_key = EINA_TRUE;
+        config->disable_cursor_blink = EINA_TRUE;
         // XXX: add
         // 
         // // more invisible spaces
index c5a3b67..e54f1f4 100644 (file)
@@ -19,6 +19,7 @@ struct _Config
    int               vidmod;
    Eina_Bool         jump_on_change;
    Eina_Bool         flicker_on_key;
+   Eina_Bool         disable_cursor_blink;
    Eina_Bool         translucent;
    Eina_Bool         mute;
    Eina_Bool         urg_bell;
index 85c991f..49866f2 100644 (file)
@@ -20,6 +20,16 @@ _cb_op_behavior_jump_chg(void *data, Evas_Object *obj, void *event __UNUSED__)
 }
 
 static void
+_cb_op_behavior_cursor_blink_chg(void *data, Evas_Object *obj, void *event __UNUSED__)
+{
+   Evas_Object *term = data;
+   Config *config = termio_config_get(term);
+   config->disable_cursor_blink = elm_check_state_get(obj);
+   termio_config_update(term);
+   config_save(config, NULL);
+}
+
+static void
 _cb_op_behavior_flicker_chg(void *data, Evas_Object *obj, void *event __UNUSED__)
 {
    Evas_Object *term = data;
@@ -97,6 +107,16 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
    evas_object_show(o);
    evas_object_smart_callback_add(o, "changed",
                                   _cb_op_behavior_flicker_chg, term);
+
+   o = elm_check_add(opbox);
+   evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
+   elm_object_text_set(o, "Disable cursor blinking");
+   elm_check_state_set(o, config->disable_cursor_blink);
+   elm_box_pack_end(opbox, o);
+   evas_object_show(o);
+   evas_object_smart_callback_add(o, "changed",
+                                  _cb_op_behavior_cursor_blink_chg, term);
    
    o = elm_check_add(opbox);
    evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
index 757b7c5..0ac94ef 100644 (file)
@@ -526,7 +526,10 @@ _smart_cb_focus_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
 
    sd = evas_object_smart_data_get(data);
    if (!sd) return;
-   edje_object_signal_emit(sd->cur.obj, "focus,in", "terminology");
+   if (sd->config->disable_cursor_blink)
+     edje_object_signal_emit(sd->cur.obj, "focus,in,noblink", "terminology");
+   else
+     edje_object_signal_emit(sd->cur.obj, "focus,in", "terminology");
    if (!sd->win) return;
    elm_win_keyboard_mode_set(sd->win, ELM_WIN_KEYBOARD_TERMINAL);
    if (sd->imf)
@@ -1576,6 +1579,12 @@ termio_config_update(Evas_Object *obj)
 
    termpty_backscroll_set(sd->pty, sd->config->scrollback);
    sd->scroll = 0;
+
+   edje_object_signal_emit(sd->cur.obj, "focus,out", "terminology");
+   if (sd->config->disable_cursor_blink)
+     edje_object_signal_emit(sd->cur.obj, "focus,in,noblink", "terminology");
+   else
+     edje_object_signal_emit(sd->cur.obj, "focus,in", "terminology");
    
    evas_object_scale_set(sd->grid.obj, elm_config_scale_get());
    evas_object_textgrid_font_set(sd->grid.obj, sd->font.name, sd->font.size);