Previously when the space allocated to the minibuffer input filled up,
its text would be truncated. Now the info display will be pushed over
to make more room.
The implementation is more heavy weight than desired. It would have
been preferred to have the textbox expand as needed by itself, but
there doesn't seem to be a way to do that. The next best thing would
be to query the width of the text, but there doesn't seem to be any
way to do that either. Instead the implementation makes a deck of the
textbox with a label, and updates the label with the info text, so its
width controls the textbox width. Gross.
TODO:
It's currently a stack, rather than a deck, so I can see the label
too. It needs a bit of fiddling to line up properly with the textbox.
When the text gets very long the label causes the width of the
internal window to expand, so that the mode line and content become
truncated. Fixing this looks overly complicated.
---
content/minibuffer.css | 2 +-
content/minibuffer.xul | 5 ++++-
modules/hints.js | 8 ++++++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/content/minibuffer.css b/content/minibuffer.css
index 2e52eb7..f0c5338 100644
--- a/content/minibuffer.css
+++ b/content/minibuffer.css
@@ -8,7 +8,7 @@
**/
#minibuffer[minibuffermode="message"] #minibuffer-prompt,
-#minibuffer[minibuffermode="message"] #minibuffer-input,
+#minibuffer[minibuffermode="message"] #minibuffer-input-deck,
#minibuffer[minibuffermode="message"] #minibuffer-info,
#minibuffer[minibuffermode="input"] #minibuffer-message,
#minibuffer[minibuffermode="input"] #minibuffer-mode-indicator {
diff --git a/content/minibuffer.xul b/content/minibuffer.xul
index 8f8b3e0..c027908 100644
--- a/content/minibuffer.xul
+++ b/content/minibuffer.xul
@@ -15,7 +15,10 @@ COPYING file.
<hbox id="minibuffer" minibuffermode="message">
<label class="minibuffer" id="minibuffer-message" flex="1" crop="right"
value=""/>
<label class="minibuffer" id="minibuffer-prompt" crop="left" value=""/>
- <textbox class="plain" id="minibuffer-input" flex="1" minwidth="50pt"/>
+ <stack id="minibuffer-input-deck" flex="1">
+ <textbox class="plain" id="minibuffer-input" minwidth="50pt"/>
+ <label class="plain" id="minibuffer-input-shadow"/>
+ </stack>
<label class="plain" id="minibuffer-info" flex="1" crop="right"
collapsed="true"/>
</hbox>
</window>
diff --git a/modules/hints.js b/modules/hints.js
index bec21d3..3940cfa 100644
--- a/modules/hints.js
+++ b/modules/hints.js
@@ -423,9 +423,11 @@ hint_manager.prototype = {
function hints_info_display (hints, window) {
this.hints = hints;
this.input = window.minibuffer.input_element;
+ this.shadow = window.document.getElementById("minibuffer-input-shadow");
this.info = window.document.getElementById("minibuffer-info");
+ this.input_deck = window.document.getElementById("minibuffer-input-deck");
- this.input.setAttribute("flex", "0");
+ this.input_deck.setAttribute("flex", "0");
this.input.setAttribute("width", this.input.getAttribute("minwidth"));
this.info.setAttribute("collapsed", "false");
}
@@ -457,12 +459,14 @@ hints_info_display.prototype = {
}
}
this.info.value = s.join(" ");
+ this.shadow.value = this.hints.typed_string;
},
destroy: function () {
+ this.shadow.value = "";
this.info.value = "";
this.info.setAttribute("collapsed", "true");
- this.input.setAttribute("flex", "1");
+ this.input_deck.setAttribute("flex", "1");
}
};
--
1.7.7
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror