alexkay / spek

Acoustic spectrum analyser
http://spek.cc
GNU General Public License v3.0
2.5k stars 255 forks source link

Remembering last window size on re-launch #163

Open Fironet opened 6 years ago

Fironet commented 6 years ago

From what I can tell spek will always reset the window size to a default. An option to remember the window size across sessions would be useful, as inevitably I'll resize the window each re-launch to the desired width both for viewing and image export.

withmorten commented 6 years ago

It would probably easier to just make an option for a different default size:

https://github.com/alexkay/spek/blob/master/src/spek-window.cc#L55

You could pull these values from the Spek config.

I already added some extra options in my fork here:

https://github.com/withmorten/spek-alternative/commit/3641bd9219e4a18c62031eb2dfd6b5ce957a7335

I'm not 100% sure on how to do input fields, though, but would you be happy with a "hidden" option so to speak - i.e. it gets parsed by the config reader but there's no option in the menu.

Fironet commented 6 years ago

I already added some extra options in my fork here: withmorten/spek-alternative@3641bd9

I'm not 100% sure on how to do input fields, though, but would you be happy with a "hidden" option so to speak - i.e. it gets parsed by the config reader but there's no option in the menu.

Oh nice. For such a fork yeah that would be fine. I don't mind editing a config file.

withmorten commented 6 years ago

Allright, what OS are you on? If Windows or macOS I'll make a custom build for you.

Edit: Commit here: https://github.com/withmorten/spek-alternative/commit/153c6f2bc6a09572d63b0c087a281afc9366b8e8

Just add height=1280 and width=720 to your spek preferences file in the section "general" for example to start Spek with a window size of 1280x720 by default.

Fironet commented 6 years ago

Allright, what OS are you on?

Windows 8.1. Appreciated!

withmorten commented 6 years ago

Here you go then, msi and portable zip:

https://morten.with.de/spek-builds/spek-alternative-c953e07a6afcbf94be4993fe36e9b4e4b9a100a6.msi

https://morten.with.de/spek-builds/spek-alternative-c953e07a6afcbf94be4993fe36e9b4e4b9a100a6.zip

Let me know if there are any problems with the config options. I tested it and it should work.

Fironet commented 6 years ago

Here you go then, msi and portable zip

Thanks so much, works a treat. Btw I'm not sure I'd label the zip version portable as it saves the user preferences outside the program directory to C:\Users\<user>\AppData\Roaming\spek (unless I missed how to store the settings in the program's directory).

The other nice thing about the fork is its option of being able to hide the full path.

withmorten commented 6 years ago

Btw I'm not sure I'd label the zip version portable as it saves the user preferences outside the program directory to C:\Users\\AppData\Roaming\spek (unless I missed how to store the settings in the program's directory).

Oh yeah, never even thought of that. That's how the original spek "portable" handles it too, though. Should probably be changed in the future. At least you can use it without admin privileges.

The other nice thing about the fork is its option of being able to hide the full path.

Right? I was always annoyed that my full folder path would show up revealing my username or something else so I decided to add that real quick. Glad you like it!