diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-16 15:12:51 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-16 15:12:51 +0300 |
commit | e635e4c2c58afd3a329875b3b044d0df717b20a2 (patch) | |
tree | fa26b09975b65a5de30f625bbeca512c1f800adf /src/history.c | |
parent | cab02631292145ba1cf15e19edcd59116f3900b4 (diff) |
Back/Forward buttons vs. navigation position
The Back and Forward arrow buttons are disabled if the navigation position is at the end/beginning of the history.
IssueID #247
Diffstat (limited to 'src/history.c')
-rw-r--r-- | src/history.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/history.c b/src/history.c index 6876d8e3..48820f6d 100644 --- a/src/history.c +++ b/src/history.c | |||
@@ -268,6 +268,18 @@ iBool goForward_History(iHistory *d) { | |||
268 | return iFalse; | 268 | return iFalse; |
269 | } | 269 | } |
270 | 270 | ||
271 | iBool atLatest_History(const iHistory *d) { | ||
272 | iBool isLatest; | ||
273 | iGuardMutex(d->mtx, isLatest = (d->recentPos == 0)); | ||
274 | return isLatest; | ||
275 | } | ||
276 | |||
277 | iBool atOldest_History(const iHistory *d) { | ||
278 | iBool isOldest; | ||
279 | iGuardMutex(d->mtx, isOldest = (d->recentPos == size_Array(&d->recent) - 1)); | ||
280 | return isOldest; | ||
281 | } | ||
282 | |||
271 | const iGmResponse *cachedResponse_History(const iHistory *d) { | 283 | const iGmResponse *cachedResponse_History(const iHistory *d) { |
272 | const iRecentUrl *item = constMostRecentUrl_History(d); | 284 | const iRecentUrl *item = constMostRecentUrl_History(d); |
273 | return item ? item->cachedResponse : NULL; | 285 | return item ? item->cachedResponse : NULL; |