mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-24 03:12:05 +03:00
Added toolbar image folder option.
svn path=/trunk/netsurf/; revision=13982
This commit is contained in:
parent
4cb8c980ac
commit
fda51d4010
@ -32,6 +32,7 @@
|
||||
int atari_transparency; \
|
||||
int atari_image_toolbar; \
|
||||
int atari_toolbar_bg; \
|
||||
char *atari_image_toolbar_folder; \
|
||||
char *atari_face_sans_serif; /* default sans face */ \
|
||||
char *atari_face_sans_serif_bold; /* bold sans face */ \
|
||||
char *atari_face_sans_serif_italic; /* bold sans face */ \
|
||||
@ -48,28 +49,29 @@
|
||||
char *hotlist_file; \
|
||||
char *tree_icons_path
|
||||
|
||||
#define NSOPTION_EXTRA_DEFAULTS \
|
||||
.atari_screen_driver = (char*)"vdi", \
|
||||
.atari_font_driver = (char*)"vdi", \
|
||||
.atari_font_monochrom = 0, \
|
||||
.atari_dither = 1, \
|
||||
.atari_transparency = 1, \
|
||||
.atari_image_toolbar = 0, \
|
||||
.atari_toolbar_bg = 8, \
|
||||
.atari_face_sans_serif = NULL, \
|
||||
.atari_face_sans_serif_bold = NULL, \
|
||||
.atari_face_sans_serif_italic = NULL, \
|
||||
.atari_face_sans_serif_italic_bold = NULL, \
|
||||
.atari_face_monospace = NULL, \
|
||||
.atari_face_monospace_bold = NULL, \
|
||||
.atari_face_serif = NULL, \
|
||||
.atari_face_serif_bold = NULL, \
|
||||
.atari_face_cursive = NULL, \
|
||||
.atari_face_fantasy = NULL, \
|
||||
.atari_editor = (char*)"", \
|
||||
.downloads_path = (char*)"", \
|
||||
.url_file = (char*)"url.db", \
|
||||
.hotlist_file = (char*)"hotlist", \
|
||||
#define NSOPTION_EXTRA_DEFAULTS \
|
||||
.atari_screen_driver = (char*)"vdi", \
|
||||
.atari_font_driver = (char*)"vdi", \
|
||||
.atari_font_monochrom = 0, \
|
||||
.atari_dither = 1, \
|
||||
.atari_transparency = 1, \
|
||||
.atari_image_toolbar_folder = (char*)"default", \
|
||||
.atari_image_toolbar = 0, \
|
||||
.atari_toolbar_bg = 8, \
|
||||
.atari_face_sans_serif = NULL, \
|
||||
.atari_face_sans_serif_bold = NULL, \
|
||||
.atari_face_sans_serif_italic = NULL, \
|
||||
.atari_face_sans_serif_italic_bold = NULL, \
|
||||
.atari_face_monospace = NULL, \
|
||||
.atari_face_monospace_bold = NULL, \
|
||||
.atari_face_serif = NULL, \
|
||||
.atari_face_serif_bold = NULL, \
|
||||
.atari_face_cursive = NULL, \
|
||||
.atari_face_fantasy = NULL, \
|
||||
.atari_editor = (char*)"", \
|
||||
.downloads_path = (char*)"", \
|
||||
.url_file = (char*)"url.db", \
|
||||
.hotlist_file = (char*)"hotlist", \
|
||||
.tree_icons_path = (char*)"./res/icons"
|
||||
|
||||
#define NSOPTION_EXTRA_TABLE \
|
||||
@ -81,6 +83,7 @@
|
||||
{ "atari_transparency", OPTION_INTEGER, &nsoptions.atari_transparency },\
|
||||
{ "atari_dither", OPTION_INTEGER, &nsoptions.atari_dither },\
|
||||
{ "atari_editor", OPTION_STRING, &nsoptions.atari_editor },\
|
||||
{ "atari_image_toolbar_folder", OPTION_STRING, &nsoptions.atari_image_toolbar_folder },\
|
||||
{ "font_face_sans_serif", OPTION_STRING, &nsoptions.atari_face_sans_serif },\
|
||||
{ "font_face_sans_serif_bold", OPTION_STRING, &nsoptions.atari_face_sans_serif_bold },\
|
||||
{ "font_face_sans_serif_italic", OPTION_STRING, &nsoptions.atari_face_sans_serif_italic },\
|
||||
|
@ -61,7 +61,7 @@ extern struct gui_window * input_window;
|
||||
static OBJECT * toolbar_buttons = NULL;
|
||||
static OBJECT * throbber_form = NULL;
|
||||
static bool img_toolbar = false;
|
||||
static char * img_toolbar_folder = (char *)"default";
|
||||
static char * toolbar_image_folder = (char *)"default";
|
||||
static short toolbar_bg_color = LWHITE;
|
||||
static hlcache_handle * toolbar_image;
|
||||
static hlcache_handle * throbber_image;
|
||||
@ -153,20 +153,26 @@ void toolbar_init( void )
|
||||
short vdicolor[3];
|
||||
uint32_t rgbcolor;
|
||||
|
||||
toolbar_image_folder = nsoption_charp(atari_image_toolbar_folder);
|
||||
toolbar_bg_color = MIN(15,nsoption_int(atari_toolbar_bg));
|
||||
img_toolbar = (nsoption_int( atari_image_toolbar ) > 0 ) ? true : false;
|
||||
if( img_toolbar ){
|
||||
|
||||
char imgfile[PATH_MAX];
|
||||
char imgfile[PATH_MAX];
|
||||
const char * imgfiletmpl = "toolbar/%s/%s";
|
||||
|
||||
while( tb_buttons[i].rsc_id != 0){
|
||||
tb_buttons[i].index = i;
|
||||
i++;
|
||||
}
|
||||
toolbar_image = load_icon( "toolbar/default/main.png",
|
||||
snprintf( imgfile, PATH_MAX-1, imgfiletmpl, toolbar_image_folder,
|
||||
"main.png" );
|
||||
toolbar_image = load_icon( imgfile,
|
||||
toolbar_icon_callback, NULL );
|
||||
snprintf( imgfile, PATH_MAX-1, imgfiletmpl, toolbar_image_folder,
|
||||
"throbber.png" );
|
||||
throbber_image = load_icon( imgfile,
|
||||
toolbar_icon_callback, NULL );
|
||||
throbber_image = load_icon( "toolbar/default/throbber.png",
|
||||
toolbar_icon_callback, NULL );
|
||||
|
||||
} else {
|
||||
RsrcGaddr( h_gem_rsrc, R_TREE, TOOLBAR, &toolbar_buttons );
|
||||
@ -181,7 +187,7 @@ void toolbar_init( void )
|
||||
for( i=0; i<n; i++ ){
|
||||
toolbar_styles[i].bgcolor = toolbar_bg_color;
|
||||
if( img_toolbar ){
|
||||
vq_color( vdih, toolbar_styles[i].bgcolor, 0, vdicolor );
|
||||
vq_color( vdih, toolbar_bg_color, 0, vdicolor );
|
||||
vdi1000_to_rgb( vdicolor, (unsigned char*)&rgbcolor );
|
||||
toolbar_styles[i].icon_bgcolor = rgbcolor;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user