Mercurial > mplayer.hg
comparison gui/win32/widgetrender.c @ 36898:049db0aeea85
Implement missing vpotmeter for the Win32 GUI.
This item hasn't been rendered so far, and therefore
neither its value would be set nor was there a mouse control.
author | ib |
---|---|
date | Wed, 12 Mar 2014 11:23:31 +0000 |
parents | f50427ad9ff6 |
children | a75d1fce0822 |
comparison
equal
deleted
inserted
replaced
36897:38234a308fd3 | 36898:049db0aeea85 |
---|---|
302 image *img = NULL; | 302 image *img = NULL; |
303 int height; | 303 int height; |
304 int y; | 304 int y; |
305 | 305 |
306 if(!dest) return; | 306 if(!dest) return; |
307 if((item->type == tyButton) || (item->type == tyHpotmeter) || (item->type == tyPotmeter)) | 307 if((item->type == tyButton) || (item->type == tyHpotmeter) || (item->type == tyVpotmeter) || (item->type == tyPotmeter)) |
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; |
325 | 325 |
326 /* redraw background */ | 326 /* redraw background */ |
327 if(item->type == tyButton) | 327 if(item->type == tyButton) |
328 render(skin->desktopbpp, dest, find_background(skin,item), item->x, item->y, item->x, item->y, img->width, height, 1); | 328 render(skin->desktopbpp, dest, find_background(skin,item), item->x, item->y, item->x, item->y, img->width, height, 1); |
329 | 329 |
330 if((item->type == tyHpotmeter) || (item->type == tyPotmeter)) | 330 if((item->type == tyHpotmeter) || (item->type == tyVpotmeter) || (item->type == tyPotmeter)) |
331 { | 331 { |
332 if(item->type == tyVpotmeter) | |
333 { | |
334 /* repaint the area behind the slider */ | |
335 render(skin->desktopbpp, dest, find_background(skin, item), item->wx, item->wy, item->wx, item->wy, item->width, item->wheight, 1); | |
336 item->y = (100 - item->value) * (item->wheight-item->height) / 100 + item->wy; | |
337 if((item->y + item->height) > (item->wy + item->wheight)) | |
338 item->y = item->wy + item->wheight - item->height; | |
339 if(item->y < item->wy) | |
340 item->y = item->wy; | |
341 } | |
342 else | |
343 { | |
332 /* repaint the area behind the slider */ | 344 /* repaint the area behind the slider */ |
333 render(skin->desktopbpp, dest, find_background(skin, item), item->wx, item->wy, item->wx, item->wy, item->wwidth, item->height, 1); | 345 render(skin->desktopbpp, dest, find_background(skin, item), item->wx, item->wy, item->wx, item->wy, item->wwidth, item->height, 1); |
334 item->x = item->value * (item->wwidth-item->width) / 100 + item->wx; | 346 item->x = item->value * (item->wwidth-item->width) / 100 + item->wx; |
335 if((item->x + item->width) > (item->wx + item->wwidth)) | 347 if((item->x + item->width) > (item->wx + item->wwidth)) |
336 item->x = item->wx + item->wwidth - item->width; | 348 item->x = item->wx + item->wwidth - item->width; |
337 if(item->x < item->wx) | 349 if(item->x < item->wx) |
338 item->x = item->wx; | 350 item->x = item->wx; |
351 } | |
339 } | 352 } |
340 render(skin->desktopbpp, dest, img, item->x, item->y, 0, y, img->width, height, 1); | 353 render(skin->desktopbpp, dest, img, item->x, item->y, 0, y, img->width, height, 1); |
341 } | 354 } |