diff options
author | jcid <devnull@localhost> | 2007-10-24 22:24:01 +0200 |
---|---|---|
committer | jcid <devnull@localhost> | 2007-10-24 22:24:01 +0200 |
commit | 9c82e3b54e82bd6cd9a3541c289eaf9c5393ed63 (patch) | |
tree | f000ec305afb5a5a90f00be36e8eee94b889f7a6 /src/uicmd.cc | |
parent | 6490b8207de848c39894ca635497a7cd941d68d4 (diff) |
Implemented a new scheme of scroll-position remembering. This is one per
visited page intead of one per url (this is more standard).
Diffstat (limited to 'src/uicmd.cc')
-rw-r--r-- | src/uicmd.cc | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/uicmd.cc b/src/uicmd.cc index 8b5157f1..30ae1f28 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -482,7 +482,7 @@ void a_UIcmd_bugmeter_popup(void *vbw) { BrowserWindow *bw = (BrowserWindow*)vbw; - a_Menu_bugmeter_popup(bw, a_History_get_url(NAV_TOP(bw))); + a_Menu_bugmeter_popup(bw, a_History_get_url(NAV_TOP_UIDX(bw))); } /* @@ -503,7 +503,7 @@ int *a_UIcmd_get_history(BrowserWindow *bw, int direction) // Fill the list i = a_Nav_stack_ptr(bw) + direction; for (j = 0 ; i >= 0 && i < a_Nav_stack_size(bw); i+=direction, j += 1) { - hlist[j] = NAV_IDX(bw,i); + hlist[j] = NAV_UIDX(bw,i); } hlist[j] = -1; @@ -546,6 +546,30 @@ void a_UIcmd_get_scroll_xy(BrowserWindow *bw, int *x, int *y) } /* + * Set the scroll position ({x, y} offset pair) + */ +void a_UIcmd_set_scroll_xy(BrowserWindow *bw, int x, int y) +{ + Layout *layout = (Layout*)bw->render_layout; + + if (layout) { + layout->scrollTo(HPOS_LEFT, VPOS_TOP, x, y, 0, 0); + } +} + +/* + * Set the scroll position by fragment (from URL) + */ +void a_UIcmd_set_scroll_by_fragment(BrowserWindow *bw, const char *f) +{ + Layout *layout = (Layout*)bw->render_layout; + + if (layout && f) { + layout->setAnchor(f); + } +} + +/* * Get location's text */ char *a_UIcmd_get_location_text(BrowserWindow *bw) |