Added menu items for foreground_images,background_images for fast access.

svn path=/trunk/netsurf/; revision=13387
This commit is contained in:
Ole Loots 2012-01-06 23:23:31 +00:00
parent 4259392e19
commit be2d2b4cea
2 changed files with 28 additions and 5 deletions

View File

@ -271,8 +271,20 @@ static void __CDECL menu_debug_render(WINDOW *win, int item, int title, void *da
(html_redraw_debug) ? 1 : 0 );
}
}
}
}
static void __CDECL menu_fg_images(WINDOW *win, int item, int title, void *data)
{
option_foreground_images = !option_foreground_images;
MenuIcheck( NULL, MAINMENU_M_FG_IMAGES, (option_foreground_images) ? 1 : 0);
}
static void __CDECL menu_bg_images(WINDOW *win, int item, int title, void *data)
{
option_background_images = !option_background_images;
MenuIcheck( NULL, MAINMENU_M_BG_IMAGES, (option_background_images) ? 1 : 0);
}
static void __CDECL menu_back(WINDOW *win, int item, int title, void *data)
{
LOG(("%s", __FUNCTION__));
@ -360,7 +372,9 @@ static struct s_menu_item_evnt menu_evnt_tbl[] =
{T_VIEW, MAINMENU_M_RELOAD, "Reload", menu_reload, {0,NK_F5,0}, NULL},
{T_VIEW, MAINMENU_M_TOOLBARS, "Toolbars", menu_toolbars, {0,0,0}, NULL},
{T_VIEW, MAINMENU_M_SAVEWIN, "", menu_savewin, {0,0,0}, NULL},
{T_VIEW, MAINMENU_M_DEBUG_RENDER, "", menu_debug_render, {0,0,0}, NULL},
{T_VIEW, MAINMENU_M_DEBUG_RENDER, "", menu_debug_render, {0,0,0}, NULL},
{T_VIEW, MAINMENU_M_FG_IMAGES, "", menu_fg_images, {0,0,0}, NULL},
{T_VIEW, MAINMENU_M_BG_IMAGES, "", menu_bg_images, {0,0,0}, NULL},
{T_VIEW, MAINMENU_M_STOP, "Stop", menu_stop, {0,0,0}, NULL},
{T_NAV, MAINMENU_M_BACK, "Back", menu_back, {0,0,0}, NULL},
{T_NAV, MAINMENU_M_FORWARD, "Forward", menu_forward, {0,0,0}, NULL},
@ -654,6 +668,13 @@ static void set_menu_title(int rid, const char * nsid)
count++;
}
}
}
void main_menu_update( void )
{
MenuIcheck( NULL, MAINMENU_M_DEBUG_RENDER, (html_redraw_debug) ? 1 : 0);
MenuIcheck( NULL, MAINMENU_M_FG_IMAGES, (option_foreground_images) ? 1 : 0);
MenuIcheck( NULL, MAINMENU_M_BG_IMAGES, (option_background_images) ? 1 : 0);
}
@ -749,7 +770,8 @@ void bind_global_events( void )
MenuText( NULL, menu_evnt_tbl[i].rid, menu_evnt_tbl[i].menustr );
}
i++;
}
}
main_menu_update();
/* TODO: Fix pixel sizes for Titles and Items (for non-8px fonts) */
}

View File

@ -56,7 +56,8 @@ struct s_menu_item_evnt {
*/
void bind_global_events( void );
void unbind_global_events( void );
void unbind_global_events( void );
void main_menu_update( void );
#endif