Slowpoke101 / FTBLaunch

Launcher for the FTB Mod Pack
182 stars 140 forks source link

Resizable Launcher #868

Closed FyberOptic closed 7 years ago

FyberOptic commented 10 years ago

I thought I'd toss this up here, that way it can be debated/discussed in case you guys want me to go forward with a PR.

https://github.com/FyberOptic/FTBLaunch/tree/resizable

You'll notice that I put all of the generic code to handle the resizable split pane into ObjectInfoSplitPane, and then moved much of the modpack GUI code into AbstractModPackPane. Texture packs and maps also use ObjectInfoSplitPane. Some things, like the Options pane, basically just got a wrapper put around it for now. The news pane conveniently just worked.

Just so you know, I didn't change the order of some of the button initializations and things to be nitpicky or anything, it's just that the order that you add components matters when using the various layout managers.

And for the record, if you click to download a server for a modpack and you get an error, that's because net.ftb.util.DownloadUtils has a bug in fileExistsURL where it's returning the opposite result of what it should. I didn't fix it in my code here since that should be in a separate PR.

jikuja commented 10 years ago

Nice work, really nice work. I found two things to fix or tweak: 1) You can safely remove old code instead of commenting. It will make diff smaller and easier to read. 2) When I started launcher tabs were in two rows: minimum or preferred width of LaunchFrame should be larger or defined by width of the one-row tab area.

FyberOptic commented 10 years ago

Thanks, glad you like it. I pulled out all the commented stuff (I'd been using some for reference), and noticed that you're right, it was indeed sizing wrong for me now as well. I'd been running in the Windows classic interface recently, as a matter o' fact. So I added in some code to compare window size and take decoration into account. Hopefully that will be more universal. I also made it center the window.

Oh also, I made the window size be the minimum size rather than just a default size.

progwml6 commented 10 years ago

feel free to PR this