From 879960001df15f7163bf18c12d9bc676e6ed5b2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Fri, 26 May 2023 22:23:16 +0300
Subject: [PATCH 1/1] InputWidget: Compact visual mode only when needed
Omit the scheme if the URL doesn't fit in the content width.
src/ui/inputwidget.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
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;
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).