diff options
-rw-r--r-- | dillorc | 9 | ||||
-rw-r--r-- | src/menu.cc | 20 | ||||
-rw-r--r-- | src/prefs.c | 1 | ||||
-rw-r--r-- | src/prefs.h | 1 | ||||
-rw-r--r-- | src/prefsparser.cc | 1 | ||||
-rw-r--r-- | src/styleengine.cc | 1 |
6 files changed, 29 insertions, 4 deletions
@@ -14,10 +14,15 @@ # geometry=650x545+0+20 #geometry=780x580 -# Change this if you want to have text-only browsing from the start. -# (While browsing, this can be changed from the tools/settings menu.) +# Change this (and the following option) if you want to have text-only browsing +# from the start. (While browsing, this can be changed from the tools/settings +# menu.) #load_images=YES +# Change this if you do not want background images to be loaded initially. +# (While browsing, this can be changed from the tools/settings menu.) +#load_background_images=YES + # Change this if you want to disable loading of CSS stylesheets initially. # (While browsing, this can be changed from the tools/settings menu.) #load_stylesheets=YES diff --git a/src/menu.cc b/src/menu.cc index 617297ce..b93106e1 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -679,6 +679,18 @@ static void Menu_imgload_toggle_cb(Fl_Widget *wid, void*) } /* + * Toggle loading of background images. + */ +static void Menu_bgimg_load_toggle_cb(Fl_Widget *wid, void*) +{ + Fl_Menu_Item *item = (Fl_Menu_Item*) wid; + + item->flags ^= FL_MENU_VALUE; + prefs.load_background_images = item->flags & FL_MENU_VALUE ? 1 : 0; + a_UIcmd_repush(popup_bw); +} + +/* * Tools popup menu (construction & popup) */ void a_Menu_tools_popup(BrowserWindow *bw, int x, int y) @@ -691,6 +703,8 @@ void a_Menu_tools_popup(BrowserWindow *bw, int x, int y) {"Use embedded CSS", 0, Menu_embedded_css_cb, 0, FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0}, {"Load images", 0, Menu_imgload_toggle_cb, 0, + FL_MENU_TOGGLE,0,0,0,0}, + {"Load background images", 0, Menu_bgimg_load_toggle_cb, 0, FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0}, {"Panel size", 0, Menu_nop_cb, (void*)"Submenu1", FL_SUBMENU,0,0,0,0}, {"tiny", 0,Menu_panel_change_cb,(void*)0,FL_MENU_RADIO,0,0,0,0}, @@ -713,8 +727,10 @@ void a_Menu_tools_popup(BrowserWindow *bw, int x, int y) pm[1].set(); if (prefs.load_images) pm[2].set(); - pm[4+cur_panelsize].setonly(); - cur_smallicons ? pm[7].set() : pm[7].clear(); + if (prefs.load_background_images) + pm[3].set(); + pm[5+cur_panelsize].setonly(); + cur_smallicons ? pm[8].set() : pm[8].clear(); item = pm->popup(x, y); if (item) { diff --git a/src/prefs.c b/src/prefs.c index a192c324..257e4a05 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -68,6 +68,7 @@ void a_Prefs_init(void) prefs.http_user_agent = dStrdup(PREFS_HTTP_USER_AGENT); prefs.limit_text_width = FALSE; prefs.load_images=TRUE; + prefs.load_background_images=TRUE; prefs.load_stylesheets=TRUE; prefs.middle_click_drags_page = TRUE; prefs.middle_click_opens_new_tab = TRUE; diff --git a/src/prefs.h b/src/prefs.h index de3e0342..bb97651e 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -88,6 +88,7 @@ typedef struct { bool_t show_quit_dialog; bool_t fullwindow_start; bool_t load_images; + bool_t load_background_images; bool_t load_stylesheets; bool_t parse_embedded_css; int32_t buffered_drawing; diff --git a/src/prefsparser.cc b/src/prefsparser.cc index 86f8580c..81b097e7 100644 --- a/src/prefsparser.cc +++ b/src/prefsparser.cc @@ -79,6 +79,7 @@ int PrefsParser::parseOption(char *name, char *value) { "http_user_agent", &prefs.http_user_agent, PREFS_STRING }, { "limit_text_width", &prefs.limit_text_width, PREFS_BOOL }, { "load_images", &prefs.load_images, PREFS_BOOL }, + { "load_background_images", &prefs.load_background_images, PREFS_BOOL }, { "load_stylesheets", &prefs.load_stylesheets, PREFS_BOOL }, { "middle_click_drags_page", &prefs.middle_click_drags_page, PREFS_BOOL }, diff --git a/src/styleengine.cc b/src/styleengine.cc index 5b3b34f0..98b31d32 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -524,6 +524,7 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, Color::create(layout, prefs.white_bg_replacement); break; case CSS_PROPERTY_BACKGROUND_IMAGE: + if (prefs.load_background_images) { DilloUrl *imgUrl = a_Url_new (p->value.strVal, a_Url_str (url)); |