Feature - Implemented Item Manager Highlighting

Ethelred

Member
I have the Item Manager configured to open as part of the Main Interface window. When I select it, it opens and I see two selector lists or panels. The one on the left is narrow and I'll call it the choice panel, since it don't know its actual name. The choice panel is divided into several categories and has a number of selectable, well, categories. They're all in black type against a white background. When I select one of them by clicking on it, it is highlighted in a darkish blue color and the text changes to white, so it is very easy to read. This then results in a new list being presented in the right hand panel, which I'll call the item list. Depending on which category I choose, the item list may consist of items listed in black type, mixed lines of black or gray type, or lines of text of various colors including back and gray. When I select one of the items, it is highlighted in the same darkish blue color, but in this panel, the text seems to change to black, instead of white like in the choice panel. What I'd like to see happen is that the text for the selected item change to white like it does for the category.

Some background:

I'm running Mac OS X 10.6.3 and mafia build 9814, currently. I update every day or two and this behaviour has been consistent ever since the change that added colors to the item list, a change I very much like.

The darkish blue highlight color is somewhat controlled by the Mac System Preferences, in as much as if I change my system highlight color to red, it will change to a darkish red. The blue I get, however, is much darker than the blue used by any other Mac applications for their highlight color. This may just be some java setting and not something under mafia's control. That's a mystery to me.

Thanks for your consideration and all the work that goes into KoLmafia.
 

roippi

Developer
First, some terminology:

When I select it, it opens and I see two selector lists or panels. The one on the left is narrow and I'll call it the choice panel, since it don't know its actual name.

CardLayoutSelectorPanel

This then results in a new list being presented in the right hand panel, which I'll call the item list.

UseItemEnqueuePanel

-----

Now, addressing the feature request:

Depending on which category I choose, the item list may consist of items listed in black type, mixed lines of black or gray type, or lines of text of various colors including back and gray. When I select one of the items, it is highlighted in the same darkish blue color, but in this panel, the text seems to change to black, instead of white like in the choice panel.

So, the color of highlighted text in UseItemEnqueuePanel is not actually black for everyone. That highlighted text color is controlled by your chosen Java Look and Feel. If you were to switch to the windows L&F, for example (if macs can even do that), I believe you would get blue highlights and white text. I assume that you're using the default OSX L&F, which has picked all of those colors for you: the background and foreground colors for highlighted items. We override the text color for non-highlighted items in accordance with the quality of the item, but leave everything else up to the L&F manager. So I'll reject that part of the feature request right now: I don't think we should override the color decisions of the Look and Feel.

Now, what's funny is that the CardLayoutSelectorPanel DOES override the default Look and Feel colors. If the feature request were to fix THOSE colors, I would completely accept it as a good feature request. However, I haven't heard of anyone disliking the way that looks, so I won't do that now. Plus, I feel like that would be punishing you for making this FR, since you like the way that's colored.

So, I'll just go ahead and mark this rejected. Let me know if I'm not understanding the request, or have it backwards, or if I'm just being a jerk. :)

ETA: There may be a way of actually tweaking your installed L&F's coloring. Google around and see if you can tweak your L+F's textHighlightText color.
 
Last edited:

Ethelred

Member
First, some terminology:



CardLayoutSelectorPanel



UseItemEnqueuePanel

-----

Now, addressing the feature request:



So, the color of highlighted text in UseItemEnqueuePanel is not actually black for everyone. That highlighted text color is controlled by your chosen Java Look and Feel. If you were to switch to the windows L&F, for example (if macs can even do that), I believe you would get blue highlights and white text. I assume that you're using the default OSX L&F, which has picked all of those colors for you: the background and foreground colors for highlighted items. We override the text color for non-highlighted items in accordance with the quality of the item, but leave everything else up to the L&F manager. So I'll reject that part of the feature request right now: I don't think we should override the color decisions of the Look and Feel.

Now, what's funny is that the CardLayoutSelectorPanel DOES override the default Look and Feel colors. If the feature request were to fix THOSE colors, I would completely accept it as a good feature request. However, I haven't heard of anyone disliking the way that looks, so I won't do that now. Plus, I feel like that would be punishing you for making this FR, since you like the way that's colored.

So, I'll just go ahead and mark this rejected. Let me know if I'm not understanding the request, or have it backwards, or if I'm just being a jerk. :)

ETA: There may be a way of actually tweaking your installed L&F's coloring. Google around and see if you can tweak your L+F's textHighlightText color.

Now this is where I'm getting confused. The CardLayoutSelectorPanel seems to me to obey my chosen OSX L&F, but the UseItemEnqueuePanel does not. But you say it's just the other way round. Are you sure you don't have it backwards? I can tweak my OSX L&F via the Mac system preferences just fine. In any event, there doesn't seem to be any way to change the L&F behaviour for only one panel. All I was asking is for both panels to behave the same way, preferably the way the CardLayoutSelectorPanel behaves, which seems like the right way to me.
 

Bale

Minion
Preferences -> Java L&F -> WindowsLookAndFeel

It changes the look and feel for the whole interface. That'll have to be good enough.
 

roippi

Developer
Now this is where I'm getting confused. The CardLayoutSelectorPanel seems to me to obey my chosen OSX L&F, but the UseItemEnqueuePanel does not. But you say it's just the other way round. Are you sure you don't have it backwards? I can tweak my OSX L&F via the Mac system preferences just fine. In any event, there doesn't seem to be any way to change the L&F behaviour for only one panel. All I was asking is for both panels to behave the same way, preferably the way the CardLayoutSelectorPanel behaves, which seems like the right way to me.

Pulled up the source code and I am slightly off. Both panels do hold to L&F defaults; the CardLayoutSelectorPanel does not override the L&F coloring for highlighted text. I can assure you that UseItemEnqueuePanel does not override it either; feel free to change your L&F around and see for yourself.

However, the two should be the same. They are, in fact, the same for all L&Fs that I have access to. So two things are going on simultaneously. One, I'll wager you've changed your default textHighlightText color. That, or something weird about the mac environment.

But two, the fact that the highlighted text color in these two panels can be different implies that they are using different L&F properties, which is not good. This was invisible to me when I implemented it before, as there are a bunch of redundant properties that are usually identical unless you manually change their defaults:

textHighlightText
FormattedTextField.selectionForeground
List.selectionForeground
TextArea.selectionForeground

etc. etc. And, just to be Annoying (yes, I mean that word), the Nimbus Look and Feel uses a completely different naming scheme from every other L&F:

List[Selected].textForeground

The reason that I chose to use the "textHighlightText" UImanager key is that it is one of the ONLY keys that is maintained across Nimbus and other L&Fs. It looks like that's not the right key though. Sigh. I'm guessing the proper key is List.selectionForeground, or whatever the Nimbus equivalent is.
 

Veracity

Developer
Staff member
Highlighted items in session tally display as black text on blue background

On the Adventure Frame, look at the Encounter List.

Combat: El Novio Cadáver (2)
Combat: pygmy witch accountant (3)
...

for example. Click on one of those and the background turns blue and the letters turn white. Nice and readable.

Now look at the Session Results:

bone abacus (50 meat ) (2)
briefcase (15 meat) (1)
Corpse Island iced tea (50 meat) (3)

The first has black text, the second grey, and the third is blue. That is because we color things based on consumption quality, "junk" status, and so on. Click on any of them and the background turns blue and the text turns black. Nice and difficult (for my eyes) to read.

I'm sure its a side effect of our ListCellRenderer that we use for that list and I expect the solution lies in that realm.
 

Veracity

Developer
Staff member
Actually, after he rejected it, he did some further investigation and discovered that it was not as black and white (heh) as he'd painted (heh) it; perhaps's he'd used the wrong color property to select the highlight color.

The reason that I chose to use the "textHighlightText" UImanager key is that it is one of the ONLY keys that is maintained across Nimbus and other L&Fs. It looks like that's not the right key though. Sigh. I'm guessing the proper key is List.selectionForeground, or whatever the Nimbus equivalent is.
That was from 09-10-2011. I just tried List.selectionForeground in place of textHighlightText and it works like a charm.

Revision 15112
 

Ethelred

Member
Actually, after he rejected it, he did some further investigation and discovered that it was not as black and white (heh) as he'd painted (heh) it; perhaps's he'd used the wrong color property to select the highlight color.

That was from 09-10-2011. I just tried List.selectionForeground in place of textHighlightText and it works like a charm.

Revision 15112

Thank you. I'm glad to see this has been implemented. I think it makes a definite improvement, at least for Macs.
 

Veracity

Developer
Staff member
No kidding. I have a Mac, too, and using the actual default UI colors makes a huge difference. Who'd have thought? :)
 
Top