#3415 closed defect (fixed)
[PATCH] GUI - Dropdowns & Lists act as if scrollbar is visible, even if it's not
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 19 |
Component: | UI & Simulation | Keywords: | |
Cc: | Patch: |
Description
Take a look at dropdownlists that might have scrollbars, but only have so few elements that the scrollbar is not required and therefore invisible.
If you hover an element of that list at the righthand side, then that item will not be selected, while it should be.
CDropDown.cpp
acts as if the scrollbar is present, even if it's not.
This is generally not a problem, but annoying for the color picker in #1580, where the elements only contain one character.
Attachments (4)
Change History (18)
by , 9 years ago
Attachment: | t3415_cleanup_dropdown_v1.patch added |
---|
by , 9 years ago
Attachment: | t3415_fix_lists_invisible_scrollbar_v1.patch added |
---|
Fixes the bug (48 lines of context to make reviewing easier).
comment:1 by , 9 years ago
Keywords: | patch review added |
---|---|
Milestone: | Backlog → Alpha 19 |
Summary: | GUI - Dropdown list acts as if scrollbar is present, even if it's not → [PATCH] GUI - Dropdowns & Lists act as if scrollbar is visible, even if it's not |
A workaround would be to just add scrollbar="false" to the XML declaration.
comment:2 by , 9 years ago
1) Reproduce selection-highlight-bug with DropDown
:
- Open gamesetup
- Click on the Civ dropdown list
- Hover over multiple civs at the righthand side (last 10 pixels)
=> Although the mouse cursor is clearly on that civ item, the selection highlight is not updated
2) Reproduce click-bug with DropDown
:
- Open gamesetup
- Click on the Civ dropdown list
- Try to select a civ by clicking on the righthand side (last 10 pixels)
=> Clicking won't have an effect
3) Reproduce click-bug with List
:
- Open lobby
- Make sure only a few users are online, so that the scrollbar is invisible
- Try to select a player by clicking on the right side (last 10 pixels)
=> Clicking won't have an effect
comment:3 by , 9 years ago
Why the patch works:
- Bug is fixed by the first change in
CDropDown.cpp
- Bug is fixed by the change in
CList.cpp
. The change inIGUIScrollBar.h
introduces that used function. The change inCGUIScrollBarVertical.cpp
doesn't change the logic, but simplifies the code by using that function again.
- Bug is fixed by the bugfix of 3. and the second change in
CDropDown.cpp
comment:4 by , 9 years ago
Milestone: | Alpha 19 → Alpha 20 |
---|
As mentioned above, #1580 has this bug and the workaround doesn't work around for 1600x1200. Since it does for lower resolutions and since probably nobody cares about the bug & patch in the next days, push it.
comment:5 by , 9 years ago
Milestone: | Alpha 20 → Alpha 19 |
---|
keep it in A19 as it is a bug with an available fix, so someone may have time to look at it during FF.
comment:6 by , 9 years ago
Owner: | set to |
---|
comment:7 by , 9 years ago
Was reported on the forums http://wildfiregames.com/forum/index.php?showtopic=20010#entry309410
comment:9 by , 9 years ago
Keywords: | reviewed added; review removed |
---|
Looks good. Someone should commit this.
follow-up: 11 comment:10 by , 9 years ago
Well, I tested it some time ago and was not fond of these narrower dropdown when scrollbars. It looks weird for me. Couldn't they be enlarged to fit the whole size ? I mean enlarging the active area instead of shrinking the area to the presently active one.
by , 9 years ago
Attachment: | without_patch.jpg added |
---|
by , 9 years ago
Attachment: | without_patch_after_resizing.jpg added |
---|
comment:11 by , 9 years ago
Replying to mimo:
not fond of these narrower dropdown when scrollbars.
Not sure what you are talking about. The size of the dropdown list doesn't change at all with the patch. It only changes the behavior of when clicks/mouseovers are processed.
- The part in
GUIM_MOUSE_MOTION
implements that hovering the mouse over the element works on the whole item area. - The two parts that update
GUIM_MOUSE_PRESS_LEFT
implement that clicking an element works on the whole item area. - The part in
CGUIScrollBarVertical::Draw
doesn't change the behavior at all, it is equivalent only beautifies the code.
Is this what you mean? The game already looks like this and my patch doesn't affect this.
I noticed a different bug though. When you resize the window, the color picker dropdown element from #1580 will be messed up sometimes. In this screenshot I resized from 1280x1024 to something else and back to 1280x1024. Notice the last three elements are missing.
This seems to be caused by the scrollbar="false"
property of that playerColorPicker[n]
element. It should be fixed for sure, but it has nothing to do with the patch.
comment:12 by , 9 years ago
Yes, you are right. My problem was the one shown on your without_patch.jpg, I just noticed it when testing your patch and (wrongly) thought it was duer to it. So that's fine for me.
Simplifies existing code by reusing
m_HideScrollBar
.