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

Fullscreen Resolution Slider #2642

Merged
merged 8 commits into from
Sep 15, 2024
Merged

Conversation

douira
Copy link
Collaborator

@douira douira commented Aug 6, 2024

As a compromise, this adds a fullscreen resolution slider but truncates the label to fit into one line. The design can be refined later, but at least users won't have to go to the vanilla settings for this now.
Thanks to @MeeniMc for their previous work in #2296 on adding the option in the first place. I added the two-line functionality and changed the style.
related: #46
Closes #2692

MeeniMc and others added 5 commits January 31, 2024 00:09
The resolution controls would not fit in the allocated space, so I
changed the rendering of slidercontrols to enable rendering the slider
bar and the value text in the same area.

Signed-off-by: MeeniMc <[email protected]>
reduce the length of scrollbars so that it doesn't look as busy

Signed-off-by: MeeniMc <[email protected]>
…hat the box can be reduced to avoid overlapping with the undo button.

Signed-off-by: MeeniMc <[email protected]>
# Conflicts:
#	src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumOptionsGUI.java
#	src/main/java/net/caffeinemc/mods/sodium/client/gui/options/control/SliderControl.java
@MeeniMc
Copy link
Contributor

MeeniMc commented Aug 6, 2024

It's a good idea but it doesn't work with AUTO gui scale, there is no vertical scrolling and the extra line renders outside the screen now.

@douira
Copy link
Collaborator Author

douira commented Aug 6, 2024

That's a good point, do you know where one makes the control element notify the GUI system of it's correct size? Is there a place where it calculates the total size of the GUI for determining the scale?

@douira
Copy link
Collaborator Author

douira commented Aug 7, 2024

I've updated it to be only one line but truncate the width of the label dynamically based on the slider's value width.

@douira douira changed the title Add Two-Line Fullscreen Resolution Slider Fullscreen Resolution Slider Aug 7, 2024
@MeeniMc
Copy link
Contributor

MeeniMc commented Aug 7, 2024

LGTM

add two-line fullscreen resolution option

remove two-line option but make it the normal style

refactor label truncation and slider rendering to work together,
this means the label will now be truncated based on the slider's current actual content width.
other control elements can but don't have to implement accurate content width information.
@douira
Copy link
Collaborator Author

douira commented Aug 8, 2024

resolved conflicts and brought the branch up to speed with dev

@jellysquid3
Copy link
Member

This is fine as a temporary solution for now. But I wouldn't want to keep around multi-line controls once we rework the video setting screen.

@jellysquid3 jellysquid3 merged commit 5d72634 into CaffeineMC:dev Sep 15, 2024
1 check passed
@douira
Copy link
Collaborator Author

douira commented Sep 15, 2024

This PR doesn't add it as a multiline option (anymore), I replaced it with label truncation.

@douira
Copy link
Collaborator Author

douira commented Sep 15, 2024

My bad for not updating the description

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.

Add option to change game resolution
3 participants