Skip to content

Commit

Permalink
Merge branch 'dev' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 23, 2023
2 parents ba534b9 + 6141c19 commit 2e199a0
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
cmake_minimum_required (VERSION 3.9)

project (Lagrange
VERSION 1.16.4
VERSION 1.16.5
DESCRIPTION "A Beautiful Gemini Client"
LANGUAGES C
)
Expand Down
4 changes: 4 additions & 0 deletions res/about/version.gmi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
```
# Release notes

## 1.16.5
* "New Tab" (Ctrl+T/⌘T) and the tab bar [+] button append the tab to the right edge. Previously it was inserted next to the active tab.
* Flatpak: Fixed crash when opening Preferences.

## 1.16.4
* Context/button menus use a popup window if they would otherwise have to scroll (e.g., "Dark theme:" in Preferences and "Folder:" in the bookmark editor).
* Improved tab closing order: close all sibling tabs opened from an origin tab before switching back to the origin tab.
Expand Down
12 changes: 7 additions & 5 deletions src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -2961,7 +2961,6 @@ iDocumentWidget *document_Command(const char *cmd) {

iDocumentWidget *newTab_App(const iDocumentWidget *duplicateOf, int newTabFlags) {
iWidget *tabs = findWidget_Root("doctabs");
size_t currentTabIndex = tabPageIndex_Widget(tabs, document_App());
setFlags_Widget(tabs, hidden_WidgetFlag, iFalse);
iWidget *newTabButton = findChild_Widget(tabs, "newtab");
removeChild_Widget(newTabButton->parent, newTabButton);
Expand All @@ -2974,15 +2973,16 @@ iDocumentWidget *newTab_App(const iDocumentWidget *duplicateOf, int newTabFlags)
}
appendTabPage_Widget(tabs, as_Widget(doc), "", 0, 0);
iRelease(doc); /* now owned by the tabs */
/* Find and move to the insertion point. */ {
/* Find and move to the insertion point. */
if (~newTabFlags & append_NewTabFlag) {
const size_t insertAt = tabPageIndex_Widget(
tabs, findChild_Widget(tabs, cstr_String(&get_Root()->tabInsertId)));
if (insertAt != iInvalidPos) {
moveTabPage_Widget(tabs, tabCount_Widget(tabs) - 1, insertAt + 1);
}
/* The next tab comes here. */
set_String(&as_Widget(doc)->root->tabInsertId, id_Widget(as_Widget(doc)));
}
/* The next tab comes here. */
set_String(&as_Widget(doc)->root->tabInsertId, id_Widget(as_Widget(doc)));
addTabCloseButton_Widget(tabs, as_Widget(doc), "tabs.close");
addChild_Widget(findChild_Widget(tabs, "tabs.buttons"), iClob(newTabButton));
showOrHideNewTabButton_Root(tabs->root);
Expand Down Expand Up @@ -4302,8 +4302,10 @@ iBool handleCommand_App(const char *cmd) {
}
return iTrue;
}
const iBool isAppend = argLabel_Command(cmd, "append") != 0;
const iBool isDuplicate = argLabel_Command(cmd, "duplicate") != 0;
newTab_App(isDuplicate ? document_App() : NULL, switchTo_NewTabFlag);
newTab_App(isDuplicate ? document_App() : NULL,
switchTo_NewTabFlag | (isAppend ? append_NewTabFlag : 0));
if (!isDuplicate) {
postCommandf_App("navigate.home focus:%d", deviceType_App() == desktop_AppDeviceType);
}
Expand Down
1 change: 1 addition & 0 deletions src/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ enum iUserEventCode {

enum iNewTabFlag {
switchTo_NewTabFlag = iBit(1),
append_NewTabFlag = iBit(2),
};

const iString *execPath_App (void);
Expand Down
2 changes: 1 addition & 1 deletion src/macos.m
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ - (nullable NSTouchBarItem *)touchBar:(NSTouchBar *)touchBar
return [[CommandButton alloc] initWithIdentifier:identifier
image:[NSImage imageNamed:NSImageNameTouchBarAddTemplate]
widget:nil
command:@"tabs.new"];
command:@"tabs.new append:1"];
}
return nil;
}
Expand Down
1 change: 1 addition & 0 deletions src/ui/inputwidget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,7 @@ static iBool isAllSelected_InputWidget_(const iInputWidget *d) {
}

void setText_InputWidget(iInputWidget *d, const iString *text) {
if (!d) return;
const iBool isAllSelected = isAllSelected_InputWidget_(d);
setTextUndoable_InputWidget(d, text, iFalse);
if (isAllSelected) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static const struct { int id; iMenuItem bind; int flags; } defaultBindings_[] =
#if !defined (iPlatformApple) /* Ctrl-Cmd-F on macOS */
{ 73, { "${keys.fullscreen}", SDLK_F11, 0, "window.fullscreen" }, 0 },
#endif
{ 76, { "${keys.tab.new}", newTab_KeyShortcut, "tabs.new" }, 0 },
{ 76, { "${keys.tab.new}", newTab_KeyShortcut, "tabs.new append:1" }, 0 },
{ 77, { "${keys.tab.close}", closeTab_KeyShortcut, "tabs.close" }, 0 },
{ 78, { "${keys.tab.close.other}", SDLK_w, KMOD_SECONDARY, "tabs.close toleft:1 toright:1" }, 0 },
{ 79, { "${LC:menu.reopentab}", SDLK_t, KMOD_SECONDARY, "tabs.new reopen:1" }, 0 },
Expand Down
2 changes: 1 addition & 1 deletion src/ui/mobile.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const iToolbarActionSpec toolbarActions_Mobile[max_ToolbarAction] = {
{ home_Icon, "${menu.home}", "navigate.home" },
{ upArrow_Icon, "${menu.parent}", "navigate.parent" },
{ reload_Icon, "${menu.reload}", "navigate.reload" },
{ add_Icon, "${menu.newtab}", "tabs.new" },
{ add_Icon, "${menu.newtab}", "tabs.new append:1" },
{ close_Icon, "${menu.closetab}", "tabs.close" },
{ bookmark_Icon, "${menu.page.bookmark}", "bookmark.add" },
{ globe_Icon, "${menu.page.translate}", "document.translate" },
Expand Down
9 changes: 5 additions & 4 deletions src/ui/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */

static const iMenuItem desktopNavMenuItems_[] = {
{ openWindow_Icon " ${menu.newwindow}", SDLK_n, KMOD_PRIMARY, "window.new" },
{ add_Icon " ${menu.newtab}", SDLK_t, KMOD_PRIMARY, "tabs.new" },
{ add_Icon " ${menu.newtab}", SDLK_t, KMOD_PRIMARY, "tabs.new append:1" },
{ close_Icon " ${menu.closetab}", SDLK_w, KMOD_PRIMARY, "tabs.close" },
{ "${menu.openlocation}", SDLK_l, KMOD_PRIMARY, "navigate.focus" },
{ "---" },
Expand Down Expand Up @@ -85,7 +85,7 @@ static const iMenuItem desktopNavMenuItems_[] = {
};

static const iMenuItem tabletNavMenuItems_[] = {
{ add_Icon " ${menu.newtab}", SDLK_t, KMOD_PRIMARY, "tabs.new" },
{ add_Icon " ${menu.newtab}", SDLK_t, KMOD_PRIMARY, "tabs.new append:1" },
{ folder_Icon " ${menu.openfile}", SDLK_o, KMOD_PRIMARY, "file.open" },
{ "---" },
{ close_Icon " ${menu.closetab}", 'w', KMOD_PRIMARY, "tabs.close" },
Expand All @@ -102,7 +102,7 @@ static const iMenuItem tabletNavMenuItems_[] = {
};

static const iMenuItem phoneNavMenuItems_[] = {
{ add_Icon " ${menu.newtab}", SDLK_t, KMOD_PRIMARY, "tabs.new" },
{ add_Icon " ${menu.newtab}", SDLK_t, KMOD_PRIMARY, "tabs.new append:1" },
{ folder_Icon " ${menu.openfile}", SDLK_o, KMOD_PRIMARY, "file.open" },
{ "---" },
{ close_Icon " ${menu.closetab}", 'w', KMOD_PRIMARY, "tabs.close" },
Expand Down Expand Up @@ -1792,7 +1792,8 @@ void createUserInterface_Root(iRoot *d) {
setBackgroundColor_Widget(buttons, uiBackground_ColorId);
}
setId_Widget(
addChildFlags_Widget(buttons, iClob(newIcon_LabelWidget(add_Icon, 0, 0, "tabs.new")),
addChildFlags_Widget(buttons,
iClob(newIcon_LabelWidget(add_Icon, 0, 0, "tabs.new append:1")),
moveToParentRightEdge_WidgetFlag | collapse_WidgetFlag),
"newtab");
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ iDefineTypeConstructionArgs(MainWindow, (iRect rect), rect)

static const iMenuItem fileMenuItems_[] = {
{ "${menu.newwindow}", SDLK_n, KMOD_PRIMARY, "window.new" },
{ "${menu.newtab}", SDLK_t, KMOD_PRIMARY, "tabs.new" },
{ "${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" },
{ "---" },
Expand Down

0 comments on commit 2e199a0

Please sign in to comment.