Splode / pomotroid

:tomato: Simple and visually-pleasing Pomodoro timer
https://splode.github.io/pomotroid/
MIT License
4.36k stars 369 forks source link

Make window resizable #238

Open Mortasen opened 2 years ago

Mortasen commented 2 years ago

This update allows users to resize the window with keeping the aspect ratio. Since all absolute units (px) were replaced with relative ones (vw), the window looks good and the layout is preserved regardless of the size. It resolves issues #149, #79, and partially #22.

Mortasen commented 2 years ago

Let me know if anything should be improved before merging, I would be glad to help! And sorry if something's wrong, because it's practically my first PR

Splode commented 2 years ago

@Namerif This is a brilliant idea. Thank you for the PR!

When building this locally, I don't think I'm seeing expected behavior (see attachments).

The first screenshot shows the app when launching. It's tiny (cursor for reference). The second screenshot is after resizing manually. Looks like the window has lost its aspect ratio.

NVIDIA_Share_qmMierauSH NVIDIA_Share_r0t6Obe8M5

Mortasen commented 2 years ago

@Splode glad you like the idea, thanks! And yes, it's definitely not the expected behavior. Which OS do you use? If Windows, it's probably because of the Electron bug that setAspectRatio method I used was not working. It was fixed in 11.2.0 though.

Therefore, I see three possible solutions:

  1. Update Electron to that version (likely the most seamless resizing option)
  2. Use this module
  3. Write a resize event handler that will keep the aspect ratio

So please let me know which solution for you is preferred, and if it's the third, I'll update the PR. Otherwise, I will need your help because unfortunately, I have very little experience developing Electron apps and I doubt I will be able to change the dependencies correctly.

mohamedashic commented 2 years ago

@Splode Kindly do the needful for this PR and concerned Issues as i wish to use it in the fancy zone in windows

ans-sigalas commented 1 year ago

I am not familiar with coding. I have downloaded pomotroid from the website but how can I actually incorporate your code to make it resizable?

Mortasen commented 1 year ago

@ans-sigalas I don't think you would be able to do that without any basic software development knowledge unfortunately.

AmishAlvi commented 8 months ago

I don't have a lot of experience with electron specifically, but I'm going to give this a shot at trying to implement the different options you listed, hopefully there's still interest in this being a complete feature.