G'day John,

> The idea here is good, but we need to work on the appearance to make it
> look like it belongs.. so it has that certain elegant something that makes
> it look like a finished product.  Two things are that it looks like the
> placement is arbitrary, and it doesn't work gracefully when input grows
> beyond the allocated width for the minibuffer input box.  I would like to
> see a version where:
>
>  * minibuffer-input is flex 1
>  * url-panel is flex 0
>  * url-panel has same background color as minibuffer-input
>  * url-panel uses sligthly smaller font size, and/or slightly grayed text.
>
> Let's try that and see if it has a more fitting look.

Below is a version of the patch that I think does most of what you've
asked for.  I've used an oblique font for the panel; I quite like the
appearance and it avoids the problems you pointed out with a smaller
font or grayed text.  It's not quite right; there's a grey separator
that should be white.

<<inline: url-panel-way-right.png>>

The text appearing flush right avoids the two problems you mentioned
(arbitrary placement and input too wide).  However, it has two usage
problems that bother me.

  * In the usual case (wide browser, short hint input) the text is
    displayed far removed from the input.  I think the adjacency given
    in both the former patch and in the original panel is important.

  * As different links are selected, the start of the link text jumps
    left and right (obviously, as it's right justified).  I find that
    very distracting and more difficult to scan.

My preference is for the panel to appear at a fixed offset, as in my
former patch, although in that case I don't know how to address your
point about the placement being arbitrary.  Perhaps that is less jarring
when the appearance makes it merge into the minibuffer-input.  To
address your second point, I'd like the minibuffer-input to expand when
required, pushing the panel to the right.  I'm not sure how to achieve
that yet; I'm doing cargo cult programming with the CSS.

Another consideration is that I think we should aim for visual (and
programmatic) consistency between the url panel display and overlink
mode.  If we use a special style (like oblique here) for the panel, then
the overlink display should do that too.

Regards, David.


Subject: [RFC] Place the URL panel to the right of the
 minibuffer.

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.  The panel is styled to appear to be part of the minibuffer.

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.

todo: There's a separator netween the minibuffer and the panel, which
is currently styled incorrectly.
---
 modules/hints.js                   |   15 +++++++--------
 style/default/hints--url-panel.css |    6 +++---
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/modules/hints.js b/modules/hints.js
index 9fa00f4..7308134 100644
--- a/modules/hints.js
+++ b/modules/hints.js
@@ -412,14 +412,13 @@ 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 p = g.element("label", window.minibuffer.element,
+                      "class", "url-panel-value",
+                      "crop", "end", "flex", "0");
+    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 {
@@ -427,13 +426,13 @@ 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);
     };
 
     return p;
diff --git a/style/default/hints--url-panel.css 
b/style/default/hints--url-panel.css
index 8a41a11..8c8fc68 100644
--- a/style/default/hints--url-panel.css
+++ b/style/default/hints--url-panel.css
@@ -5,8 +5,7 @@
   font-weight: bold;
 }
 
-.panel .url-panel-label {
-  font-weight: bold;
+.url-panel-value {
+   background-color: -moz-field;
+   font-style: oblique;
 }
-
-- 
1.7.6.3

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

Reply via email to