From 39d66598f3641749bd3e2b9b2588e921912d4ec7 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi

Date: Fri, 4 Dec 2020 09:26:52 +0200

Subject: [PATCH 1/1] SidebarWidget: Interaction with the right sidebar


src/ui/keys.h | 2 ++

src/ui/sidebarwidget.c | 5 ++++-

src/ui/window.c | 5 +++++

3 files changed, 11 insertions(+), 1 deletion(-)

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

index cc56f8d1..8bcd4f53 100644

--- a/src/ui/keys.h

+++ b/src/ui/keys.h

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

define navigateRoot_KeyShortcut SDLK_UP, KMOD_SHIFT | KMOD_PRIMARY

define byWord_KeyModifier KMOD_ALT

define byLine_KeyModifier KMOD_PRIMARY

+# define rightSidebar_KeyModifier KMOD_CTRL

define subscribeToPage_KeyModifier SDLK_d, KMOD_SHIFT | KMOD_PRIMARY

#else

define reload_KeyShortcut SDLK_r, KMOD_PRIMARY

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

define navigateRoot_KeyShortcut SDLK_UP, KMOD_SHIFT | KMOD_ALT

define byWord_KeyModifier KMOD_CTRL

define byLine_KeyModifier 0

+# define rightSidebar_KeyModifier KMOD_SHIFT | KMOD_CTRL

define subscribeToPage_KeyModifier SDLK_d, KMOD_SHIFT | KMOD_PRIMARY

#endif

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

index 121e9a7c..ca4404d5 100644

--- a/src/ui/sidebarwidget.c

+++ b/src/ui/sidebarwidget.c

@@ -580,7 +580,8 @@ void setWidth_SidebarWidget(iSidebarWidget *d, int width) {

iBool handleBookmarkEditorCommands_SidebarWidget_(iWidget *editor, const char *cmd) {

 if (equal_Command(cmd, "bmed.accept") || equal_Command(cmd, "cancel")) {

     if (equal_Command(cmd, "bmed.accept")) {

         const iString *title = text_InputWidget(findChild_Widget(editor, "bmed.title"));

         const iString *url   = text_InputWidget(findChild_Widget(editor, "bmed.url"));

@@ -719,6 +720,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)

         if (d->mode == bookmarks_SidebarMode && item) {

             setFlags_Widget(w, disabled_WidgetFlag, iTrue);

             iWidget *dlg = makeBookmarkEditor_Widget();

             iBookmark *bm = get_Bookmarks(bookmarks_App(), item->id);

             setText_InputWidget(findChild_Widget(dlg, "bmed.title"), &bm->title);

             setText_InputWidget(findChild_Widget(dlg, "bmed.url"), &bm->url);

@@ -800,6 +802,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)

                 if (isCommand_Widget(w, ev, "feed.entry.edit")) {

                     setFlags_Widget(w, disabled_WidgetFlag, iTrue);

                     iWidget *dlg = makeBookmarkEditor_Widget();

                     setText_InputWidget(findChild_Widget(dlg, "bmed.title"), &feedBookmark->title);

                     setText_InputWidget(findChild_Widget(dlg, "bmed.url"), &feedBookmark->url);

                     setText_InputWidget(findChild_Widget(dlg, "bmed.tags"), &feedBookmark->tags);

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

index 53300d24..6441a2e3 100644

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

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

@@ -511,6 +511,11 @@ static void setupUserInterface_Window(iWindow *d) {

     addAction_Widget(d->root, '3', KMOD_PRIMARY, "sidebar.mode arg:2 toggle:1");

     addAction_Widget(d->root, '4', KMOD_PRIMARY, "sidebar.mode arg:3 toggle:1");

     addAction_Widget(d->root, '5', KMOD_PRIMARY, "sidebar.mode arg:4 toggle:1");

 }

}

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.7/patch/39d66598f3641749bd3e2b9b2588e921912d4ec7.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
65.164235 milliseconds
Gemini-to-HTML Time
1.379003 milliseconds

This content has been proxied by September (ba2dc).