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

Improve UX on dismissing the SettingsPanel #678

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

stonko1994
Copy link
Collaborator

Description

Currently the SettingsPanel only dismisses when explicitly clicking the settings button again, or after a timeout (web only). Therefore, it's tedious to close the SettingsPanel after changing a setting.

Changes

  • Adding a key-listener to close the SettingsPanel when hitting ESC (depending on the hardware).
  • Adding a new DismissClickOverlay which can be used to dismiss any Component when it's visible.

@@ -124,6 +126,13 @@ export class SettingsPanel extends Container<SettingsPanelConfig> {
player.on(player.exports.PlayerEvent.PlayerResized, handleResize);
}

const maybeCloseSettingsPanel = (event: KeyboardEvent) => {
const action = getKeyMapForPlatform()[event.keyCode];
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally use the deprecated event.keyCode here to support other Devices that do not have an Escape button. Such as TVs or gaming consoles. The Action.BACK mapping is already covered using the keyCode.

@stonko1994 stonko1994 changed the title Improve UX on dismissing the SettingsPanel Improve UX on dismissing the SettingsPanel Jan 14, 2025
@stonko1994 stonko1994 marked this pull request as ready for review January 14, 2025 15:41
…anel

# Conflicts:
#	src/scss/bitmovinplayer-ui.scss
#	src/ts/UIFactory.ts
Copy link
Member

@jmsn jmsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool beans

@stonko1994 stonko1994 merged commit bb19e56 into feature/modern-ui-base Jan 23, 2025
3 checks passed
@stonko1994 stonko1994 deleted the feature/dismiss-settings-panel branch January 23, 2025 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants