summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-01-08 13:21:32 (GMT)
committer Chris Young <chris@unsatisfactorysoftware.co.uk>2017-01-08 13:21:32 (GMT)
commit05e4463230d8ae9880ac3aef38ca12f09d30d960 (patch)
treeb49fd71aed596ab49edd9c0ce874c9f1fb5132e4
parent074afb43f424d671ce6d00b140df851a26f3ddd7 (diff)
downloadnetsurf-05e4463230d8ae9880ac3aef38ca12f09d30d960.tar.gz
netsurf-05e4463230d8ae9880ac3aef38ca12f09d30d960.tar.bz2
Update corewindow scrollbars when user resizes window
-rw-r--r--frontends/amiga/corewindow.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 548ecac..2417d7b 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -66,6 +66,8 @@
#include "amiga/schedule.h"
#include "amiga/utf8.h"
+static void ami_cw_get_window_dimensions(struct core_window *cw, int *width, int *height);
+
static void
ami_cw_scroller_top(struct ami_corewindow *ami_cw, ULONG *restrict x, ULONG *restrict y)
{
@@ -539,6 +541,31 @@ ami_cw_drag_end(struct ami_corewindow *ami_cw, int x, int y)
}
/**
+ * User has resized window
+ */
+
+static void
+ami_cw_newsize(struct ami_corewindow *ami_cw)
+{
+ int win_w, win_h;
+ ami_cw_get_window_dimensions(ami_cw, &win_w, &win_h);
+
+ if(ami_cw->objects[GID_CW_HSCROLL] != NULL) {
+ RefreshSetGadgetAttrs((struct Gadget *)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL,
+ SCROLLER_Visible, win_w,
+ TAG_DONE);
+ }
+
+ if(ami_cw->objects[GID_CW_VSCROLL] != NULL) {
+ RefreshSetGadgetAttrs((struct Gadget *)ami_cw->objects[GID_CW_VSCROLL], ami_cw->win, NULL,
+ SCROLLER_Visible, win_h,
+ TAG_DONE);
+ }
+
+ ami_cw_redraw(ami_cw, NULL);
+}
+
+/**
* Main event loop for our core window
*
* \return TRUE if window destroyed
@@ -681,7 +708,7 @@ ami_cw_event(void *w)
break;
case WMHI_NEWSIZE:
- ami_cw_redraw(ami_cw, NULL);
+ ami_cw_newsize(ami_cw);
break;
case WMHI_CLOSEWINDOW: