summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-12-15 12:58:58 +0000
committerJames Bursa <james@netsurf-browser.org>2003-12-15 12:58:58 +0000
commit101c358751ea7249db3540637ac0ebf48e324618 (patch)
tree4c4c8592a8a63366ca92f7e217ee3419c079f378
parent6cc6b610c77754d5457f2e8c4f61209144c31c18 (diff)
downloadnetsurf-101c358751ea7249db3540637ac0ebf48e324618.tar.gz
netsurf-101c358751ea7249db3540637ac0ebf48e324618.tar.bz2
[project @ 2003-12-15 12:58:58 by bursa]
Limit default window size, fix some warnings. svn path=/import/netsurf/; revision=430
-rw-r--r--riscos/window.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/riscos/window.c b/riscos/window.c
index 0f40f0efd..3fbee0859 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -11,9 +11,11 @@
* Browser window handling (implementation).
*/
+#include <assert.h>
#include <string.h>
#include "oslib/wimp.h"
#include "oslib/wimpspriteop.h"
+#include "netsurf/riscos/about.h"
#include "netsurf/riscos/gui.h"
#include "netsurf/riscos/theme.h"
#include "netsurf/utils/log.h"
@@ -21,9 +23,6 @@
gui_window *window_list = 0;
-static void gui_disable_icon(wimp_w w, wimp_i i);
-static void gui_enable_icon(wimp_w w, wimp_i i);
-
/**
* Create and open a new browser window.
@@ -31,7 +30,7 @@ static void gui_enable_icon(wimp_w w, wimp_i i);
gui_window *gui_create_browser_window(struct browser_window *bw)
{
- int width, height;
+ int screen_width, screen_height, win_width, win_height;
wimp_window window;
wimp_window_state state;
@@ -39,12 +38,17 @@ gui_window *gui_create_browser_window(struct browser_window *bw)
g->type = GUI_BROWSER_WINDOW;
g->data.browser.bw = bw;
- ro_gui_screen_size(&width, &height);
+ ro_gui_screen_size(&screen_width, &screen_height);
+
+ win_width = screen_width * 3 / 4;
+ if (1600 < win_width)
+ win_width = 1600;
+ win_height = win_width * 3 / 4;
- window.visible.x0 = width / 8;
- window.visible.y0 = height / 8;
- window.visible.x1 = width * 7 / 8;
- window.visible.y1 = height * 7 / 8;
+ window.visible.x0 = (screen_width - win_width) / 2;
+ window.visible.y0 = (screen_height - win_height) / 2;
+ window.visible.x1 = window.visible.x0 + win_width;
+ window.visible.y1 = window.visible.y0 + win_height;
window.xscroll = 0;
window.yscroll = 0;
window.next = wimp_TOP;
@@ -62,8 +66,8 @@ gui_window *gui_create_browser_window(struct browser_window *bw)
window.highlight_bg = wimp_COLOUR_CREAM;
window.extra_flags = 0;
window.extent.x0 = 0;
- window.extent.y0 = height * 3 / 4;
- window.extent.x1 = width * 3 / 4;
+ window.extent.y0 = win_height;
+ window.extent.x1 = win_width;
if ((bw->flags & browser_TOOLBAR) != 0)
{
window.extent.y1 = ro_theme_toolbar_height();
@@ -271,16 +275,6 @@ void gui_window_set_status(gui_window* g, const char* text)
}
-void gui_disable_icon(wimp_w w, wimp_i i)
-{
- wimp_set_icon_state(w, i, wimp_ICON_SHADED, wimp_ICON_SHADED);
-}
-
-void gui_enable_icon(wimp_w w, wimp_i i)
-{
- wimp_set_icon_state(w, i, 0, wimp_ICON_SHADED);
-}
-
void gui_window_message(gui_window* g, gui_message* msg)
{
if (g == NULL || msg == NULL)