diff options
-rw-r--r-- | res/about/help.gmi | 2 | ||||
-rw-r--r-- | res/about/lagrange.gmi | 2 | ||||
-rw-r--r-- | res/about/version.gmi | 6 | ||||
-rw-r--r-- | src/app.c | 7 | ||||
-rw-r--r-- | src/ui/color.c | 19 | ||||
-rw-r--r-- | src/ui/root.c | 27 | ||||
-rw-r--r-- | src/ui/window.c | 6 |
7 files changed, 59 insertions, 10 deletions
diff --git a/res/about/help.gmi b/res/about/help.gmi index a25f556e..9f8d2759 100644 --- a/res/about/help.gmi +++ b/res/about/help.gmi | |||
@@ -1,4 +1,4 @@ | |||
1 | ``` LAGRANGE | 1 | ```LAGRANGE |
2 | __ __ __ ___ | 2 | __ __ __ ___ |
3 | | /\ / _` |__) /\ |\ | / _` |__ | 3 | | /\ / _` |__) /\ |\ | / _` |__ |
4 | |___ /~~\ \__> | \ /~~\ | \| \__> |___ | 4 | |___ /~~\ \__> | \ /~~\ | \| \__> |___ |
diff --git a/res/about/lagrange.gmi b/res/about/lagrange.gmi index 7544c26d..f4cf7015 100644 --- a/res/about/lagrange.gmi +++ b/res/about/lagrange.gmi | |||
@@ -1,4 +1,4 @@ | |||
1 | ``` ${about.logo} | 1 | ```${about.logo} |
2 | ooooo | 2 | ooooo |
3 | `888' | 3 | `888' |
4 | 888 .oooo. .oooooooo oooo d8b .oooo. ooo. .oo. .oooooooo .ooooo. | 4 | 888 .oooo. .oooooooo oooo d8b .oooo. ooo. .oo. .oooooooo .ooooo. |
diff --git a/res/about/version.gmi b/res/about/version.gmi index 3b15f567..f0439704 100644 --- a/res/about/version.gmi +++ b/res/about/version.gmi | |||
@@ -1,4 +1,4 @@ | |||
1 | ``` LAGRANGE | 1 | ```LAGRANGE |
2 | __ __ __ ___ | 2 | __ __ __ ___ |
3 | | /\ / _` |__) /\ |\ | / _` |__ | 3 | | /\ / _` |__) /\ |\ | / _` |__ |
4 | |___ /~~\ \__> | \ /~~\ | \| \__> |___ | 4 | |___ /~~\ \__> | \ /~~\ | \| \__> |___ |
@@ -10,11 +10,13 @@ | |||
10 | 10 | ||
11 | New features: | 11 | New features: |
12 | * Added a toolbar button for toggling the left sidebar. | 12 | * Added a toolbar button for toggling the left sidebar. |
13 | * Added an unsplit button in the toolbar when in split view mode. | ||
13 | * Choose parent folder when creating or editing a bookmark. | 14 | * Choose parent folder when creating or editing a bookmark. |
15 | * Support for 24-bit RGB ANSI color sequences. | ||
14 | * Support for ANSI background color escapes (disabled by default). | 16 | * Support for ANSI background color escapes (disabled by default). |
15 | * UI language for Turkish. | ||
16 | * macOS: Automatic updates using the Sparkle framework. | 17 | * macOS: Automatic updates using the Sparkle framework. |
17 | * Windows: Automatic updates using the WinSparkle library. | 18 | * Windows: Automatic updates using the WinSparkle library. |
19 | * UI language for Turkish. | ||
18 | 20 | ||
19 | Changes and enhancements: | 21 | Changes and enhancements: |
20 | * Adjusted font styles of heading levels 2 and 3. | 22 | * Adjusted font styles of heading levels 2 and 3. |
@@ -2204,6 +2204,13 @@ iBool handleCommand_App(const char *cmd) { | |||
2204 | swapRoots_MainWindow(d->window); | 2204 | swapRoots_MainWindow(d->window); |
2205 | return iTrue; | 2205 | return iTrue; |
2206 | } | 2206 | } |
2207 | if (argLabel_Command(cmd, "focusother")) { | ||
2208 | iWindow *baseWin = &d->window->base; | ||
2209 | if (baseWin->roots[1]) { | ||
2210 | baseWin->keyRoot = | ||
2211 | (baseWin->keyRoot == baseWin->roots[1] ? baseWin->roots[0] : baseWin->roots[1]); | ||
2212 | } | ||
2213 | } | ||
2207 | d->window->pendingSplitMode = | 2214 | d->window->pendingSplitMode = |
2208 | (argLabel_Command(cmd, "axis") ? vertical_WindowSplit : 0) | (arg_Command(cmd) << 1); | 2215 | (argLabel_Command(cmd, "axis") ? vertical_WindowSplit : 0) | (arg_Command(cmd) << 1); |
2209 | const char *url = suffixPtr_Command(cmd, "url"); | 2216 | const char *url = suffixPtr_Command(cmd, "url"); |
diff --git a/src/ui/color.c b/src/ui/color.c index 0b927fd6..3ea98d8c 100644 --- a/src/ui/color.c +++ b/src/ui/color.c | |||
@@ -818,13 +818,28 @@ void ansiColors_Color(iRangecc escapeSequence, int fgDefault, int bgDefault, | |||
818 | case 48: { | 818 | case 48: { |
819 | iColor *dst = (arg == 38 ? &fg : &bg); | 819 | iColor *dst = (arg == 38 ? &fg : &bg); |
820 | /* Extended foreground color. */ | 820 | /* Extended foreground color. */ |
821 | /* TODO: Cleanup? More robust parsing? */ | ||
822 | if (ch >= escapeSequence.end) break; | ||
821 | arg = strtoul(ch + 1, &endPtr, 10); | 823 | arg = strtoul(ch + 1, &endPtr, 10); |
822 | ch = endPtr; | 824 | ch = endPtr; |
823 | if (arg == 5) /* 8-bit palette */ { | 825 | if (arg == 5) /* 8-bit palette */ { |
824 | arg = strtoul(ch + 1, &endPtr, 10); | 826 | if (ch >= escapeSequence.end) break; |
825 | ch = endPtr; | 827 | arg = strtoul(ch + 1, &endPtr, 10); |
828 | ch = endPtr; | ||
826 | *dst = ansi8BitColors_[iClamp(arg, 0, 255)]; | 829 | *dst = ansi8BitColors_[iClamp(arg, 0, 255)]; |
827 | } | 830 | } |
831 | else if (arg == 2) /* 24-bit RGB */ { | ||
832 | int rgb[3] = { 0, 0, 0 }; | ||
833 | iForIndices(i, rgb) { | ||
834 | if (ch >= escapeSequence.end) break; | ||
835 | rgb[i] = strtoul(ch + 1, &endPtr, 10); | ||
836 | ch = endPtr; | ||
837 | } | ||
838 | dst->r = iClamp(rgb[0], 0, 255); | ||
839 | dst->g = iClamp(rgb[1], 0, 255); | ||
840 | dst->b = iClamp(rgb[2], 0, 255); | ||
841 | dst->a = 255; | ||
842 | } | ||
828 | break; | 843 | break; |
829 | } | 844 | } |
830 | case 39: | 845 | case 39: |
diff --git a/src/ui/root.c b/src/ui/root.c index d98701b8..5b1167d8 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -635,10 +635,12 @@ static void updateNavBarSize_(iWidget *navBar) { | |||
635 | iForIndices(k, lists) { | 635 | iForIndices(k, lists) { |
636 | iForEach(ObjectList, i, lists[k]) { | 636 | iForEach(ObjectList, i, lists[k]) { |
637 | iWidget *child = as_Widget(i.object); | 637 | iWidget *child = as_Widget(i.object); |
638 | setFlags_Widget(child, tight_WidgetFlag, isNarrow); | 638 | if (cmp_String(id_Widget(i.object), "navbar.unsplit")) { |
639 | if (isInstance_Object(i.object, &Class_LabelWidget)) { | 639 | setFlags_Widget(child, tight_WidgetFlag, isNarrow); |
640 | iLabelWidget *label = i.object; | 640 | if (isInstance_Object(i.object, &Class_LabelWidget)) { |
641 | updateSize_LabelWidget(label); | 641 | iLabelWidget *label = i.object; |
642 | updateSize_LabelWidget(label); | ||
643 | } | ||
642 | } | 644 | } |
643 | } | 645 | } |
644 | } | 646 | } |
@@ -1023,6 +1025,16 @@ void updateMetrics_Root(iRoot *d) { | |||
1023 | postRefresh_App(); | 1025 | postRefresh_App(); |
1024 | } | 1026 | } |
1025 | 1027 | ||
1028 | static void addUnsplitButton_(iWidget *navBar) { | ||
1029 | iLabelWidget *unsplit = addChildFlags_Widget( | ||
1030 | navBar, | ||
1031 | iClob(newIcon_LabelWidget(close_Icon, 0, 0, "ui.split arg:0 focusother:1")), | ||
1032 | collapse_WidgetFlag | frameless_WidgetFlag | tight_WidgetFlag | hidden_WidgetFlag); | ||
1033 | setId_Widget(as_Widget(unsplit), "navbar.unsplit"); | ||
1034 | setTextColor_LabelWidget(unsplit, uiTextAction_ColorId); | ||
1035 | updateSize_LabelWidget(unsplit); | ||
1036 | } | ||
1037 | |||
1026 | void createUserInterface_Root(iRoot *d) { | 1038 | void createUserInterface_Root(iRoot *d) { |
1027 | iWidget *root = d->widget = new_Widget(); | 1039 | iWidget *root = d->widget = new_Widget(); |
1028 | root->rect.size = get_Window()->size; | 1040 | root->rect.size = get_Window()->size; |
@@ -1101,6 +1113,9 @@ void createUserInterface_Root(iRoot *d) { | |||
1101 | addChild_Widget(div, iClob(navBar)); | 1113 | addChild_Widget(div, iClob(navBar)); |
1102 | setBackgroundColor_Widget(navBar, uiBackground_ColorId); | 1114 | setBackgroundColor_Widget(navBar, uiBackground_ColorId); |
1103 | setCommandHandler_Widget(navBar, handleNavBarCommands_); | 1115 | setCommandHandler_Widget(navBar, handleNavBarCommands_); |
1116 | #if defined (iPlatformApple) | ||
1117 | addUnsplitButton_(navBar); | ||
1118 | #endif | ||
1104 | iWidget *navBack; | 1119 | iWidget *navBack; |
1105 | setId_Widget(navBack = addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(backArrow_Icon, 0, 0, "navigate.back")), collapse_WidgetFlag), "navbar.back"); | 1120 | setId_Widget(navBack = addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(backArrow_Icon, 0, 0, "navigate.back")), collapse_WidgetFlag), "navbar.back"); |
1106 | setId_Widget(addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(forwardArrow_Icon, 0, 0, "navigate.forward")), collapse_WidgetFlag), "navbar.forward"); | 1121 | setId_Widget(addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(forwardArrow_Icon, 0, 0, "navigate.forward")), collapse_WidgetFlag), "navbar.forward"); |
@@ -1279,6 +1294,10 @@ void createUserInterface_Root(iRoot *d) { | |||
1279 | setAlignVisually_LabelWidget(navMenu, iTrue); | 1294 | setAlignVisually_LabelWidget(navMenu, iTrue); |
1280 | setId_Widget(addChildFlags_Widget(navBar, iClob(navMenu), collapse_WidgetFlag), "navbar.menu"); | 1295 | setId_Widget(addChildFlags_Widget(navBar, iClob(navMenu), collapse_WidgetFlag), "navbar.menu"); |
1281 | #endif | 1296 | #endif |
1297 | #if !defined (iPlatformApple) | ||
1298 | /* On PC platforms, the close buttons are generally on the top right. */ | ||
1299 | addUnsplitButton_(navBar); | ||
1300 | #endif | ||
1282 | } | 1301 | } |
1283 | /* Tab bar. */ { | 1302 | /* Tab bar. */ { |
1284 | iWidget *mainStack = new_Widget(); | 1303 | iWidget *mainStack = new_Widget(); |
diff --git a/src/ui/window.c b/src/ui/window.c index b8ce413b..4b39383c 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -1491,6 +1491,7 @@ void setSplitMode_MainWindow(iMainWindow *d, int splitFlags) { | |||
1491 | } | 1491 | } |
1492 | /* The last child is the [+] button for adding a tab. */ | 1492 | /* The last child is the [+] button for adding a tab. */ |
1493 | moveTabButtonToEnd_Widget(findChild_Widget(docTabs, "newtab")); | 1493 | moveTabButtonToEnd_Widget(findChild_Widget(docTabs, "newtab")); |
1494 | setFlags_Widget(findWidget_Root("navbar.unsplit"), hidden_WidgetFlag, iTrue); | ||
1494 | iRelease(tabs); | 1495 | iRelease(tabs); |
1495 | postCommandf_App("tabs.switch id:%s", cstr_String(id_Widget(constAs_Widget(curPage)))); | 1496 | postCommandf_App("tabs.switch id:%s", cstr_String(id_Widget(constAs_Widget(curPage)))); |
1496 | } | 1497 | } |
@@ -1540,6 +1541,11 @@ void setSplitMode_MainWindow(iMainWindow *d, int splitFlags) { | |||
1540 | postCommand_Root(w->roots[newRootIndex], "navigate.home"); | 1541 | postCommand_Root(w->roots[newRootIndex], "navigate.home"); |
1541 | } | 1542 | } |
1542 | } | 1543 | } |
1544 | /* Show unsplit buttons. */ | ||
1545 | for (int i = 0; i < 2; i++) { | ||
1546 | setFlags_Widget(findChild_Widget(w->roots[i]->widget, "navbar.unsplit"), | ||
1547 | hidden_WidgetFlag, iFalse); | ||
1548 | } | ||
1543 | setCurrent_Root(NULL); | 1549 | setCurrent_Root(NULL); |
1544 | } | 1550 | } |
1545 | d->splitMode = splitMode; | 1551 | d->splitMode = splitMode; |