diff options
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/app.c | 9 | ||||
-rw-r--r-- | src/ui/sidebarwidget.c | 11 |
3 files changed, 15 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5922eabe..557c829d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -30,7 +30,7 @@ pkg_check_modules (SDL2 REQUIRED sdl2) | |||
30 | # Embedded resources are written to a generated source file. | 30 | # Embedded resources are written to a generated source file. |
31 | message (STATUS "Preparing embedded resources...") | 31 | message (STATUS "Preparing embedded resources...") |
32 | # Fonts are too large to comfortably embed as a C source. | 32 | # Fonts are too large to comfortably embed as a C source. |
33 | set (EMBED_RESOURCES | 33 | set (EMBED_RESOURCES |
34 | res/about/help.gmi | 34 | res/about/help.gmi |
35 | res/about/lagrange.gmi | 35 | res/about/lagrange.gmi |
36 | res/about/version.gmi | 36 | res/about/version.gmi |
@@ -183,8 +183,8 @@ if (MSYS) | |||
183 | if (NOT ENABLE_RESOURCE_EMBED) | 183 | if (NOT ENABLE_RESOURCE_EMBED) |
184 | install (FILES ${EMB_BIN} DESTINATION .) | 184 | install (FILES ${EMB_BIN} DESTINATION .) |
185 | endif () | 185 | endif () |
186 | install (PROGRAMS | 186 | install (PROGRAMS |
187 | ${SDL2_LIBDIR}/SDL2.dll | 187 | ${SDL2_LIBDIR}/SDL2.dll |
188 | $<TARGET_FILE:the_Foundation::the_Foundation> | 188 | $<TARGET_FILE:the_Foundation::the_Foundation> |
189 | DESTINATION . | 189 | DESTINATION . |
190 | ) | 190 | ) |
@@ -339,7 +339,7 @@ static void deinit_App(iApp *d) { | |||
339 | deinit_SortedArray(&d->tickers); | 339 | deinit_SortedArray(&d->tickers); |
340 | delete_Window(d->window); | 340 | delete_Window(d->window); |
341 | d->window = NULL; | 341 | d->window = NULL; |
342 | deinit_CommandLine(&d->args); | 342 | deinit_CommandLine(&d->args); |
343 | } | 343 | } |
344 | 344 | ||
345 | const iString *execPath_App(void) { | 345 | const iString *execPath_App(void) { |
@@ -565,7 +565,7 @@ static iBool handlePrefsCommands_(iWidget *d, const char *cmd) { | |||
565 | else if (equal_Command(cmd, "prefs.ostheme.changed")) { | 565 | else if (equal_Command(cmd, "prefs.ostheme.changed")) { |
566 | postCommandf_App("ostheme arg:%d", arg_Command(cmd)); | 566 | postCommandf_App("ostheme arg:%d", arg_Command(cmd)); |
567 | } | 567 | } |
568 | else if (equal_Command(cmd, "theme.changed")) { | 568 | else if (equal_Command(cmd, "theme.changed")) { |
569 | updatePrefsThemeButtons_(d); | 569 | updatePrefsThemeButtons_(d); |
570 | if (!argLabel_Command(cmd, "auto")) { | 570 | if (!argLabel_Command(cmd, "auto")) { |
571 | setToggle_Widget(findChild_Widget(d, "prefs.ostheme"), iFalse); | 571 | setToggle_Widget(findChild_Widget(d, "prefs.ostheme"), iFalse); |
@@ -617,7 +617,7 @@ iDocumentWidget *newTab_App(const iDocumentWidget *duplicateOf) { | |||
617 | 617 | ||
618 | static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { | 618 | static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { |
619 | iApp *d = &app_; | 619 | iApp *d = &app_; |
620 | if (equal_Command(cmd, "ident.accept") || equal_Command(cmd, "cancel")) { | 620 | if (equal_Command(cmd, "ident.accept") || equal_Command(cmd, "cancel")) { |
621 | if (equal_Command(cmd, "ident.accept")) { | 621 | if (equal_Command(cmd, "ident.accept")) { |
622 | const iString *commonName = text_InputWidget (findChild_Widget(dlg, "ident.common")); | 622 | const iString *commonName = text_InputWidget (findChild_Widget(dlg, "ident.common")); |
623 | const iString *email = text_InputWidget (findChild_Widget(dlg, "ident.email")); | 623 | const iString *email = text_InputWidget (findChild_Widget(dlg, "ident.email")); |
@@ -733,7 +733,7 @@ iBool handleCommand_App(const char *cmd) { | |||
733 | newTab_App(isDuplicate ? document_App() : NULL); | 733 | newTab_App(isDuplicate ? document_App() : NULL); |
734 | if (!isDuplicate) { | 734 | if (!isDuplicate) { |
735 | postCommand_App("navigate.home"); | 735 | postCommand_App("navigate.home"); |
736 | } | 736 | } |
737 | return iTrue; | 737 | return iTrue; |
738 | } | 738 | } |
739 | else if (equal_Command(cmd, "tabs.close")) { | 739 | else if (equal_Command(cmd, "tabs.close")) { |
@@ -824,6 +824,7 @@ iBool handleCommand_App(const char *cmd) { | |||
824 | makeBookmarkCreation_Widget(url_DocumentWidget(doc), | 824 | makeBookmarkCreation_Widget(url_DocumentWidget(doc), |
825 | bookmarkTitle_DocumentWidget(doc), | 825 | bookmarkTitle_DocumentWidget(doc), |
826 | siteIcon_GmDocument(document_DocumentWidget(doc))); | 826 | siteIcon_GmDocument(document_DocumentWidget(doc))); |
827 | postCommand_App("focus.set id:bmed.title"); | ||
827 | return iTrue; | 828 | return iTrue; |
828 | } | 829 | } |
829 | else if (equal_Command(cmd, "ident.new")) { | 830 | else if (equal_Command(cmd, "ident.new")) { |
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 3b02f85c..6dc1e9f2 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -527,14 +527,14 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
527 | updateItems_SidebarWidget_(d); | 527 | updateItems_SidebarWidget_(d); |
528 | } | 528 | } |
529 | else if (equal_Command(cmd, "bookmark.copy")) { | 529 | else if (equal_Command(cmd, "bookmark.copy")) { |
530 | const iSidebarItem *item = d->menuItem; //hoverItem_ListWidget(d->list); | 530 | const iSidebarItem *item = d->menuItem; |
531 | if (d->mode == bookmarks_SidebarMode && item) { | 531 | if (d->mode == bookmarks_SidebarMode && item) { |
532 | SDL_SetClipboardText(cstr_String(&item->url)); | 532 | SDL_SetClipboardText(cstr_String(&item->url)); |
533 | } | 533 | } |
534 | return iTrue; | 534 | return iTrue; |
535 | } | 535 | } |
536 | else if (equal_Command(cmd, "bookmark.edit")) { | 536 | else if (equal_Command(cmd, "bookmark.edit")) { |
537 | const iSidebarItem *item = d->menuItem; //hoverItem_ListWidget(d->list); | 537 | const iSidebarItem *item = d->menuItem; |
538 | if (d->mode == bookmarks_SidebarMode && item) { | 538 | if (d->mode == bookmarks_SidebarMode && item) { |
539 | setFlags_Widget(w, disabled_WidgetFlag, iTrue); | 539 | setFlags_Widget(w, disabled_WidgetFlag, iTrue); |
540 | iWidget *dlg = makeBookmarkEditor_Widget(); | 540 | iWidget *dlg = makeBookmarkEditor_Widget(); |
@@ -660,6 +660,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
660 | &item->url, | 660 | &item->url, |
661 | collect_String(newRange_String(urlHost_String(&item->url))), | 661 | collect_String(newRange_String(urlHost_String(&item->url))), |
662 | 0x1f310 /* globe */); | 662 | 0x1f310 /* globe */); |
663 | postCommand_App("focus.set id:bmed.title"); | ||
663 | } | 664 | } |
664 | } | 665 | } |
665 | else if (equal_Command(cmd, "history.clear")) { | 666 | else if (equal_Command(cmd, "history.clear")) { |
@@ -678,7 +679,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
678 | } | 679 | } |
679 | return iTrue; | 680 | return iTrue; |
680 | } | 681 | } |
681 | } | 682 | } |
682 | if (ev->type == SDL_MOUSEMOTION && !isVisible_Widget(d->menu)) { | 683 | if (ev->type == SDL_MOUSEMOTION && !isVisible_Widget(d->menu)) { |
683 | const iInt2 mouse = init_I2(ev->motion.x, ev->motion.y); | 684 | const iInt2 mouse = init_I2(ev->motion.x, ev->motion.y); |
684 | if (contains_Widget(d->resizer, mouse)) { | 685 | if (contains_Widget(d->resizer, mouse)) { |
@@ -733,7 +734,9 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
733 | } | 734 | } |
734 | } | 735 | } |
735 | } | 736 | } |
736 | processContextMenuEvent_Widget(d->menu, ev, {}); | 737 | if (hoverItem_ListWidget(d->list) || isVisible_Widget(d->menu)) { |
738 | processContextMenuEvent_Widget(d->menu, ev, {}); | ||
739 | } | ||
737 | return processEvent_Widget(w, ev); | 740 | return processEvent_Widget(w, ev); |
738 | } | 741 | } |
739 | 742 | ||