diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-14 15:36:48 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-14 15:36:48 +0300 |
commit | fe238b29132b43f07aa88cf6bb60bec1ff0d3f8d (patch) | |
tree | 34d08228270960a73f5586ae907a12d7adb7b393 /src/app.c | |
parent | 203426a88b2d94ed56f7d3f8f8eb18a7457cab11 (diff) |
Swiping and sidebar; various tweaks
When a page is opened from the sidebar, swiping back will now reopen the sidebar. Another swipe will dismiss the sidebar and navigate back as usual.
Attempted to cache theme colors in GmDocument, but there were issues with theme changes.
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2244,7 +2244,8 @@ iBool handleCommand_App(const char *cmd) { | |||
2244 | } | 2244 | } |
2245 | else if (equal_Command(cmd, "open")) { | 2245 | else if (equal_Command(cmd, "open")) { |
2246 | iString *url = collectNewCStr_String(suffixPtr_Command(cmd, "url")); | 2246 | iString *url = collectNewCStr_String(suffixPtr_Command(cmd, "url")); |
2247 | const iBool noProxy = argLabel_Command(cmd, "noproxy"); | 2247 | const iBool noProxy = argLabel_Command(cmd, "noproxy") != 0; |
2248 | const iBool fromSidebar = argLabel_Command(cmd, "fromsidebar") != 0; | ||
2248 | iUrl parts; | 2249 | iUrl parts; |
2249 | init_Url(&parts, url); | 2250 | init_Url(&parts, url); |
2250 | if (argLabel_Command(cmd, "default") || equalCase_Rangecc(parts.scheme, "mailto") || | 2251 | if (argLabel_Command(cmd, "default") || equalCase_Rangecc(parts.scheme, "mailto") || |
@@ -2295,7 +2296,9 @@ iBool handleCommand_App(const char *cmd) { | |||
2295 | else { | 2296 | else { |
2296 | urlEncodePath_String(url); | 2297 | urlEncodePath_String(url); |
2297 | } | 2298 | } |
2298 | setUrlFromCache_DocumentWidget(doc, url, isHistory); | 2299 | setUrlFlags_DocumentWidget(doc, url, |
2300 | (isHistory ? useCachedContentIfAvailable_DocumentWidgetSetUrlFlag : 0) | | ||
2301 | (fromSidebar ? openedFromSidebar_DocumentWidgetSetUrlFlag : 0)); | ||
2299 | /* Optionally, jump to a text in the document. This will only work if the document | 2302 | /* Optionally, jump to a text in the document. This will only work if the document |
2300 | is already available, e.g., it's from "about:" or restored from cache. */ | 2303 | is already available, e.g., it's from "about:" or restored from cache. */ |
2301 | const iRangecc gotoHeading = range_Command(cmd, "gotoheading"); | 2304 | const iRangecc gotoHeading = range_Command(cmd, "gotoheading"); |