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

[Question] Classic launcher dimensions #114

Closed
ajthemacboy opened this issue Dec 20, 2015 · 12 comments
Closed

[Question] Classic launcher dimensions #114

ajthemacboy opened this issue Dec 20, 2015 · 12 comments

Comments

@ajthemacboy
Copy link

Hi, I wanted to ask you a question without creating a Github issue, but my E-mail to you failed to go through.

I liked how the original Launcher was very thin in width and long vertically.

I've attempted to edit various pixel values LauncherFrame.java to try to get it back like this, and I've had no luck. I'm not a Java dev so I don't entirely know what I'm doing, either. What values can I change to make it similar?

Sorry for making an issue to ask this.

@sk89q
Copy link
Member

sk89q commented Dec 20, 2015

Do you still want the news on the right? The old launcher didn't use a huge list box for the instances.

@ajthemacboy
Copy link
Author

I don't know, it depends on how intrusive and big the news would make it. Maybe if the news appeared below the list it wouldn't be bad.

@sk89q
Copy link
Member

sk89q commented Dec 20, 2015

Make a mock and post it?

@ajthemacboy
Copy link
Author

I think this would be nice: http://i.imgur.com/fz91ix1.png

Not sure if it's what you were asking for, it has some things kindof different from default (like the modpack dropdown list to save space, and a dropdown list for accounts) that might require some time to add.

@ajthemacboy
Copy link
Author

Any word on this?

@sk89q
Copy link
Member

sk89q commented Jan 12, 2016

The non-trivial part is turning the list of instances to a dropdown box.

@MJRamon
Copy link

MJRamon commented Jan 14, 2016

Okey, I have another question: how can I change default launcher window size in source code? I want it to be 1280x720.

@ajthemacboy
Copy link
Author

@sk89q It appears you can only change the launcher height, modifying the width doesn't work for me.

@sk89q
Copy link
Member

sk89q commented Jan 25, 2016

@ajthemacboy OK I forgot there's a pack() down there. setMinimumSize() is the wrong way to do it really.

The best way is to change this line: https://github.com/SKCraft/Launcher/blob/master/launcher/src/main/java/com/skcraft/launcher/dialog/LauncherFrame.java#L112

It changes the default size of the main split pane, which pack() will take into consideration when choosing a default window size.

Cheatsheet for the parameters on that linked line: http://www.miglayout.com/cheatsheet.html

Notably:

BoundSize A bound size is a size that optionally has a lower and/or upper bound and consists of one to three Unit Values. Practically it is a minimum/preferred/maximum size combination but none of the sizes are actually mandatory. If a size is missing (e.g. the preferred) it is null and will be replaced by the most appropriate value. For components this value is the corresponding size (E.g. Component.getPreferredSize() on Swing) and for columns/rows it is the size of the components in the row (see min/pref/max in UnitValue above).

The format is "min:preferred:max", however there are shorter versions since for instance it is seldom needed to specify the maximum size.

A single value (E.g. "10") sets only the preferred size and is exactly the same as "null:10:null" and ":10:" and "n:10:n".
Two values (E.g. "10:20") means minimum and preferred size and is exactly the same as "10:20:null" and "10:20:" and "10:20:n"

@MJRamon
Copy link

MJRamon commented Jan 26, 2016

@sk89q it did work with usual build, but fancy version didn't pick up the size. If I do "w 1280:1280, h 720:720" instead of "w null:1280, h null:720" (minimum and preffered) things go really messy.

@sk89q
Copy link
Member

sk89q commented Jan 26, 2016

The fancy launcher overrides the size:
https://github.com/SKCraft/Launcher/blob/master/launcher-fancy%2Fsrc%2Fmain%2Fjava%2Fcom%2Fskcraft%2Flauncher%2FFancyLauncherFrame.java#L26

Either remove that line or use it instead.

@sk89q sk89q closed this as completed Jul 15, 2018
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

No branches or pull requests

3 participants