summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xatari/browser_win.c19
-rwxr-xr-xatari/gui.c49
2 files changed, 35 insertions, 33 deletions
diff --git a/atari/browser_win.c b/atari/browser_win.c
index 1423e69e4..b09164c42 100755
--- a/atari/browser_win.c
+++ b/atari/browser_win.c
@@ -342,9 +342,8 @@ int window_destroy( struct gui_window * gw)
if( input_window == gw )
input_window = NULL;
- window_set_icon( gw, NULL );
-
if( gw->root ) {
+ window_set_icon( gw, NULL );
if( gw->root->toolbar )
tb_destroy( gw->root->toolbar );
@@ -405,11 +404,12 @@ void window_open( struct gui_window * gw)
void window_set_icon(struct gui_window * gw, struct bitmap * bmp )
-{
+{
+ /*
if( gw->icon != NULL ){
bitmap_destroy( gw->icon );
gw->icon = NULL;
- }
+ }*/
gw->icon = bmp;
}
@@ -634,7 +634,7 @@ static void __CDECL evnt_window_newtop( WINDOW *win, short buff[8], void *data )
LOG(("newtop: iw: %p, win: %p", input_window, win ));
assert( input_window != NULL );
- window_redraw_controls(input_window, 0);
+ /* window_redraw_controls(input_window, 0); */
}
static void __CDECL evnt_window_shaded( WINDOW *win, short buff[8], void *data )
@@ -652,7 +652,7 @@ static void __CDECL evnt_window_icondraw( WINDOW *win, short buff[8], void * dat
short x,y,w,h;
struct gui_window * gw = (struct gui_window*)data;
- LOG((""));
+ LOG((""));
WindClear( win);
WindGet( win, WF_WORKXYWH, &x, &y, &w, &h);
@@ -669,7 +669,12 @@ static void __CDECL evnt_window_icondraw( WINDOW *win, short buff[8], void * dat
plotter->move( plotter, x, y );
plotter->resize( plotter, w, h );
plotter->clip(plotter, &clip );
- plotter->bitmap( plotter, gw->icon, 0, 0, 0xffffff, BITMAPF_NONE );
+ plotter->bitmap_resize( plotter, gw->icon, w, h );
+ plotter->bitmap(
+ plotter,
+ ( gw->icon->resized ) ? gw->icon->resized : gw->icon,
+ 0, 0, 0xffffff, BITMAPF_NONE
+ );
}
}
diff --git a/atari/gui.c b/atari/gui.c
index ff7c034c4..47100aa0f 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -175,7 +175,7 @@ void gui_poll(bool active)
}
if( evnt.timer != 0 && !active ){
/* this suits for stuff with lower priority */
- //hotlist_redraw();
+ //hotlist_redraw();
atari_treeview_redraw( hl.tv );
}
}
@@ -246,14 +246,14 @@ void gui_window_destroy(struct gui_window *w)
}
if( w->next != NULL ) {
w->next->prev = w->prev;
- }
+ }
free(w);
- w = NULL;
-
- w = window_list;
- int dummy=0;
+ w = NULL;
+
+ w = window_list;
+ int dummy=0;
while( w != NULL ) {
- if( w->root ) {
+ if( w->root ) {
input_window = w;
break;
}
@@ -539,7 +539,6 @@ void gui_window_place_caret(struct gui_window *w, int x, int y, int height)
CMP_BROWSER b = w->browser;
if( w->browser->caret.current.g_w > 0 )
gui_window_remove_caret( w );
-
w->browser->caret.requested.g_x = x;
w->browser->caret.requested.g_y = y;
w->browser->caret.requested.g_w = 2;
@@ -577,17 +576,15 @@ gui_window_remove_caret(struct gui_window *w)
void
gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
-{
- /* Untestet, favicon support has been dropped, so this is dead code. */
-
-/*
- struct bitmap *icon_bitmap;
- icon_bitmap = (icon != NULL) ? content_get_bitmap(icon) : NULL;
- if (icon_bitmap != NULL) {
- window_set_icon( g, icon_bitmap );
+{
+ /* Untestet, favicon support has been dropped, so this is dead code. */
+ LOG((""));
+ struct bitmap *icon_bitmap;
+ icon_bitmap = (icon != NULL) ? content_get_bitmap(icon) : NULL;
+ if (icon_bitmap != NULL) {
+ window_set_icon( g, icon_bitmap );
}
-*/
-
+
}
void
@@ -962,16 +959,16 @@ nsurl *gui_get_resource_url(const char *path)
{
char buf[PATH_MAX];
char *raw;
- nsurl *url = NULL;
-
+ nsurl *url = NULL;
+
atari_find_resource((char*)&buf, path, path);
raw = path_to_url((char*)&buf);
- if (raw != NULL) {
- nsurl_create(raw, &url);
- free(raw);
- }
-
- return url;
+ if (raw != NULL) {
+ nsurl_create(raw, &url);
+ free(raw);
+ }
+
+ return url;
}
static void gui_init(int argc, char** argv)