From e3746a7c31e345adfbf799934115c974e670a37c Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Fri, 6 Oct 2023 22:14:37 +0300

Subject: [PATCH 1/1] DocumentWidget: Fixed "Paste Preceding Line" keyboard

shortcut

The dynamic menu is empty while not open.


src/ui/documentwidget.c | 32 +++++++++++++++++++++-----------

src/ui/util.c | 2 +-

2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c

index 9fa5298f..8b2e2c06 100644

--- a/src/ui/documentwidget.c

+++ b/src/ui/documentwidget.c

@@ -2033,27 +2033,36 @@ static iBool setUrl_DocumentWidget_(iDocumentWidget *d, const iString *url) {

 return iFalse;

}

+static void makePastePrecedingLineMenuItem_(iMenuItem *item_out, const iWidget *buttons,

+}

static const iArray *updateInputPromptMenuItems_(iWidget *menu) {

 const char     *context       = cstr_String(&menu->data);

 const iWidget  *buttons       = pointerLabel_Command(context, "buttons");

 const iString  *url           = string_Command(context, "url");

 const char     *precedingLine = suffixPtr_Command(context, "preceding");

 /* Compose new menu items. */

 iArray *items = collectNew_Array(sizeof(iMenuItem));

 pushBackN_Array(

     items,

     (iMenuItem[]){

         { "---" },

         { !isPromptUrl_SiteSpec(url) ? "${menu.input.setprompt}" : "${menu.input.unsetprompt}",

           0,

           0,

           format_CStr("!prompturl.toggle url:%s", cstr_String(url)) } },

 /* Recently submitted input texts can be restored. */ {

     const iStringArray *recentInput = recentlySubmittedInput_App();

     if (!isEmpty_StringArray(recentInput)) {

@@ -2130,8 +2139,13 @@ iWidget *makeInputPrompt_DocumentWidget(iDocumentWidget *d, const iString *url,

 if (lineBreak && deviceType_App() != desktop_AppDeviceType) {

     addChildPos_Widget(buttons, iClob(lineBreak), front_WidgetAddPos);

 }

 /* Menu for additional actions, past entries. */ {

     iLabelWidget *ellipsisButton =

         makeMenuButton_LabelWidget(midEllipsis_Icon, NULL, 0);

     iWidget *menu = findChild_Widget(as_Widget(ellipsisButton), "menu");

@@ -2142,10 +2156,6 @@ iWidget *makeInputPrompt_DocumentWidget(iDocumentWidget *d, const iString *url,

                                        buttons,

                                        cstr_String(canonicalUrl_String(url)),

                                        cstr_String(&d->linePrecedingLink)));

     if (deviceType_App() == desktop_AppDeviceType) {

         addChildPos_Widget(buttons, iClob(ellipsisButton), front_WidgetAddPos);

     }

diff --git a/src/ui/util.c b/src/ui/util.c

index b45c345b..727cd788 100644

--- a/src/ui/util.c

+++ b/src/ui/util.c

@@ -2588,7 +2588,7 @@ iWidget *makeValueInputWithAdditionalActions_Widget(iWidget *parent, const iStri

     pushBack_Array(&actions, &(iMenuItem){ "---" });

 }

 pushBack_Array(&actions, &(iMenuItem){ "${cancel}", SDLK_ESCAPE, 0, "valueinput.cancel" });

     pushBack_Array(&actions, &(iMenuItem){ "---" });

 }

 pushBack_Array(&actions,

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/dev/patch/6912fc30105379da4e7ad49e64e86a32700ae00b.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
27.835953 milliseconds
Gemini-to-HTML Time
2.453208 milliseconds

This content has been proxied by September (ba2dc).