summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2004-06-30 17:59:18 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2004-06-30 17:59:18 +0000
commit146a529ac09ff81aed58992f842dd55cfd4952a4 (patch)
tree0004df9a8611aef3b966465e5828fa84347f8261
parentfece5a0287e470be950f0e929b5a7546d2c543db (diff)
downloadnetsurf-146a529ac09ff81aed58992f842dd55cfd4952a4.tar.gz
netsurf-146a529ac09ff81aed58992f842dd55cfd4952a4.tar.bz2
[project @ 2004-06-30 17:59:18 by rjw]
Minor window extent bugfixes svn path=/import/netsurf/; revision=1032
-rw-r--r--riscos/hotlist.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/riscos/hotlist.c b/riscos/hotlist.c
index 441fcba39..c652020fe 100644
--- a/riscos/hotlist.c
+++ b/riscos/hotlist.c
@@ -420,9 +420,12 @@ void ro_gui_hotlist_update_entry_size(struct hotlist_entry *entry) {
xwimptextop_string_width(entry->url,
strlen(entry->url) > 256 ? 256 : strlen(entry->url),
&width);
+ width += 32 + 36 + 8;
if (width < entry->collapsed_width) width = entry->collapsed_width;
+ entry->expanded_width = width;
+ } else {
+ entry->expanded_width = width + 32 + 36 + 8;
}
- entry->expanded_width = width + 32 + 36 + 8;
/* All entries are 44 units high
*/
@@ -434,6 +437,7 @@ void ro_gui_hotlist_update_entry_size(struct hotlist_entry *entry) {
* Redraws a section of the hotlist window
*/
void ro_gui_hotlist_redraw(wimp_draw *redraw) {
+ wimp_window_state state;
osbool more;
unsigned int size;
os_box extent = {0, 0, 0, 0};;
@@ -485,6 +489,9 @@ void ro_gui_hotlist_redraw(wimp_draw *redraw) {
extent.x1 = max_width;
extent.y0 = max_height;
xwimp_set_extent(hotlist_window, &extent);
+ state.w = hotlist_window;
+ wimp_get_window_state(&state);
+ wimp_open_window((wimp_open *) &state);
reformat_pending = false;
}
}
@@ -513,10 +520,6 @@ int ro_gui_hotlist_redraw_tree(struct hotlist_entry *entry, int level, int x0, i
} else {
entry->width = entry->collapsed_width;
}
- if ((x0 + entry->width) > (max_width + origin_x))
- max_width = x0 + entry->width - origin_x;
- if ((y0 - 44) < (max_height + origin_y))
- max_height = y0 - 44 - origin_y;
/* Redraw the item
*/
@@ -524,6 +527,13 @@ int ro_gui_hotlist_redraw_tree(struct hotlist_entry *entry, int level, int x0, i
box_y0 = y0;
cumulative += height;
+ /* Get the maximum extents
+ */
+ if ((x0 + entry->width) > (max_width + origin_x))
+ max_width = x0 + entry->width - origin_x;
+ if ((y0 - height) < (max_height + origin_y))
+ max_height = y0 - height - origin_y;
+
/* Draw the vertical links
*/
if (entry->next_entry) {
@@ -715,6 +725,7 @@ void ro_gui_hotlist_click(wimp_pointer *pointer) {
x_offset = x - entry->x0;
if ((x_offset < 32) || (buttons == wimp_DOUBLE_SELECT)) {
entry->expanded = !entry->expanded;
+ reformat_pending = true;
xwimp_force_redraw(hotlist_window, 0, -16384, 16384, 0);
} else {