From: Scott F. <sc...@st...> - 2009-05-15 18:04:32
|
Nah I reset the icon counter. The problem is I want to display a bunch of icons in one layout, and some bars in another layout. You can't have both with the icons being allocated at the device level. One thing you could do is allow a layout to override this value. It's unobtrusive that way. On Fri, May 15, 2009 at 11:16 AM, Michael Reinelt <mi...@re...> wrote: > Hi Scott, > >> What's the purpose of allocating space for icons at the driver level? >> Having this moved to the layout level would allow much more freedom, >> but that may undermine whatever reason icons were allocated to begin >> with. I'm just thinking that allowing more freedom at the layout >> level, the better quality the overall collection of layouts. It's a >> harsh constraint when you're transitioning between layouts. All those >> icons go to waste and you're blocked from doing anything about it, but >> what's worse is you can starve any bars you may want to display. When >> it comes down to laying this allocation at the layout level, it sort >> of makes the allocation redundant and just another opcode. The layout >> author should have enough responsiblity, tech, and math to keep from >> flooding syslog. So I don't know what I'm suggesting. I'm just >> suggesting something different than a hard coded allocation. The >> dynamic allocation, or lack there of, is cheap and simple to >> implement. > > There are several (historic) reasons for this kind of implementation: > > - only "text" display require a icon limitation (graphic displays are handling icons and bars in a very different way) > > - only text displays that allow the definition of own chars support Icons at all > > That's the reason why this has been implemented on a per-driver level > > Sort of a "dynamic allocation" is impossible, because the bar driver absolutely requires to know how many chars are > available. If you dont believe me, take a look at the bar compaction code. This code is very...hrm... 'fragile' :-) > > on the other hand, it should be easy to re-use icons used in different layouts. maybe you forgot to free or reset the > icon counter when closing a layout? > > Moving the Icon counter to the layout section should be possible, but I'm not sure if this is the right way to go (think > of all the new graphic displays which don't care at all about this parameter) > > > bye, Michael > > -- > Michael Reinelt <mi...@re...> > http://home.pages.at/reinelt > GPG-Key 0xDF13BA50 > ICQ #288386781 > |