[project @ 2004-07-26 22:23:40 by rjw]

Hotlist toolbar icon shading. Fix for GIF animation artifacts under certain conditions.

svn path=/import/netsurf/; revision=1151
This commit is contained in:
Richard Wilson 2004-07-26 22:23:40 +00:00
parent b59616c9ab
commit 456077353c
6 changed files with 24 additions and 8 deletions

View File

@ -234,8 +234,12 @@ void nsgif_animate(void *p)
data.redraw.height = c->data.gif.gif->frames[c->data.gif.current_frame].redraw_height; data.redraw.height = c->data.gif.gif->frames[c->data.gif.current_frame].redraw_height;
/* redraw background (true) or plot on top (false) */ /* redraw background (true) or plot on top (false) */
data.redraw.full_redraw = if (c->data.gif.current_frame > 0) {
c->data.gif.gif->frames[c->data.gif.current_frame].redraw_required; data.redraw.full_redraw =
c->data.gif.gif->frames[c->data.gif.current_frame - 1].redraw_required;
} else {
data.redraw.full_redraw = true;
}
/* other data */ /* other data */
data.redraw.object = c; data.redraw.object = c;

View File

@ -245,7 +245,6 @@ int gif_initialise(struct gif_animation *gif) {
if (gif->frame_count_partial > 0) { if (gif->frame_count_partial > 0) {
/* Set the redraw for the first frame to the maximum frame size /* Set the redraw for the first frame to the maximum frame size
*/ */
gif->frames[0].redraw_required = 0;
gif->frames[0].redraw_x = 0; gif->frames[0].redraw_x = 0;
gif->frames[0].redraw_y = 0; gif->frames[0].redraw_y = 0;
gif->frames[0].redraw_width = gif->width; gif->frames[0].redraw_width = gif->width;
@ -517,7 +516,7 @@ int gif_initialise_frame(struct gif_animation *gif) {
/* if we are clearing the background then we need to redraw enough to cover the previous /* if we are clearing the background then we need to redraw enough to cover the previous
frame too frame too
*/ */
if (((background_action == 2) || (background_action == 3)) && (frame > 0)) { if ((background_action == 2) || (background_action == 3)) {
gif->frames[frame].redraw_required = 1; gif->frames[frame].redraw_required = 1;
} }

View File

@ -129,6 +129,9 @@ void ro_gui_save_options(void);
bool ro_gui_dialog_keypress(wimp_key *key); bool ro_gui_dialog_keypress(wimp_key *key);
void ro_gui_dialog_close(wimp_w close); void ro_gui_dialog_close(wimp_w close);
void ro_gui_redraw_config_th_pane(wimp_draw *redraw); void ro_gui_redraw_config_th_pane(wimp_draw *redraw);
void ro_gui_menu_prepare_hotlist(void);
void ro_gui_dialog_open_config(void);
void ro_gui_dialog_update_config(wimp_w w);
/* in download.c */ /* in download.c */
void ro_gui_download_init(void); void ro_gui_download_init(void);

View File

@ -388,6 +388,7 @@ void ro_gui_hotlist_show(void) {
/* Open the window at the top of the stack /* Open the window at the top of the stack
*/ */
ro_gui_menu_prepare_hotlist();
state.next = wimp_TOP; state.next = wimp_TOP;
error = xwimp_open_window((wimp_open*)&state); error = xwimp_open_window((wimp_open*)&state);
if (error) { if (error) {
@ -1396,11 +1397,13 @@ void ro_gui_hotlist_click(wimp_pointer *pointer) {
false, true); false, true);
entry->selected = true; entry->selected = true;
hotlist_redraw_entry_title(entry); hotlist_redraw_entry_title(entry);
ro_gui_menu_prepare_hotlist();
} }
} else if (buttons == (wimp_CLICK_ADJUST << 8)) { } else if (buttons == (wimp_CLICK_ADJUST << 8)) {
entry->selected = !entry->selected; entry->selected = !entry->selected;
hotlist_redraw_entry_title(entry); hotlist_redraw_entry_title(entry);
ro_gui_menu_prepare_hotlist();
} }
/* Check if we should open the URL /* Check if we should open the URL
@ -1411,6 +1414,7 @@ void ro_gui_hotlist_click(wimp_pointer *pointer) {
if (buttons == wimp_DOUBLE_SELECT) { if (buttons == wimp_DOUBLE_SELECT) {
ro_gui_hotlist_selection_state(root.child_entry, ro_gui_hotlist_selection_state(root.child_entry,
false, true); false, true);
ro_gui_menu_prepare_hotlist();
} else { } else {
entry->selected = false; entry->selected = false;
ro_gui_dialog_close_persistant(hotlist_window); ro_gui_dialog_close_persistant(hotlist_window);
@ -1477,6 +1481,7 @@ void ro_gui_hotlist_click(wimp_pointer *pointer) {
if (buttons == (wimp_CLICK_SELECT << 8)) { if (buttons == (wimp_CLICK_SELECT << 8)) {
ro_gui_hotlist_selection_state(root.child_entry, ro_gui_hotlist_selection_state(root.child_entry,
false, true); false, true);
ro_gui_menu_prepare_hotlist();
} }
/* Handle the start of a drag /* Handle the start of a drag
@ -1489,6 +1494,7 @@ void ro_gui_hotlist_click(wimp_pointer *pointer) {
if (buttons == (wimp_CLICK_SELECT << 4)) { if (buttons == (wimp_CLICK_SELECT << 4)) {
ro_gui_hotlist_selection_state(root.child_entry, ro_gui_hotlist_selection_state(root.child_entry,
false, true); false, true);
ro_gui_menu_prepare_hotlist();
} }
/* Start a drag box /* Start a drag box
@ -1910,6 +1916,7 @@ void ro_gui_hotlist_selection_drag_end(wimp_dragged *drag) {
} else { } else {
ro_gui_hotlist_selection_drag(root.child_entry, x0, y0, x1, y1, true, true); ro_gui_hotlist_selection_drag(root.child_entry, x0, y0, x1, y1, true, true);
} }
ro_gui_menu_prepare_hotlist();
} }
@ -2334,7 +2341,6 @@ void ro_gui_hotlist_dialog_click(wimp_pointer *pointer) {
} }
} }
int ro_gui_hotlist_help(int x, int y) { int ro_gui_hotlist_help(int x, int y) {
struct hotlist_entry *entry; struct hotlist_entry *entry;
wimp_window_state state; wimp_window_state state;

View File

@ -52,7 +52,6 @@ static void ro_gui_menu_objectinfo(wimp_message_menu_warning *warning);
static void ro_gui_menu_object_reload(void); static void ro_gui_menu_object_reload(void);
static void ro_gui_menu_browser_warning(wimp_message_menu_warning *warning); static void ro_gui_menu_browser_warning(wimp_message_menu_warning *warning);
static void ro_gui_menu_hotlist_warning(wimp_message_menu_warning *warning); static void ro_gui_menu_hotlist_warning(wimp_message_menu_warning *warning);
static void ro_gui_menu_prepare_hotlist(void);
struct gui_window *current_gui; struct gui_window *current_gui;
wimp_menu *current_menu; wimp_menu *current_menu;
@ -1434,6 +1433,12 @@ void ro_gui_menu_prepare_hotlist(void) {
selection = ro_gui_hotlist_get_selected(false); selection = ro_gui_hotlist_get_selected(false);
selection_full = ro_gui_hotlist_get_selected(true); selection_full = ro_gui_hotlist_get_selected(true);
if (hotlist_toolbar) {
ro_gui_set_icon_shaded_state(hotlist_toolbar->toolbar_handle,
ICON_TOOLBAR_DELETE, (selection_full == 0));
ro_gui_set_icon_shaded_state(hotlist_toolbar->toolbar_handle,
ICON_TOOLBAR_LAUNCH, (selection == 0));
}
if (selection_full == 0) { if (selection_full == 0) {
hotlist_menu->entries[1].icon_flags |= wimp_ICON_SHADED; hotlist_menu->entries[1].icon_flags |= wimp_ICON_SHADED;
hotlist_menu->entries[3].icon_flags |= wimp_ICON_SHADED; hotlist_menu->entries[3].icon_flags |= wimp_ICON_SHADED;

View File

@ -145,8 +145,7 @@ struct toolbar *ro_toolbar_create(osspriteop_area *sprite_area, char *url_buffer
ro_toolbar_add_icon(toolbar, ro_toolbar_initialise_icon(sprite_area, "open", ICON_TOOLBAR_OPEN)); ro_toolbar_add_icon(toolbar, ro_toolbar_initialise_icon(sprite_area, "open", ICON_TOOLBAR_OPEN));
ro_toolbar_add_icon(toolbar, ro_toolbar_initialise_icon(sprite_area, "expand", ICON_TOOLBAR_EXPAND)); ro_toolbar_add_icon(toolbar, ro_toolbar_initialise_icon(sprite_area, "expand", ICON_TOOLBAR_EXPAND));
ro_toolbar_add_icon(toolbar, ro_toolbar_create_separator()); ro_toolbar_add_icon(toolbar, ro_toolbar_create_separator());
ro_toolbar_add_icon(toolbar, ro_toolbar_initialise_icon(sprite_area, "sort", ICON_TOOLBAR_SORT)); /* ro_toolbar_add_icon(toolbar, ro_toolbar_initialise_icon(sprite_area, "sort", ICON_TOOLBAR_SORT)); */
ro_toolbar_add_icon(toolbar, ro_toolbar_create_separator());
} }
/* Set the sprite area /* Set the sprite area