From: Virgil Dupras <hsoft@hardcoded.net>
Date: Mon, 24 Apr 2017 02:47:22 +0000 (-0400)
Subject: Add hint display
X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=d01d8b589c996ad2c6d7997b3925e7900725b1c0;p=vimb.git

Add hint display

Pressing 'F' will show hints with the old styling from the master
branch.
---

diff --git a/src/config.def.h b/src/config.def.h
index 2682a9d..95e8970 100644
--- a/src/config.def.h
+++ b/src/config.def.h
@@ -50,3 +50,35 @@
 #define SETTING_GUI_FONT_NORMAL               "10pt monospace"
 #define SETTING_GUI_FONT_EMPH                 "bold 10pt monospace"
 #define SETTING_HOME_PAGE                     "about:blank"
+
+/* CSS style use on creating hints. This might also be averrules by css out of
+ * $XDG_CONFIG_HOME/vimb/style.css file. */
+#define HINT_CSS "#_hintContainer{\
+position:static\
+}\
+._hintLabel{\
+-webkit-transform:translate(-4px,-4px);\
+position:absolute;\
+z-index:100000;\
+font:bold .8em monospace;\
+color:#000;\
+background-color:#fff;\
+margin:0;\
+padding:0px 1px;\
+border:1px solid #444;\
+opacity:0.7\
+}\
+._hintElem{\
+background-color:#ff0 !important;\
+color:#000 !important;\
+transition:all 0 !important;\
+transition-delay:all 0 !important\
+}\
+._hintElem._hintFocus{\
+background-color:#8f0 !important\
+}\
+._hintLabel._hintFocus{\
+z-index:100001;\
+opacity:1\
+}"
+
diff --git a/src/scripts/hints.js b/src/scripts/hints.js
index 7f4dcf2..04cd51c 100644
--- a/src/scripts/hints.js
+++ b/src/scripts/hints.js
@@ -541,5 +541,5 @@ var hints = Object.freeze((function(){
 
 function testHint() {
     console.log("harmless testing!");
-    /* hints.init('t', false, 500, '', false, false); */
+    hints.init('t', false, 500, '0123456789', false, false);
 }
diff --git a/src/scripts/js2h.sh b/src/scripts/js2h.sh
index 82903d5..4a76777 100755
--- a/src/scripts/js2h.sh
+++ b/src/scripts/js2h.sh
@@ -32,7 +32,8 @@ sed -e 's:/\*[^*]*\*/::g' \
 # ecaspe
 sed -e 's|\\x20| |g' \
     -e 's|\\|\\\\|g' \
-    -e 's|"|\\"|g' | \
+    -e 's|"|\\"|g' \
+    -e 's|HINT_CSS|" HINT_CSS "|' | \
 # write opener with the starting and ending quote char
 sed -e "1s/^/#define $CONSTANT \"/" \
     -e '$s/$/"\n/'