Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added widget with just a sync icon #1340

Open
wants to merge 6 commits into
base: main-ose
Choose a base branch
from
Open

Conversation

ArnyminerZ
Copy link
Member

@ArnyminerZ ArnyminerZ commented Mar 10, 2025

Purpose

Some people is requesting a simple square widget to run synchronization for DAVx⁵ manually, this adds a new widget to extend the existing one.

Short description

Added a new widget with just an icon, that runs synchronization when clicked:

Screenshot

Screenshot_20250310_194301

This doesn't exclude the already existing one with a label, but gives a new simpler option to the users.

TODO:

  • For some reason both widgets have the same label, it would be cool to be able to differentiate them.

    Fixed

    Screenshot_20250310_195350

  • It would be cool to show a proper preview to know how the widget will look like.

    Fixed

    Screenshot_20250310_200515

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

Signed-off-by: Arnau Mora <[email protected]>
Signed-off-by: Arnau Mora <[email protected]>
@ArnyminerZ ArnyminerZ added the enhancement New feature or request label Mar 10, 2025
@ArnyminerZ ArnyminerZ self-assigned this Mar 10, 2025
@ArnyminerZ ArnyminerZ linked an issue Mar 10, 2025 that may be closed by this pull request
@ArnyminerZ
Copy link
Member Author

Not really a thing that needs to be done quickly, but at least it's something, and since those files are pretty much never modified, we can just leave this ready until we want to merge it.

@ArnyminerZ ArnyminerZ marked this pull request as ready for review March 10, 2025 19:06
@ArnyminerZ ArnyminerZ requested a review from sunkup March 26, 2025 17:47
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, but wow that is a lot of new code. I can't help but think it would be less if we had only one widget.

Is it hard to make it one widget only, which resizes and then simply hides and shows the text depending on the widget size? Without the text they are exactly the same, no?

Also, does it need to be a circle? When adding the widget I can see the widget as a square, with/without rounded borders (depending on the widget settings) for a very short time before it goes back to circle again. I could think of users who want it to behave like the other widgets do. That is to have a full background color for the widget which is cropped by the widget setting and not enforce the rounded corners (circle shape) ourselves.

I took the screenshot at the right moment, but it turns back into a circle right after:

Show screenshot

image

@ArnyminerZ
Copy link
Member Author

Is it hard to make it one widget only, which resizes and then simply hides and shows the text depending on the widget size?

No, it should be easy, but I think @devvv4ever told me to have two different widgets, in case anyone wants a small widget with text

@ArnyminerZ
Copy link
Member Author

Also, does it need to be a circle?

Not technically, but I guess we can choose

@sunkup
Copy link
Member

sunkup commented Apr 7, 2025

No, it should be easy, but I think @devvv4ever told me to have two different widgets, in case anyone wants a small widget with text

You can add the same widget twice and resize one of the instances to be smaller. They will look differently, but have the same action. So in the end it'll have the same effect as creating two different ones. I think a second widget only makes sense if we want to add other functionality or show data, etc.

@devvv4ever
Copy link
Member

If you can manage to make the widget "responsive" in the sense of adapting text to to the user set size of the widget one widget would be good too. Speaking of: if the user sets it to 1x1 only display a sync button, and if it is large enough display an additional label. But it is of course more work to make the "one" widget more sophisticated ;-)

for example:
1x1 - only sync button
1x2 sync button with text "sync"
1x3...x with text "Synchronize".

I also think that users like to see these widget options as seen in your previews in the first posting here (which I definitely like!) - so they "see what they get" when choosing between the two options. But you decide :)

@sunkup
Copy link
Member

sunkup commented Apr 7, 2025

I also think that users like to see these widget options as seen in your previews in the first posting here (which I definitely like!) - so they "see what they get" when choosing between the two options. But you decide :)

I don't think we should do it, if it means maintaining three different widget code bases. If we're able to reuse the same code it could be an option.

@devvv4ever
Copy link
Member

I also think that users like to see these widget options as seen in your previews in the first posting here (which I definitely like!) - so they "see what they get" when choosing between the two options. But you decide :)

I don't think we should do it, if it means maintining three different widget code bases. If we're able to reuse the same code it could be an option.

It would not mean 3 widgets. Only two: one 1x1 fixed sync button widget without text and a second "resizeable" one with a label on it with min-size 1x2 and that can be enlargend as the user wishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Widget] Add a 1x1 square sized widget
3 participants