From bf974296adf971ecf48efb19c2ab262cd65925cc Mon Sep 17 00:00:00 2001 From: jcid Date: Mon, 29 Sep 2008 17:48:59 +0200 Subject: - Switched the image load button to be a per-window choice. --- src/ui.cc | 41 +++++++---------------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) (limited to 'src/ui.cc') diff --git a/src/ui.cc b/src/ui.cc index 89536d07..fd153f81 100644 --- a/src/ui.cc +++ b/src/ui.cc @@ -292,20 +292,6 @@ static void bugmeter_cb(Widget *wid, void *data) } } -/* - * Callback for the image loading button. - */ -static void imageload_cb(Widget *w, void *data) -{ - int k = event_key(); - //if (k && k <= 7) - // MSG("[ImageLoad], mouse button %d was pressed\n", k); - if (k == 1) { - ((UI*)data)->imageload_toggle(); - } -} - - ////////////////////////////////////////////////////////////////////////////// // UI class methods // @@ -677,17 +663,16 @@ UI::UI(int x, int y, int ww, int wh, const char* label, const UI *cur_ui) : // Image loading indicator ImageLoad = new HighlightButton(ww-il_w-bm_w,0,il_w,s_h,0); - ImgImageLoadOn = new xpmImage(imgload_on_xpm); + ImageLoad->type(Button::TOGGLE); ImgImageLoadOff = new xpmImage(imgload_off_xpm); - if (prefs.load_images) { - ImageLoad->image(ImgImageLoadOn); - } else { - ImageLoad->image(ImgImageLoadOff); - } + ImgImageLoadOn = new xpmImage(imgload_on_xpm); + ImgImageLoadMulti = new MultiImage(*ImgImageLoadOff,STATE,*ImgImageLoadOn); + ImageLoad->state(prefs.load_images); + ImageLoad->image(ImgImageLoadMulti); + ImageLoad->box(THIN_DOWN_BOX); ImageLoad->align(ALIGN_INSIDE|ALIGN_CLIP|ALIGN_LEFT); ImageLoad->tooltip("Toggle image loading"); - ImageLoad->callback(imageload_cb, this); ImageLoad->clear_tab_to_focus(); StatusPanel->add(ImageLoad); @@ -744,6 +729,7 @@ UI::~UI() */ void UI::delete_status_panel_images() { + delete ImgImageLoadMulti; delete ImgImageLoadOn; delete ImgImageLoadOff; delete ImgMeterOK; @@ -1051,19 +1037,6 @@ void UI::panelmode_cb_i() set_panelmode((UIPanelmode) !Panelmode); } -/* - * Toggle image loading - */ -void UI::imageload_toggle() -{ - prefs.load_images = !prefs.load_images; - if (prefs.load_images) { - ImageLoad->image(ImgImageLoadOn); - } else { - ImageLoad->image(ImgImageLoadOff); - } -} - /* * Set 'nw' as the main render area widget */ -- cgit v1.2.3