diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-10-22 07:22:15 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-10-22 07:22:15 +0300 |
commit | d14f9aebe27cd48a8d21c0eb691c8e7bf94722a8 (patch) | |
tree | da58c38b49dba1c45483eec89ea9408432655aea /src/app.c | |
parent | 525c0e24dca01a08ae389b271aee7400ebd8c16b (diff) |
Working on tab close buttons
An [x] button appears on tab buttons when hovering on them. Still needs a bit of layout tweaks and the first tab doesn't have a button yet.
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1889,6 +1889,7 @@ iDocumentWidget *newTab_App(const iDocumentWidget *duplicateOf, iBool switchToNe | |||
1889 | } | 1889 | } |
1890 | appendTabPage_Widget(tabs, as_Widget(doc), "", 0, 0); | 1890 | appendTabPage_Widget(tabs, as_Widget(doc), "", 0, 0); |
1891 | iRelease(doc); /* now owned by the tabs */ | 1891 | iRelease(doc); /* now owned by the tabs */ |
1892 | addTabCloseButton_Widget(tabs, as_Widget(doc), "tabs.close"); | ||
1892 | addChild_Widget(findChild_Widget(tabs, "tabs.buttons"), iClob(newTabButton)); | 1893 | addChild_Widget(findChild_Widget(tabs, "tabs.buttons"), iClob(newTabButton)); |
1893 | if (switchToNew) { | 1894 | if (switchToNew) { |
1894 | postCommandf_App("tabs.switch page:%p", doc); | 1895 | postCommandf_App("tabs.switch page:%p", doc); |
@@ -2586,7 +2587,7 @@ iBool handleCommand_App(const char *cmd) { | |||
2586 | else if (equal_Command(cmd, "tabs.close")) { | 2587 | else if (equal_Command(cmd, "tabs.close")) { |
2587 | iWidget *tabs = findWidget_App("doctabs"); | 2588 | iWidget *tabs = findWidget_App("doctabs"); |
2588 | #if defined (iPlatformMobile) | 2589 | #if defined (iPlatformMobile) |
2589 | /* Can't close the last on mobile. */ | 2590 | /* Can't close the last tab on mobile. */ |
2590 | if (tabCount_Widget(tabs) == 1 && numRoots_Window(get_Window()) == 1) { | 2591 | if (tabCount_Widget(tabs) == 1 && numRoots_Window(get_Window()) == 1) { |
2591 | postCommand_App("navigate.home"); | 2592 | postCommand_App("navigate.home"); |
2592 | return iTrue; | 2593 | return iTrue; |