summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2004-08-30 21:57:47 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2004-08-30 21:57:47 +0000
commit98d17f19a6d901abd28f2c89975bcd5faad0f3ea (patch)
tree752955d95183b7b17853438f25fc9d3a2d198ac4 /riscos
parentc6ffb4b578aaa0fbfae9f3dd42619d7c098728ac (diff)
downloadnetsurf-98d17f19a6d901abd28f2c89975bcd5faad0f3ea.tar.gz
netsurf-98d17f19a6d901abd28f2c89975bcd5faad0f3ea.tar.bz2
[project @ 2004-08-30 21:57:47 by rjw]
Various small theme related fixes svn path=/import/netsurf/; revision=1256
Diffstat (limited to 'riscos')
-rw-r--r--riscos/dialog.c23
-rw-r--r--riscos/theme.c16
-rw-r--r--riscos/wimp.c15
-rw-r--r--riscos/window.c1
4 files changed, 45 insertions, 10 deletions
diff --git a/riscos/dialog.c b/riscos/dialog.c
index 943954b8d..2d6503789 100644
--- a/riscos/dialog.c
+++ b/riscos/dialog.c
@@ -565,6 +565,7 @@ void ro_gui_dialog_config_set(void) {
void ro_gui_dialog_click_config(wimp_pointer *pointer)
{
+ wimp_window_state state;
switch (pointer->i) {
case ICON_CONFIG_SAVE:
ro_gui_dialog_config_set();
@@ -601,8 +602,26 @@ void ro_gui_dialog_click_config(wimp_pointer *pointer)
ro_gui_set_icon_selected_state(dialog_config,
ICON_CONFIG_THEME, true);
ro_gui_open_pane(dialog_config, dialog_config_th, 0);
- ro_gui_open_pane(dialog_config_th,
- dialog_config_th_pane, 12);
+ state.w = dialog_config_th;
+ xwimp_get_window_state(&state);
+ state.w = dialog_config_th_pane;
+ state.visible.x0 += 12;
+ state.visible.x1 -= 12;
+ state.visible.y0 += 128;
+ state.visible.y1 -= 12;
+ xwimp_open_window_nested((wimp_open *) &state, dialog_config_th,
+ wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
+ << wimp_CHILD_XORIGIN_SHIFT |
+ wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
+ << wimp_CHILD_YORIGIN_SHIFT |
+ wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
+ << wimp_CHILD_LS_EDGE_SHIFT |
+ wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
+ << wimp_CHILD_BS_EDGE_SHIFT |
+ wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
+ << wimp_CHILD_RS_EDGE_SHIFT |
+ wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
+ << wimp_CHILD_TS_EDGE_SHIFT);
break;
}
}
diff --git a/riscos/theme.c b/riscos/theme.c
index 517bbe114..717bdcef0 100644
--- a/riscos/theme.c
+++ b/riscos/theme.c
@@ -587,6 +587,7 @@ bool ro_gui_theme_update_toolbar(struct theme_descriptor *descriptor, struct too
os_error *error;
osspriteop_area *sprite_area;
struct toolbar_icon *toolbar_icon;
+ int width;
if (!toolbar) return false;
/* Set the theme and window sprite area
@@ -785,9 +786,11 @@ bool ro_gui_theme_update_toolbar(struct theme_descriptor *descriptor, struct too
/* Force a re-processing of the toolbar
*/
+ width = toolbar->toolbar_current;
toolbar->reformat_buttons = true;
+ toolbar->toolbar_current = -1;
toolbar->status_current = -1;
- ro_gui_theme_process_toolbar(toolbar, toolbar->toolbar_current);
+ ro_gui_theme_process_toolbar(toolbar, width);
return true;
}
@@ -951,14 +954,13 @@ bool ro_gui_theme_process_toolbar(struct toolbar *toolbar, int width) {
/* Get the minimum height of the icons
*/
+ bottom_edge = left_edge;
if (toolbar->display_buttons) {
toolbar_icon = toolbar->icon;
while (toolbar_icon) {
if (toolbar_icon->display) {
- if (!toolbar->reformat_buttons) {
- left_edge += toolbar_icon->width;
- visible_icon = true;
- }
+ bottom_edge += toolbar_icon->width;
+ visible_icon = true;
if ((toolbar_icon->height != 0) &&
(toolbar->height < toolbar_icon->height + 8)) {
toolbar->height = toolbar_icon->height + 8;
@@ -966,13 +968,13 @@ bool ro_gui_theme_process_toolbar(struct toolbar *toolbar, int width) {
}
toolbar_icon = toolbar_icon->next;
}
- if (visible_icon) left_edge += 8;
+ if (visible_icon) bottom_edge += 8;
}
/* Check for minimum widths
*/
if (toolbar->type == THEME_BROWSER_TOOLBAR) {
- bottom_edge = left_edge;
+ if (!toolbar->reformat_buttons) left_edge = bottom_edge;
if (toolbar->display_url) bottom_edge += 32;
if (bottom_edge > right_edge) right_edge = bottom_edge;
if ((toolbar->theme) && (toolbar->display_throbber) &&
diff --git a/riscos/wimp.c b/riscos/wimp.c
index b178b848d..5c9202ca8 100644
--- a/riscos/wimp.c
+++ b/riscos/wimp.c
@@ -295,10 +295,23 @@ void ro_gui_set_window_title(wimp_w w, const char *text) {
*/
void ro_gui_set_caret_first(wimp_w w) {
int icon, button;
+ wimp_window_state win_state;
wimp_window_info_base window;
wimp_icon_state state;
os_error *error;
+ /* Check the window is open
+ */
+ win_state.w = w;
+ error = xwimp_get_window_state(&win_state);
+ if (error) {
+ LOG(("xwimp_get_window_state: 0x%x: %s",
+ error->errnum, error->errmess));
+ warn_user("WimpError", error->errmess);
+ return;
+ }
+ if (!(win_state.flags & wimp_WINDOW_OPEN)) return;
+
/* Get the window details
*/
window.w = w;
@@ -319,7 +332,7 @@ void ro_gui_set_caret_first(wimp_w w) {
state.i = icon;
error = xwimp_get_icon_state(&state);
if (error) {
- LOG(("xwimp_get_window_info: 0x%x: %s",
+ LOG(("xwimp_get_icon_state: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
return;
diff --git a/riscos/window.c b/riscos/window.c
index f6dce705d..627dce54d 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -792,6 +792,7 @@ void ro_gui_window_update_theme(void) {
ro_gui_theme_destroy_toolbar(hotlist_toolbar);
hotlist_toolbar = NULL;
}
+ ro_gui_theme_attach_toolbar(hotlist_toolbar, hotlist_window);
xwimp_force_redraw(hotlist_window, 0, -16384, 16384, 16384);
}