summaryrefslogtreecommitdiff
path: root/development/eovim/dd8f0.patch
blob: 9b9722a037cd8e351ffc5fdbb476965f8d33160f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
From dd8f0d3fff4951cd7b7ea294823b8e377024c2ff Mon Sep 17 00:00:00 2001
From: Jean Guyomarc'h <jean@guyomarch.bzh>
Date: Sat, 12 Jan 2019 08:47:35 +0100
Subject: [PATCH] gui: make an overlay fade when the UI is attached to neovim

---
 data/themes/default.edc | 29 +++++++++++++++++++++++++++++
 include/eovim/gui.h     |  1 +
 src/gui.c               |  5 +++++
 src/nvim.c              |  9 +++++++--
 4 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/data/themes/default.edc b/data/themes/default.edc
index 27703fc..7f8d0e3 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -430,6 +430,19 @@ collections {
                visible: 0;
             }
          }
+
+         rect { "overlay"; nomouse;
+            desc { "default";
+               color: 40 40 40 255;;
+            }
+            desc { "fade";
+               color: 40 40 40 0;
+            }
+            desc { "faded";
+               inherit: "fade";
+               visible: 0; /* Make sure it is killed */
+            }
+         }
       }
 
       programs {
@@ -437,6 +450,22 @@ collections {
             action: PLAY_SAMPLE "bell" 1.0 ALERT;
          }
 
+         /* [OVERLAY FADING] **************************************************
+          * When eovim starts, we push an overlay that covers the whole window.
+          * When neovim is successfully attached to the UI, we make the overlay
+          * fade away, so we can begin to use neovim. */
+         program { signal: "eovim,ready"; source: "eovim";
+            action: STATE_SET "fade";
+            target: "overlay";
+            transition: ACCELERATE 0.2;
+            after: "eovim_overlay_faded";
+         }
+         program { name: "eovim_overlay_faded";
+            action: STATE_SET "faded";
+            target: "overlay";
+         }
+         /* END OVERLAY FADING ***********************************************/
+
          program { signal: "eovim,cmdline,show"; source: "eovim";
             action: STATE_SET "default";
             target: "eovim.cmdline";
diff --git a/include/eovim/gui.h b/include/eovim/gui.h
index f05fb97..981e957 100644
--- a/include/eovim/gui.h
+++ b/include/eovim/gui.h
@@ -192,6 +192,7 @@ void gui_caps_lock_alert(s_gui *gui);
 void gui_caps_lock_dismiss(s_gui *gui);
 Eina_Bool gui_caps_lock_warning_get(const s_gui *gui);
 
+void gui_ready_set(s_gui *gui);
 void gui_mode_update(s_gui *gui, const s_mode *mode);
 
 #endif /* ! __EOVIM_GUI_H__ */
diff --git a/src/gui.c b/src/gui.c
index 96dcdcd..efd476b 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -893,6 +893,11 @@ gui_bell_ring(s_gui *gui)
      elm_layout_signal_emit(gui->layout, "eovim,bell,ring", "eovim");
 }
 
+void gui_ready_set(s_gui *gui)
+{
+   elm_layout_signal_emit(gui->layout, "eovim,ready", "eovim");
+}
+
 static void
 _compl_item_del(void *data,
                 Evas_Object *obj EINA_UNUSED)
diff --git a/src/nvim.c b/src/nvim.c
index a003a00..dcf263d 100644
--- a/src/nvim.c
+++ b/src/nvim.c
@@ -49,8 +49,13 @@ static void _api_decode_cb(s_nvim *nvim, void *data, const msgpack_object *resul
  *                                 Private API                                *
  *============================================================================*/
 
-static inline s_nvim *
-_nvim_get(void)
+static void _ui_attached_cb(s_nvim *nvim, void *data EINA_UNUSED,
+                            const msgpack_object *result EINA_UNUSED)
+{
+  gui_ready_set(&nvim->gui);
+}
+
+static inline s_nvim *_nvim_get(void)
 {
    /* We handle only one neovim instance */
    return _nvim_instance;