dominikwilkowski / vault

An open source multi-platform password manager, written in Rust.
https://rustyvault.com/
GNU General Public License v3.0
12 stars 2 forks source link

Save window size #20

Closed thewizzy closed 7 months ago

thewizzy commented 7 months ago

Save the window size on exit.

Should we remove the logic to save the slider until window closed too?

thewizzy commented 7 months ago

Great idea, i made it fairly generic so we can use it in other places if we need. It doesn't fit with sidebar resize as it needs to know drag beginning and end anyway, so we can just save when we hit the end.

thewizzy commented 7 months ago

The latest commit changes it to using a call counter of type u64 which is guarded by arc/rwlock to allow it to be cloned and put into a bunch of closures without issues. I tried implementing with an Atomicu64 but there were issues particularly when trying to get the value access inside the closure exec_after. Can wrap it in an arc outside of this, maybe need to wrap it inside too.

thewizzy commented 7 months ago

The latest commit changes it to using a call counter of type u64 which is guarded by arc/rwlock to allow it to be cloned and put into a bunch of closures without issues. I tried implementing with an Atomicu64 but there were issues particularly when trying to get the value access inside the closure exec_after. Can wrap it in an arc outside of this, maybe need to wrap it inside too.

Writing this comment made me think of a way we might be able to do it. 1201d74 is an AtomicU64 version.