david-swift / Memorize

Study flashcards in a native GNOME app
https://flathub.org/apps/io.github.david_swift.Flashcards
GNU General Public License v3.0
95 stars 9 forks source link

Remember window size #9

Closed rene-coty closed 9 months ago

rene-coty commented 9 months ago

Describe the bug

Each time the app is reopened it will default to a fixed size, which is not always convenient

To Reproduce

  1. Adjust the window to a custom size
  2. Quit
  3. Re-open

Expected behavior

I would expect the app to remember its last size. Otherwise it can be frustrating when you have long Sets names which will end up being cut-off everytime you restart the app (see screenshot below)

Additional context

Capture d’écran du 2024-02-25 19-51-44

rene-coty commented 9 months ago

Btw I hope you don't mind me pointing out all these little papercuts 😇, I really appreciate your work!

david-swift commented 9 months ago

Thank you so much for testing the app and reporting problems, that's very helpful for me! I'll look into fixing them tomorrow.

david-swift commented 9 months ago

I fixed this with the commit 5fdb026.

rene-coty commented 9 months ago

Still doesn't seem to work on version 0.1.3 :/…

david-swift commented 9 months ago

Strange, it works for me.

Screencast from 2024-03-09 17-30-09.webm

How did you install the app? Via Flathub, did you build the Flatpak yourself, or are you using swift run? It should work in all cases, but (I think) the XDG data directory differs.

Can you maybe take a look at what happens with the file ~/.var/app/io.github.david_swift.Flashcards/data/io.github.david_swift.Flashcards/width.json (see video)? Are there problems writing the data to the file, or does the "default default size" override the default size in the file when starting the app?

If there's a problem storing the data: Do you also have problems with the flashcard sets, are they loaded incorrectly after restarting the app?

rene-coty commented 8 months ago

Ah I see: custom resizing is OK, but the 'maximized' state of the window isn't retained When I resize the window myself, the new dimensions will immediatly appear in width.json and height.json. Maximizing the window using the top right button will not affect them though…

david-swift commented 8 months ago

Yes, this is a separate thing. I'll add it as well.

david-swift commented 8 months ago

It now remembers whether it is maximized as well (73ed48b).