Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#7733 closed feature request

GUI: Allow greying out dummy ListWidget entries

Reported by: fingolfin Owned by: lordhoto
Priority: low Component: GUI
Version: Keywords:
Cc: Game:

Description

It would be nice if ListWidget would allow marking select entries as "dummy" or "fake". Let me explain: Consider a list of savestates as in the GMM (global main menu). It lists all available save slots, together with a brief description of the save state in it. If there is no state stored in the slot, no description is drawn. But sometimes, a user saves a state without entering a description. In the past, we would draw the corresponding slot exactly like an empty slot. Bad. We fixed this by displaying a dummy description ("Untitled savestate") for savestates with an empty desc. (See also patch #2832247.)

Problem: These fake descs are not distinguishable from a real desc with the same content (a rather hypothetical issue, I admit). But still, it's annoying that fake names look the same as regular names. In another context, this could become a real problem.

Thus, it would be nice if one could tell ListWidget that an entry is fake. In response, ListWidget would draw that item with e.g. gray text instead of black text (the exact color would ideally be themeable). When in edit mode, then trying to edit an entry with such a fake entry would actually display the empty string for editing. I.e. if you select a fake entry, and enter edit mode, then instead of letting you edit the string "Untitled savestate" (or whatever else is used), it would act as if you were editing an entry with empty content. If you end editing with an empty entry again, nothing would happen; but if you end editing with something non-empty, the entry would loose its "fake" state.

This change would result in a more consistent user experience, I believe. Unfortunately, it would be a tad difficult to implement cleanly with the current theme code.

Ticket imported from: #2834637. Ticket imported from: feature-requests/549.

Attachments (2)

alt_list_color.patch (6.8 KB ) - added by lordhoto 15 years ago.
Patch against r43206 (trunk)
alt_list_color_v2.patch (7.6 KB ) - added by lordhoto 15 years ago.
Patch against r43438 (trunk).

Download all attachments as: .zip

Change History (8)

comment:1 by lordhoto, 15 years ago

Owner: set to lordhoto

comment:2 by lordhoto, 15 years ago

After I made the text color configuration independent from the font style, I was easily able to create a proof of concept patch for allowing the ListWidget to use the alternative color. Here it is. You will probably have to run "scummtheme.py makeall" from gui/themes so your theme files will be updated. Then it should be visible in the GMM load/save dialog at least.

The patch is probably more of a hack though, since I was unsure what would be the best way to add to the ListWidget string entries, which colors they should use. Anyway I'm open for comments.

by lordhoto, 15 years ago

Attachment: alt_list_color.patch added

Patch against r43206 (trunk)

comment:3 by lordhoto, 15 years ago

A slightly cleaned up version of the patch for the list color selection. Instead of an "bool" flag table, it uses now a table of ThemeEngine::FontColor values, which allows easy extension, if we allow more than two colors in the future.

I did look a bit into the automatic emptying of the selection if it's "Untitled Savestate". That might require some more thought, especially since currently there's no possibility to change single entries of the ListWidget as far as I can see (both string and color wise).

by lordhoto, 15 years ago

Attachment: alt_list_color_v2.patch added

Patch against r43438 (trunk).

comment:4 by lordhoto, 15 years ago

Status: newclosed

comment:5 by lordhoto, 15 years ago

I did implement the desired behavior now. I did not choose to let ListWidget worry about fake entries though. The client code of ListWidget is responsible for managing the colors etc. This gives us the possibility to use multiple color entries, even for (hyptothetical) uses, where no entry is a 'fake' entry.

Now we could also extend the "Add game" file dialog to display files grayed out and display directories in the normal color. That might give the user a smoother user experience. I will open up a feature request for that one ;-).

comment:6 by digitall, 6 years ago

Component: GUI
Note: See TracTickets for help on using tickets.