comparison gui/win32/widgetrender.c @ 36892:f50427ad9ff6

Internally map item 'potmeter' onto 'hpotmeter'. Former version of the GUI treated a potmeter very similar to a hpotmeter (the Win32 GUI still does so) and lots of skins are solely using potmeters instead of hpotmeters, although this doesn't make sense at all. The current version of the GUI is treating a potmeter differently, but in order to not break old skins, restore the old behaviour. For the X11/GTK GUI, a potmeter is now simply a hpotmeter with button=NULL and (button)width=(button)height=0. For the Win32 GUI (where skins unfortunately are handled a bit differently and things are more complicated) a potmeter is now a hpotmeter without button but (button)width=(widget)width and (button)height=(widget)height. Additionally, print a legacy information, because the item 'potmeter' is obsolete now and oughtn't be used any longer.
author ib
date Mon, 10 Mar 2014 17:32:29 +0000
parents 98568083fb1d
children 049db0aeea85
comparison
equal deleted inserted replaced
36891:c5ee0fc2ec75 36892:f50427ad9ff6
308 img = item->bitmap[0]; 308 img = item->bitmap[0];
309 309
310 if(!img) return; 310 if(!img) return;
311 311
312 y = item->y; 312 y = item->y;
313 if(item->type == tyPotmeter) 313 if(/* item->type == tyPotmeter */ /* legacy (potmeter) */ item->type == tyHpotmeter && item->width == item->wwidth)
314 { 314 {
315 height = img->height / item->phases; 315 height = img->height / item->phases;
316 y = height * (int)(item->value * item->phases / 100); 316 y = height * (int)(item->value * item->phases / 100);
317 if(y > img->height-height) 317 if(y > img->height-height)
318 y = img->height - height; 318 y = img->height - height;