The new placement is better; it visually connects the URL display with
the minibuffer.  The result is more compact and has no need of a
label.  Because the input to a hints interaction will normally be
short the usual wide minibuffer is not needed, leaving plenty of room
on the same line for the URL display.

The panel was previously placed above the minibuffer, which
unnecessarily obscures part of the content buffer.  This change avoids
that problem, fixing http://bugs.conkeror.org/issue343.

---

Previously: http://thread.gmane.org/gmane.comp.mozilla.conkeror/2483
---
 content/minibuffer.xul             |    2 +-
 modules/hints.js                   |   20 ++++++++++++--------
 style/default/hints--url-panel.css |    5 -----
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/content/minibuffer.xul b/content/minibuffer.xul
index 34fc442..15840dd 100644
--- a/content/minibuffer.xul
+++ b/content/minibuffer.xul
@@ -15,7 +15,7 @@ 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"/>
+      <textbox class="plain" id="minibuffer-input" flex="1" minwidth="50pt"/>
     </hbox>
   </window>
 </overlay>
diff --git a/modules/hints.js b/modules/hints.js
index 67720d0..34d478d 100644
--- a/modules/hints.js
+++ b/modules/hints.js
@@ -410,14 +410,17 @@ hint_manager.prototype = {
 function hints_url_panel (hints, window) {
     var g = new dom_generator(window.document, XUL_NS);
 
-    var p = g.element("hbox", "class", "panel url", "flex", "0");
-    g.element("label", p, "value", "URL:", "class", "url-panel-label");
-    var url_value = g.element("label", p, "class", "url-panel-value",
-                              "crop", "end", "flex", "1");
-    window.minibuffer.insert_before(p);
+    var input = window.minibuffer.input_element;
+    input.setAttribute("flex", "0");
+    input.setAttribute("width", input.getAttribute("minwidth"));
+
+    var p = g.element("label", window.minibuffer.element,
+                      "class", "url-panel-value",
+                      "crop", "end", "flex", "1");
+    window.minibuffer.element.insertBefore(p, null);
 
     p.update = function () {
-       url_value.value = "";
+       p.value = "";
        if (hints.manager && hints.manager.last_selected_hint) {
             var spec;
             try {
@@ -425,13 +428,14 @@ function hints_url_panel (hints, window) {
             } catch (e) {}
             if (spec) {
                 var uri = load_spec_uri_string(spec);
-                if (uri) url_value.value = uri;
+                if (uri) p.value = uri;
             }
        }
     };
 
     p.destroy = function () {
-        this.parentNode.removeChild(this);
+        window.minibuffer.element.removeChild(p);
+        input.setAttribute("flex", "1");
     };
 
     return p;
diff --git a/style/default/hints--url-panel.css 
b/style/default/hints--url-panel.css
index 8a41a11..f55d682 100644
--- a/style/default/hints--url-panel.css
+++ b/style/default/hints--url-panel.css
@@ -4,8 +4,3 @@
 .panel .panel-row-label {
   font-weight: bold;
 }
-
-.panel .url-panel-label {
-  font-weight: bold;
-}
-
-- 
1.7.5.4

_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to