Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/tooltips for truncated labels #16590

Merged

Conversation

@dragunoff
Copy link
Contributor

commented May 25, 2019

Truncate text labels that are overflowing their containers and add tooltips to them that display the full text.

Affected panels:

  • Savegame browser
  • Assets browser
  • Replay browser
  • Mission browser
  • Music player
  • Lobby music player
  • Server list
  • Lobby server list

Notes:

  • In a few places I had to add TooltipContainer with a unique name because the tooltips were rendering behind the panel
  • Also fixes a bug where tooltips in lobby-servers.yaml were not displayed at all (no bug here, that was my bad)

A few screens:
replay-browser
Replay browser

lobby-server-list
Lobby server list

muisc-player
Music player

TESTCASE changes the width of some containers to cause an overflow and adds long text to music and mission panels. To test savegame browser type a long name for the save file.

Closes #15026

@dragunoff dragunoff force-pushed the dragunoff:feature/tooltips-for-truncated-labels branch from ebb391a to 7664fea May 25, 2019

@dragunoff dragunoff force-pushed the dragunoff:feature/tooltips-for-truncated-labels branch from 7664fea to f8f7d0c May 25, 2019

@dragunoff

This comment has been minimized.

Copy link
Contributor Author

commented May 25, 2019

Updated to address the requested changes.

@pchote

This comment has been minimized.

Copy link
Member

commented May 25, 2019

Can you please reorder the commits so that the WidgetUtils changes are done first, and then the label/tooltip changes at the end use the new helper directly?

@dragunoff dragunoff force-pushed the dragunoff:feature/tooltips-for-truncated-labels branch from f8f7d0c to f2548a5 May 25, 2019

@dragunoff

This comment has been minimized.

Copy link
Contributor Author

commented May 25, 2019

Updated with new changes and reordered commits.

@dragunoff dragunoff force-pushed the dragunoff:feature/tooltips-for-truncated-labels branch from f2548a5 to 5d043b8 May 25, 2019

OpenRA.Mods.Common/Widgets/WidgetUtils.cs Outdated Show resolved Hide resolved
mods/cnc/chrome/gamesave-browser.yaml Show resolved Hide resolved
@@ -192,3 +195,4 @@ Container@MUSIC_PANEL:
Width: 300
Height: 20
Font: Small
TooltipContainer@MUSIC_TOOLTIP_CONTAINER:

This comment has been minimized.

Copy link
@pchote

pchote May 26, 2019

Member

Please keep the end-of-file newline here, same comment on the ID naming

mods/common/chrome/assetbrowser.yaml Outdated Show resolved Hide resolved
mods/common/chrome/gamesave-browser.yaml Show resolved Hide resolved
mods/common/chrome/musicplayer.yaml Outdated Show resolved Hide resolved
mods/cnc/chrome/lobby-servers.yaml Outdated Show resolved Hide resolved
mods/common/chrome/gamesave-browser.yaml Show resolved Hide resolved
mods/common/chrome/musicplayer.yaml Show resolved Hide resolved
dragunoff added 2 commits May 25, 2019
Add TruncateLabelWithTooltip helper function
* Move GetContrastColor helper to SpriteFont
* Move WidgetUtils  from OpenRA.Game.Widgets to OpenRA.Mods.Common.Widgets

@dragunoff dragunoff force-pushed the dragunoff:feature/tooltips-for-truncated-labels branch from 5d043b8 to 3313f59 May 26, 2019

@pchote
Copy link
Member

left a comment

LGTM and works as advertised. Testcase will need to be removed before merging.

@pchote pchote added the PR: Needs +2 label May 27, 2019

@abcdefg30 abcdefg30 removed the PR: Needs +2 label May 27, 2019

@abcdefg30

This comment has been minimized.

Copy link
Member

commented May 27, 2019

(This can be merged once the testcase is gone.)

@dragunoff dragunoff dismissed stale reviews from abcdefg30 and pchote via 851e4b6 May 27, 2019

@dragunoff dragunoff force-pushed the dragunoff:feature/tooltips-for-truncated-labels branch from 3313f59 to 851e4b6 May 27, 2019

@dragunoff

This comment has been minimized.

Copy link
Contributor Author

commented May 27, 2019

Testcase removed.

@abcdefg30 abcdefg30 merged commit fde2153 into OpenRA:bleed May 27, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@abcdefg30

This comment has been minimized.

Copy link
Member

commented May 27, 2019

@dragunoff dragunoff deleted the dragunoff:feature/tooltips-for-truncated-labels branch Jul 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.