-
Notifications
You must be signed in to change notification settings - Fork 35
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
feat: add YaruSearchField and YaruSearchTitleField #734
Conversation
Did it somehow stretch the title bar or does it just look extra tall because of the macOS window controls? |
I really like it! |
💪 Sounds like a good idea Looks good but TBH I'm not a fan of the two background colors. Could you explain again why you want the icon to have a different background color? Is it clickable? I'm sorry this was mentioned elsewhere |
yes its an icon button. when you click it the searchbar is layed under it (stack) |
Makes sense. I couldn't tell from the screenshot 😅 |
need to improve docs and more parameters and make te search button available without the title so you can either have all-in-one widget YaruSearchFieldTitle also I want to finish the yaru size PR first then I can remove the constants here |
Bildschirmaufzeichnung.vom.2023-07-24.17-38-14.webmok I think this is pretty good if there is an onClear callback provided the suffix icon shows up with a clear button the search field and button can be used either combiend in the title or separated |
yeah the example is stupid here because you would prbly not change the title in the text field 😸 |
@jpnurmi thanks for the review will check later and fix example is now a bit clearer and I added an alignment parameter for the title widget |
Thanks @jpnurmi there were indeed some heavy issues 🙈 |
A couple of remarks, feel free to ignore them if they are not relevant.
|
Well, I could just add a border radius parameter and you guys choose what you like. I'll change the name! 😎👌 |
@jpnurmi renamed as requested plus added a radius parameter |
The search icon button is 35x35px whereas the clear icon button is 40x35px: The clear button can be clicked even if the search field is empty. It's not immediately obvious that you need to click the search button again to close the search field. Perhaps the clear button could close the field if it's already empty? Screencast.from.2023-07-26.08-18-49.webm |
I would leave the logic when to enable the clear button via the callback to the user of the widget I'll fix the clear button width |
@jpnurmi nurmi fixed width of the clear button plus added a YaruSearchFieldStyle if you combined this the radius property you receive your desired heavy look anything else? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think the clear button should close an empty search field or at least become disabled if it doesn't have any effect. Also, the search field is left open forever even when it's empty and loses focus. It's not immediately obvious how to get rid of the field and return back to the normal title. Especially since the clear button is confusingly enabled yet does nothing... :) Should either YaruSearch(Title)Field or the example handle these cases?
Co-authored-by: J-P Nurmi <jp.nurmi@canonical.com>
Co-authored-by: J-P Nurmi <jp.nurmi@canonical.com>
Co-authored-by: J-P Nurmi <jp.nurmi@canonical.com>
Co-authored-by: J-P Nurmi <jp.nurmi@canonical.com>
@jpnurmi can I merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I thought it is time to find a sane default for searchfields and searchfields inside titlebars since this seems to become a common pattern in our apps.
This does not need to be the final result and should eventually be parameterized more but this could be a good start.
And in general with flutter, aynthing is changeable.
Opinions @madsrh @Jupi007 @jpnurmi @elioqoshi ?