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

Allow application to set default view (list/grid) of file dialog before showing it #4595

Closed
2 tasks done
maruu opened this issue Feb 1, 2024 · 5 comments
Closed
2 tasks done
Labels
FileDialog Improvements to the builtin file dialogs

Comments

@maruu
Copy link
Contributor

maruu commented Feb 1, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

I think the issue has already been described here: #2165
I essentially have the same pains, but instead of having to click on the list-view toggle button all of the time, I would like to show the dialogs with that view by default.

Is it possible to construct a solution with the existing API?

It might be able to get a reference to the button, as is done in the tests, but I would prefer a more clear API.
https://github.com/fyne-io/fyne/pull/2251/files#diff-3144205fac6ab76f332735320fee204ddb6963bcc76a40684806537d5a999534R441

Describe the solution you'd like to see.

When creating a dialog, like dialog.NewFileOpen() I would propose to have a method on the returned object like SetDefaultView() which lets me select whether to use the Grid or List view. I would expect that this is set before the Show() method is called.

With some help from you (i.e. drafting the solution together), I would be happy to help implement it.

@andydotxyz
Copy link
Member

It doesn't need to be SetDefaultView, just SetView would work.
However the latest version remembers your preference, is that not sufficient?

@andydotxyz andydotxyz changed the title Allow application to set default view (list/grid) of dialog before showing it Allow application to set default view (list/grid) of file dialog before showing it Feb 1, 2024
@andydotxyz andydotxyz added the FileDialog Improvements to the builtin file dialogs label Feb 1, 2024
@maruu
Copy link
Contributor Author

maruu commented Feb 1, 2024

I would prefer if I could already provide the appropriate view for my usecase from the beginning, as the current default view (grid) currently is a problem for my users. Telling them how they can change it would require an additional documentation step, which is why I would prefer that the dialog is opened with the list view already from the beginning.

If you agree that this could be a useful feature I can look into the implementation, if its fine for you.

@andydotxyz
Copy link
Member

I'm curious to understand why the grid view is a problem, but it seems like you have a real use-case there.

@maruu
Copy link
Contributor Author

maruu commented Feb 1, 2024

The filenames my users are using are quite long (30+ characters).
In my experience, the grid view only allows to show a short substring of the filename. If I understand it correctly, this was also the initial reason to implement the list view (as described here: #2165)
As the filenames all start with the same characters, and are only distinguished by the last few characters, using the grid view it is difficult to distinguish between the different files. My users reported that with the list view it is easier for them, which is why I would like to set this as the default.

maruu added a commit to maruu/fyne that referenced this issue Feb 1, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 1, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 1, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 1, 2024
…rence view & default view

Switching GridView & ListView has the benefit that users who are already
have their preferences set to ListView will be shown the ListView
(index = 1), for users who used the old GridView (index = 0), now the
defaultView is used, which translates to GridView.
maruu added a commit to maruu/fyne that referenced this issue Feb 1, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 2, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 14, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 14, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 14, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 14, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 14, 2024
…rence view & default view

Switching GridView & ListView has the benefit that users who are already
have their preferences set to ListView will be shown the ListView
(index = 1), for users who used the old GridView (index = 0), now the
defaultView is used, which translates to GridView.
maruu added a commit to maruu/fyne that referenced this issue Feb 14, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 14, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 14, 2024
maruu added a commit to maruu/fyne that referenced this issue Feb 14, 2024
maruu added a commit to maruu/fyne that referenced this issue Mar 4, 2024
maruu added a commit to maruu/fyne that referenced this issue Mar 4, 2024
maruu added a commit to maruu/fyne that referenced this issue Mar 19, 2024
maruu added a commit to maruu/fyne that referenced this issue Mar 25, 2024
andydotxyz pushed a commit that referenced this issue Mar 26, 2024
Allowing apps to specify their preferred file dialog layout
@andydotxyz
Copy link
Member

Thanks for your work @maruu this is now on develop branch ready for v2.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FileDialog Improvements to the builtin file dialogs
Projects
None yet
Development

No branches or pull requests

2 participants