Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2080 closed defect (fixed)

Add maximum scrollbar size and fix minimum scrollbar size.

Reported by: Josh Owned by: Josh
Priority: Should Have Milestone: Alpha 14
Component: UI & Simulation Keywords: patch performance
Cc: Patch:

Description

There is currently a minimum_bar_size property for scrollbars, but no matching maximum_bar_size property and minimum_bar size itself is bugged.

I have attached a patch which fixes both issues and does some micro-optimization and fixes some typos in the scrollbar code.

Attachments (3)

Scrollbar-changes.diff (8.1 KB ) - added by Josh 11 years ago.
Thoroughly-tested patch in git format.
scrollbar.2.diff (8.5 KB ) - added by Josh 11 years ago.
V4, also don't render scrollbars unless there is something to scroll.
scrollbar.diff (8.5 KB ) - added by Josh 11 years ago.
V5 (Style)

Download all attachments as: .zip

Change History (9)

by Josh, 11 years ago

Attachment: Scrollbar-changes.diff added

Thoroughly-tested patch in git format.

in reply to:  description comment:1 by historic_bruno, 11 years ago

When you create a ticket, please describe the bug in some detail so it can be confirmed and tested. I found discussion in the IRC logs today:

16:58 < Josh|> leper: You would get some really weird scaling issues
17:00 < Josh|> leper: You can see them by changing minimum_bar_size to something larger than the default in gui/common/setup.xml and you'll see the issue
17:01 < Josh|> (change it to something like 300 and open the learn to play window in-game and try scrolling)
17:01 < Josh|> I added maximum_bar_size because Pureon's new UI design will require that
17:03 < Josh|> The rest of the patch just fixes some /very/ inaccurate comments and correctly caches some calculations
17:04 < Josh|> (There were also some small changes to improve the code readability)
17:04 < leper> ok, I can reproduce the bug

comment:2 by historic_bruno, 11 years ago

Milestone: Alpha 14Alpha 15

by Josh, 11 years ago

Attachment: scrollbar.2.diff added

V4, also don't render scrollbars unless there is something to scroll.

by Josh, 11 years ago

Attachment: scrollbar.diff added

V5 (Style)

comment:3 by peter, 11 years ago

Resolution: fixed
Status: newclosed

In 13771:

General scrollbar improvements. Patch by Josh. Fixes #2080.

  • Don't show the scrollbar when the contents aren't overflowing the visible area.
  • Fix bugs in minimum bar sizing.
  • Add capability to set a maximum bar size.
  • Correct outdated/incorrect comments.

comment:4 by Josh, 11 years ago

Milestone: Alpha 15Alpha 14

comment:5 by alpha123, 11 years ago

Keywords: review removed
Summary: [PATCH] Add maximum scrollbar size and fix minimum scrollbar size.Add maximum scrollbar size and fix minimum scrollbar size.

Thanks for the patch. :)

comment:6 by historic_bruno, 11 years ago

Josh, since you are somewhat familiar with the scrollbar logic now, what do you think about #877?

Note: See TracTickets for help on using tickets.