Opened 12 years ago
Last modified 11 years ago
#1532 new enhancement
GUI - Dropdown improvements
Reported by: | historic_bruno | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | design |
Cc: | Patch: |
Description (last modified by )
- Implement disabled sprite and text color ("sprite_disabled", "textcolor_disabled")
- Implement hover/mouseover sprite and text color ("sprite_over", "textcolor_over")
- Implement pressed sprite and text color ("sprite_pressed"?, "textcolor_pressed")
- Dynamic size adjustment: currently the max height of the dropdown list is specified with "dropdown_size", it would be nice if it could adjust dynamically to fit in the window. Maybe as an option.
- Jump to the position of the currently selected item, when opening the dropdown. Same problem that CList has.
- Remember input focus when list is closed, so the dropdown can be navigated by arrow keys (scrollwheel too?) #698 is related.
Dropdowns are a bit weird, the property names are not intuitive or well-documented, here's an explanation I found in styles.xml:
Dropdown button: * size=shape * sprite=bkg * textcolor=text color Dropdown arrow button: * button_width=shape * sprite2=bkg * sprite2_pressed=bkg clicked Dropdown list: * buffer_zone=margin * dropdown_size=height * sprite_list=bkg * sprite_selectarea=bkg hovered item * textcolor_selected=text color hobered item
See GUI_-_Drop-down.
Attachments (1)
Change History (16)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Description: | modified (diff) |
---|
comment:3 by , 11 years ago
I'm pretty sure the 5th point is now in, perhaps even for lists. the 4th point in #698 is dealt with in the patch below.
Some comments on said patch:
-It doesn't handle lists since I'm not too sure what lists actually are. Code should be fairly easily transposable if needed.
-it will deal with any character a-z, 0-9, and spaces. You can input up to 100 characters (far more than required).
-It will reset itself every second. Sounds reasonable enough
-I also made the "return to position when reopening" and this kind of selection not make the selected element at the very top of the dropdown (I'm not clear, check in-game with a dropdown and you'll see what I mean: basically the selected element is now on the 3rd row.) I find it both more useful and aesthetically pleasing, it's an easy change back if needed.
by , 11 years ago
Attachment: | DropDownEasyAccess.patch added |
---|
comment:4 by , 11 years ago
Hmm. IMO, resetting every x seconds seems a bit bizarre. I think the convention on all three supported OSes is to just iterate through items beginning with the letter pressed.
follow-up: 11 comment:6 by , 11 years ago
Right. I guess what I am asking is why not just use the standard behavior of iterating?
comment:7 by , 11 years ago
Well I used the OSX way, which is about what I have done. Apparently Windows/Linux iterate through files starting with n when you keep pressing n, right?
comment:8 by , 11 years ago
Yes, they do. I am not really familiar with OSX, so that could explain the differing expectations.
comment:9 by , 11 years ago
It's up to design choice then. Perhaps I can change the implementation dependent on the platform to mimic the OS usage. On Windows/linux, it you type another key, it adds it to the original letter (ie "acro" gives you "acro") or it simply goes to the first with that letter ("acro" gives you A, then C, then R, then O?)
comment:10 by , 11 years ago
Would it be possible to keep track of how long time it takes between key presses? I.e. if you press "acro" almost instantly it searches for the entire word, if you wait a certain (though still short) amount of time between key presses it goes to the next starting letter rather than add to the existing letter/letters. That might work for everyone (or at least most people, you can't please everyone).
comment:11 by , 11 years ago
Replying to wraitii:
Some comments on said patch:
-It doesn't handle lists since I'm not too sure what lists actually are. Code should be fairly easily transposable if needed.
The old map selection in match setup was a list. I don't know if we actually have a list anymore, but we might in the future (with UI redesign). Also the selection part of the dropdown is a list.
Replying to zoot:
Right. I guess what I am asking is why not just use the standard behavior of iterating?
Not sure I agree that's standard behavior. At least on the web, I often see dropdowns behave somewhat as wraitii describes - actually more like feneur in his comment, a delay after the last letter pressed. Our in-game UI doesn't make any effort to conform to native UI behavior, as far as I know, so let's just decide what is most usable in the context of 0 A.D. and go with that.
I have to say, typing in words sounds more useful, because there's always arrow keys if you want to iterate through the list (A + [down arrow] is the same as pressing A several times would be under your proposal). But we also have someone focusing on UI design now (Pureon) so we could present both designs and ask for his preference.
comment:12 by , 11 years ago
I agree with feneur's suggestion. That's my preferred functionality and it would work as expected for most users due to the suggested key press delay.
comment:13 by , 11 years ago
Keywords: | design added |
---|
In 12107: