Try commenting out lines 222-233
I tried it. My least favorite behavior is having a combination of large and small fonts in the same bar. It looks bad and there's still a breaking point. I think that being tricky with lots of automatic morphing gets dangerous. It creates mysteries and it can't know what the user actually wants. Things will appear/disappear and the user won't know why or how to govern it.
Here's what I'd propose, shooting the moon (bear with me):
- LVinfo implements a dynamic menu for each bar. Each menu has all the same items by name, alphabetcally:
Top bar ON Q>
Minimum size Small
Aperture ON
Dynamic range Auto
Focus mode ON
Focus distance OFF
…etc
- Modules register their items with LVinfo, but display of items is ultimately governed by the user setting ON, OFF, or AUTO for each item.
- All items are AUTO by default. Display of AUTO items is per the priority scheme. (I consider this a nice-to-have feature, with deterministic control a must-have)
- Modules register a maxWidth string with each item, used to calculate possibility of display and item position.
- The 'Minimum size' menu item determines the smallest font size the user is willing to tolerate in the bar. All items within a bar use the same font.
- Items set to OFF will never display
- Items set to ON will always display, but...
- When an item is set to ON, LVinfo calculates the possibility of display, according to the sum of maxWidths in the smallest font, per the current 'Minimum size' setting.
- If an ON item is impossible to display, a msgbox pops saying they need to turn something else OFF or choose a smaller Minimum size, if available.
- Display of items is per the following:
All OFF items don't display.
All ON items display as top priority, from the horizontal center of the bar.
A bar drops to whatever size is necessary to display all ON items, and as many AUTO items as possible; but not smaller than 'Minimum size'.
AUTO items are displayed on the horizontal outskirts of the bar, with lowest priority outermost.
AUTO items are dropped from the outskirts if space is unavailable.
An AUTO item displays in only one bar, per the current scheme.
Benefits:
1) User will always see the items they care about.
2) Bars will always be filled with interesting stuff, as long as enough items are AUTO or ON.
3) Size degrades consistently and not smaller than what the user will tolerate (Minimum size)
4) Items will not shift around when values change, because placement is based on maxWidth instead of current width.
5) Items will never disappear/appear just because a value changed.
6) Potentially less redrawing, since no shifting.
[EDIT] I think a user-driven solution like this is necessary when disparate modules are competing for the same screen real-estate. Arbitrary priority numbers from 3rd-party module developers cannot possibly represent what the user wants. Module developers would have to expose the LVinfo priority value through private UIs in order to give the user some kind of control. At that point the solution might as well be centralized like this.
[EDIT2] As a fail-safe, if an item value exceeds the width of its maxWidth, the layout will need to shift, and items could drop off, potentially even ON items. Robust module development could alleviate some, but not all cases. For example, max ISO could be known for a given camera, so that the maxWidth is absolutely correct. But lens characteristics are unknowable, so the lens.c needs to make some guesses and be wrong sometimes.
[EDIT3] If this solution is untenable due to wasted space from excessive maxWidth, then I propose replacing ON with "ON, important" and AUTO with "ON". In this scheme, "ON, important" sets the high bit of the item priority, making it super high. "ON" leaves the priority as is, and OFF is OFF. This model is not deterministic and items still shift/fall off when values change. For clarity I'll restate it completely here:
Alternate Plan:- LVinfo implements a dynamic menu for each bar. Each menu has all the same items by name, alphabetcally:
Top bar ON Q>
Minimum size Small
Aperture ON, important
Dynamic range ON
Focus mode ON, important
Focus distance OFF
…etc
- Modules register their items with LVinfo, but display of items is governed by the user setting ON, ON Important, or OFF for each item.
- All items are ON by default. Display of ON and 'ON, important' items is per the priority scheme, with 'ON, important' at a higher priority tier.
- The 'Minimum size' menu item determines the smallest font size the user is willing to tolerate in the bar. All items within a bar use the same font.
- Items set to OFF will never display
- Display of items is per the following:
All OFF items don't display.
'ON, important' and ON items display in priority order from the horizontal center of the bar.
A bar drops to whatever size is necessary to display as many 'ON, important' and ON items as possible; but not smaller than 'Minimum size'.
ON items are dropped from the outskirts when space is unavailable.
'ON, important' items are dropped next when space is unavailable.
An ON item displays in only one bar.
Benefits:
1) User is more likely to see the items they care about.
2) Bars will always be filled with interesting stuff, as long as enough items are 'ON, important' or ON.
3) Size degrades consistently and not smaller than what the user will tolerate (Minimum size)
Drawbacks:
1) Still possible for important items to disappear unexpectedly due to width.
2) Layout will shift regularly as values change
[EDIT4] Rather than to add items from the center out, it's probably better to go left to right. This way priority and order are the same. In this model items always drop off on the right:
items L -> R | batt% | length | aperture | shutter | ISO | WB | IS | focus mode |
module priority | 100 | 97 | 96 | 95 | 94 | 93 | 99 | 98 |
user priority | Important | Important | Important | Important | Important | Important | ON | ON |
Sorry for waffling. This is a tough one. I'll keep going until I think it's the best compromise. Please poke holes.