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

Add Desktop directory to file dialogs #4632

Merged
merged 3 commits into from May 6, 2024
Merged

Conversation

codesoap
Copy link
Contributor

I believe that the "Desktop" directory is heavily used by many users. Thus I think it would be convenient, if it appeared in the favorites of file dialogs.

The changes are basically pure Cargo cult, but seem sensible to me and seem to work. Please correct me, if I've forgotten something.

I have not assigned an icon to this entry in the file dialogs, since the most common symbol seems to be a monitor and I couldn't find such a symbol in the theme package.

@coveralls
Copy link

Coverage Status

coverage: 64.518% (-0.009%) from 64.527%
when pulling 55cd42c on codesoap:desktop
into 4d32cfc on fyne-io:develop.

@andydotxyz
Copy link
Member

Thanks for this, but can you add it for Windows and macOS as well? We keep feature parity between all the systems (and file dialog is only shown on desktop)

@codesoap
Copy link
Contributor Author

I'm afraid I don't see what is missing. I had grepped for the term "Videos" as a guidance for my change and found no other relevant places like this.

The getFavoriteLocations() functions in dialog/file_darwin.go and dialog/file_windows.go both seem to use the favorites from the getFavoriteOrder() function, which I adapted.

I had tried my change on Linux and on Windows and the "Desktop" favorite was available on both.

@andydotxyz
Copy link
Member

I see that the locations are looked up, good point.
But I think the getFavouriteIcons is missing an understanding of Desktop - so this new item does not match the others.

@codesoap
Copy link
Contributor Author

You're right, I didn't assign an icon. The most common symbol for the desktop seems to be a monitor and I couldn't find that in the theme package. What is the preferred way; should I try to find a different icon, that already exists in the theme package, or should a new icon be added?

@andydotxyz
Copy link
Member

should I try to find a different icon, that already exists in the theme package, or should a new icon be added?

If you find one that works use it, if not you can add a new one :).
There is a good repository of material icons that will fit right in (see how we embed the current ones to add a new).

@codesoap
Copy link
Contributor Author

I couldn't find a suitable icon, so I added one (well, actually two). After some research it seemed to me, that (at least some of) the existing symbols where taken from Polymer (source I found during research). Since Polymer allows use under BSD style licenses and fyne uses a BSD style license, I saw no problem in copying the icons.

Polymer had actually defined two separate icons for the desktop: desktop-mac and desktop-windows. I kept this decision and added the two icons to fyne.

go run ./theme/gen.go did generate a change for fynelogo, but I didn't commit it here, since it has nothing to do with this issue.

I have speculated, that this change will be released with fyne 2.5 and added according "Since" comments to IconNameDesktopMac and IconNameDesktopWindows.

@andydotxyz
Copy link
Member

Nice improvement thanks. But is having two different icons for desktops needed? I'm in 2 minds and curious about @Jacalz, @dweymouth or @Bluebugs thoughts

@Jacalz
Copy link
Member

Jacalz commented Feb 14, 2024

I think the can just have the Windows one and call it just "Desktop". The difference is not significant enough to warrant two icons in my opinion

@codesoap
Copy link
Contributor Author

No complaints from me. I have unified the icons.

@andydotxyz
Copy link
Member

Please don't force push a PR that is going through reviews - in general we prefer to keep history.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

All of the tests are failing. Would you mind having a look at that?
I also think you need to update the test package lookup functions for the renderer markup output.

@codesoap
Copy link
Contributor Author

I took a closer look and found that 3 fails are due to timeouts and one is unhappy about the use of theme.DarkTheme. I feel like these are not problems I created with this PR.

Am I missing something? I'm afraid I'm not very experienced with interpreting the errors...

@codesoap codesoap requested a review from Jacalz February 19, 2024 16:28
@Jacalz
Copy link
Member

Jacalz commented Feb 19, 2024

Please don't request a re-review without committing changes. I still have outstanding comments requests from my latest review and I haven't had time to answer your comment yet.

About the tests, yes there are unfortunately a few spurious failing tests on develop. However, all tests should not be failing as they are here. I haven't had time to look into it any further.

As noted in my previous review, there is also the case about needing to update the test package to know about the new icon.

@Jacalz
Copy link
Member

Jacalz commented Feb 19, 2024

The test failures may not be your fault but I haven't seen them all fail like this. It is strange. Will try to look at it when I can.

@andydotxyz
Copy link
Member

It looks like a deadlock in theme lookup code - my guess would be that the test themes are not bringing along the required features that have been added.
This should happen locally if you just run "go test ./...".

@codesoap
Copy link
Contributor Author

codesoap commented Apr 28, 2024

I'm afraid I cannot reproduce the problem locally. I only get a test failure in the TestWindow_CaptureTypedShortcut test case, but that one also fails on master for me. The tests in fyne.io/fyne/v2/dialog and fyne.io/fyne/v2/theme do not fail on my system.

@andydotxyz
Copy link
Member

I cannot replicate but also cannot seem to kick the CI to try again (not sure why but these workflows seem frozen?).
Is it possible to try at your end, or push an empty commit that will trigger it @codesoap ?

@Jacalz
Copy link
Member

Jacalz commented Apr 29, 2024

Rebase on latest develop might fix things maybe?

@codesoap
Copy link
Contributor Author

I have performed the suggested rebase and the tests don't fail anymore. Thanks!

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Thanks. Looks better now. You just need to teach the test package about this new icon. See

func knownResource(rsc fyne.Resource) string {
.

@codesoap
Copy link
Contributor Author

codesoap commented May 2, 2024

I have added the requested entry in the test package, although I must admit that I don't understand what for.

@andydotxyz
Copy link
Member

although I must admit that I don't understand what for.

The test package runs the apps when in unit test mode. Without it code that used that icon would not function correctly.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Sorry for the late review. Thanks for the contribution.

@Jacalz Jacalz merged commit 7336b07 into fyne-io:develop May 6, 2024
12 checks passed
@codesoap
Copy link
Contributor Author

codesoap commented May 6, 2024

Thanks for your thorough reviews!

@codesoap codesoap deleted the desktop branch May 6, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants