From a941788c754420f932a8cf90845132302dfa7b1c Mon Sep 17 00:00:00 2001

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

Date: Thu, 9 May 2024 09:40:44 +0300

Subject: [PATCH 1/1] TUI: Adjusted menu items for terminal


src/ui/window.c | 22 +++++++++++++++++-----

src/ui/window.h | 1 +

2 files changed, 18 insertions(+), 5 deletions(-)

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

index 56c0d403..72e88759 100644

--- a/src/ui/window.c

+++ b/src/ui/window.c

@@ -73,8 +73,14 @@ iDefineTypeConstructionArgs(Window,

                         type, rect, flags)

iDefineTypeConstructionArgs(MainWindow, (iRect rect), rect)

+#if defined (iPlatformPcDesktop) || defined (iPlatformTerminal)

+# define LAGRANGE_PC_MENUS

+#endif

static const iMenuItem fileMenuItems_[] = {

+#if defined (LAGRANGE_MULTIPLE_WINDOWS)

 { "${menu.newwindow}", SDLK_n, KMOD_PRIMARY, "window.new" },

+#endif

 { "${menu.newtab}", SDLK_t, KMOD_PRIMARY, "tabs.new append:1" },

 { "${menu.openlocation}", SDLK_l, KMOD_PRIMARY, "navigate.focus" },

 { "${menu.reopentab}", SDLK_t, KMOD_SECONDARY, "tabs.new reopen:1" },

@@ -85,12 +91,12 @@ static const iMenuItem fileMenuItems_[] = {

 { saveToDownloads_Label, SDLK_s, KMOD_PRIMARY, "document.save" },

 { "---" },

 { "${menu.userdata}", 0, 0, "submenu id:userdatamenu" },

-// { "${menu.downloads}", 0, 0, "downloads.open" },

-// { "${menu.export}", 0, 0, "export" },

-#if defined (iPlatformPcDesktop)

+#if defined (LAGRANGE_PC_MENUS)

 { "---" },

 { "${menu.preferences}", preferences_KeyShortcut, "preferences" },

+#if !defined (iPlatformTerminal)

 { "${menu.fonts}", 0, 0, "open newtab:1 switch:1 url:about:fonts" },

+#endif

#if defined (LAGRANGE_ENABLE_WINSPARKLE)

 { "${menu.update}", 0, 0, "updater.check" },

#endif

@@ -160,16 +166,18 @@ static const iMenuItem windowMenuItems_[] = {

 { "${menu.tab.next}", 0, 0, "tabs.next" },

 { "${menu.tab.prev}", 0, 0, "tabs.prev" },

 { "${menu.duptab}", 0, 0, "tabs.new duplicate:1" },

+#if !defined (iPlatformTerminal)

 { "---" },

 { "${menu.window.min}", 0, 0, "window.minimize" },

 { "${menu.window.max}", 0, 0, "window.maximize" },

 { "${menu.window.full}", 0, 0, "window.fullscreen" },

+#endif

 { "---" },

 { NULL }

};

static const iMenuItem helpMenuItems_[] = {

-#if defined (iPlatformPcDesktop)

+#if defined (LAGRANGE_PC_MENUS)

 { "${menu.help}", SDLK_F1, 0, "!open newtab:1 switch:1 url:about:help" },

#else

 { "${menu.help}", 0, 0, "!open newtab:1 switch:1 url:about:help" },

@@ -178,7 +186,7 @@ static const iMenuItem helpMenuItems_[] = {

 { "---" },

 { "${menu.aboutpages}", 0, 0, "!open newtab:1 switch:1 url:about:about" },

 { "${menu.debug}", 0, 0, "!open newtab:1 switch:1 url:about:debug" },

-#if defined (iPlatformPcDesktop)

+#if defined (LAGRANGE_PC_MENUS)

 { "---" },

 { "${menu.aboutapp}", 0, 0, "!open newtab:1 switch:1 url:about:lagrange" },

#endif

@@ -195,6 +203,10 @@ const iMenuItem topLevelMenus_Window[7] = {

 { "${menu.title.help}", 0, 0, (const void *) helpMenuItems_ },

};

+size_t numWindowMenuItems_Window(void) {

+}

#if defined (LAGRANGE_MAC_MENUBAR)

static iBool macMenusInserted_;

diff --git a/src/ui/window.h b/src/ui/window.h

index cc674fcf..016a9a29 100644

--- a/src/ui/window.h

+++ b/src/ui/window.h

@@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */

#include <SDL_video.h>

extern const iMenuItem topLevelMenus_Window[7];

+size_t numWindowMenuItems_Window(void); /* number of items in an empty window menu */

enum iWindowType {

 main_WindowType,

--

2.25.1

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

This content has been proxied by September (3851b).