Lagrange [work/v1.8]

InputWidget: Compact visual mode only when needed

=> 879960001df15f7163bf18c12d9bc676e6ed5b2f

diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index 897bbc08..fa3ce368 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -1130,8 +1130,11 @@ static void updateBuffered_InputWidget_(iInputWidget *d) {
         }
 #endif
         if (d->inFlags & isUrl_InputWidgetFlag) {
-            if (d->inFlags & omitDefaultSchemeIfNarrow_InputWidgetFlag && isNarrow_InputWidget_(d)) {
-                omitDefaultScheme_(visText);
+            if (d->inFlags & omitDefaultSchemeIfNarrow_InputWidgetFlag) {
+                if (measure_Text(d->font, cstr_String(visText)).advance.x >
+                    width_Rect(contentBounds_InputWidget_(d))) {
+                    omitDefaultScheme_(visText);
+                }
             }
             /* Highlight the host name. */
             iUrl parts;
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.8/cdiff/879960001df15f7163bf18c12d9bc676e6ed5b2f
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
58.046137 milliseconds
Gemini-to-HTML Time
0.194236 milliseconds

This content has been proxied by September (ba2dc).