summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/about/version.gmi1
-rw-r--r--src/app.c3
-rw-r--r--src/ui/root.c17
-rw-r--r--src/ui/root.h2
4 files changed, 21 insertions, 2 deletions
diff --git a/res/about/version.gmi b/res/about/version.gmi
index df532ab3..5dad2c58 100644
--- a/res/about/version.gmi
+++ b/res/about/version.gmi
@@ -8,6 +8,7 @@
8 8
9## 1.10.3 9## 1.10.3
10* Added a man page. 10* Added a man page.
11* Hide the [+] on the row of tab buttons if the navbar has a New Tab button.
11* "/index.gmi" is considered equal to "/" when navigating to parent directory. 12* "/index.gmi" is considered equal to "/" when navigating to parent directory.
12* Gopher: Fixed navigating to root, e.g., when clicking on the page top banner. Set item type to 1 to show a gophermap and not the plain source. 13* Gopher: Fixed navigating to root, e.g., when clicking on the page top banner. Set item type to 1 to show a gophermap and not the plain source.
13* Titan: When navigating to parent/root, switch URL scheme to "gemini". This action occurs on a Titan response page, so initiating a new upload with the parent/root URL is probably not appropriate. 14* Titan: When navigating to parent/root, switch URL scheme to "gemini". This action occurs on a Titan response page, so initiating a new upload with the parent/root URL is probably not appropriate.
diff --git a/src/app.c b/src/app.c
index a137dc23..9f35d727 100644
--- a/src/app.c
+++ b/src/app.c
@@ -2086,7 +2086,6 @@ iDocumentWidget *document_Command(const char *cmd) {
2086} 2086}
2087 2087
2088iDocumentWidget *newTab_App(const iDocumentWidget *duplicateOf, iBool switchToNew) { 2088iDocumentWidget *newTab_App(const iDocumentWidget *duplicateOf, iBool switchToNew) {
2089 //iApp *d = &app_;
2090 iWidget *tabs = findWidget_Root("doctabs"); 2089 iWidget *tabs = findWidget_Root("doctabs");
2091 setFlags_Widget(tabs, hidden_WidgetFlag, iFalse); 2090 setFlags_Widget(tabs, hidden_WidgetFlag, iFalse);
2092 iWidget *newTabButton = findChild_Widget(tabs, "newtab"); 2091 iWidget *newTabButton = findChild_Widget(tabs, "newtab");
@@ -2102,6 +2101,7 @@ iDocumentWidget *newTab_App(const iDocumentWidget *duplicateOf, iBool switchToNe
2102 iRelease(doc); /* now owned by the tabs */ 2101 iRelease(doc); /* now owned by the tabs */
2103 addTabCloseButton_Widget(tabs, as_Widget(doc), "tabs.close"); 2102 addTabCloseButton_Widget(tabs, as_Widget(doc), "tabs.close");
2104 addChild_Widget(findChild_Widget(tabs, "tabs.buttons"), iClob(newTabButton)); 2103 addChild_Widget(findChild_Widget(tabs, "tabs.buttons"), iClob(newTabButton));
2104 showOrHideNewTabButton_Root(tabs->root);
2105 if (switchToNew) { 2105 if (switchToNew) {
2106 postCommandf_App("tabs.switch page:%p", doc); 2106 postCommandf_App("tabs.switch page:%p", doc);
2107 } 2107 }
@@ -2852,6 +2852,7 @@ iBool handleCommand_App(const char *cmd) {
2852 return iTrue; 2852 return iTrue;
2853 } 2853 }
2854 iDocumentWidget *doc = document_Command(cmd); 2854 iDocumentWidget *doc = document_Command(cmd);
2855 iAssert(doc);
2855 iDocumentWidget *origin = doc; 2856 iDocumentWidget *origin = doc;
2856 if (hasLabel_Command(cmd, "origin")) { 2857 if (hasLabel_Command(cmd, "origin")) {
2857 iDocumentWidget *cmdOrig = findWidget_App(cstr_Command(cmd, "origin")); 2858 iDocumentWidget *cmdOrig = findWidget_App(cstr_Command(cmd, "origin"));
diff --git a/src/ui/root.c b/src/ui/root.c
index 776a9a35..6e187313 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -703,6 +703,20 @@ void updateToolbarColors_Root(iRoot *d) {
703#endif 703#endif
704} 704}
705 705
706void showOrHideNewTabButton_Root(iRoot *d) {
707 iWidget *tabs = findChild_Widget(d->widget, "doctabs");
708 iWidget *newTabButton = findChild_Widget(tabs, "newtab");
709 iBool hide = iFalse;
710 iForIndices(i, prefs_App()->navbarActions) {
711 if (prefs_App()->navbarActions[i] == newTab_ToolbarAction) {
712 hide = iTrue;
713 break;
714 }
715 }
716 setFlags_Widget(newTabButton, hidden_WidgetFlag, hide);
717 arrange_Widget(findChild_Widget(tabs, "tabs.buttons"));
718}
719
706void notifyVisualOffsetChange_Root(iRoot *d) { 720void notifyVisualOffsetChange_Root(iRoot *d) {
707 if (d && (d->didAnimateVisualOffsets || d->didChangeArrangement)) { 721 if (d && (d->didAnimateVisualOffsets || d->didChangeArrangement)) {
708 iNotifyAudience(d, visualOffsetsChanged, RootVisualOffsetsChanged); 722 iNotifyAudience(d, visualOffsetsChanged, RootVisualOffsetsChanged);
@@ -848,6 +862,7 @@ static void updateNavBarActions_(iWidget *navBar) {
848 } 862 }
849 iEndCollect(); 863 iEndCollect();
850 } 864 }
865 showOrHideNewTabButton_Root(navBar->root);
851} 866}
852 867
853static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) { 868static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
@@ -1526,7 +1541,7 @@ void createUserInterface_Root(iRoot *d) {
1526 } 1541 }
1527 setId_Widget( 1542 setId_Widget(
1528 addChildFlags_Widget(buttons, iClob(newIcon_LabelWidget(add_Icon, 0, 0, "tabs.new")), 1543 addChildFlags_Widget(buttons, iClob(newIcon_LabelWidget(add_Icon, 0, 0, "tabs.new")),
1529 moveToParentRightEdge_WidgetFlag), 1544 moveToParentRightEdge_WidgetFlag | collapse_WidgetFlag),
1530 "newtab"); 1545 "newtab");
1531 } 1546 }
1532 /* Sidebars. */ { 1547 /* Sidebars. */ {
diff --git a/src/ui/root.h b/src/ui/root.h
index 7e831be3..a81ebdf7 100644
--- a/src/ui/root.h
+++ b/src/ui/root.h
@@ -43,6 +43,8 @@ void updatePadding_Root (iRoot *); /* TODO: is part of m
43void dismissPortraitPhoneSidebars_Root (iRoot *); 43void dismissPortraitPhoneSidebars_Root (iRoot *);
44void showToolbar_Root (iRoot *, iBool show); 44void showToolbar_Root (iRoot *, iBool show);
45void updateToolbarColors_Root (iRoot *); 45void updateToolbarColors_Root (iRoot *);
46void showOrHideNewTabButton_Root (iRoot *);
47
46void notifyVisualOffsetChange_Root (iRoot *); 48void notifyVisualOffsetChange_Root (iRoot *);
47 49
48iInt2 size_Root (const iRoot *); 50iInt2 size_Root (const iRoot *);