-
Notifications
You must be signed in to change notification settings - Fork 223
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
#3233 UI: Common method to delete server and custom directory entries #3260
#3233 UI: Common method to delete server and custom directory entries #3260
Conversation
Thanks for opening this PR. It's a draft/WIP so it needs discussion. @pljones Should be most familiar with this. |
Could you please also post your questions here? Best right in the code tab close to where the question arises. |
Hello, It works for the main part, I mostly followed this commit. However, I have some issues :
I have still things to improve such as the interface (boxes are not equally spaced), but I would like your opinion to continue this way ! Thanks for your time ! |
Thanks Adam! I started to look at your commit and questions earlier today, but got diverted onto other things. I will have a look soon, hopefully tomorrow! |
Looks good to me, now. I've kicked off the build. Thanks for all the time you've spent on this! :) |
Thank you for your patience and your advices :) |
Just tried the Windows version from the build artifacts and it looks okay to me. |
This needs some squashing and rebasing, I believe. I'll look into it once I have time. |
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've tried this on my Pi and my Mac. Both ok, so happy to approve.
There don't seem to be any merge conflicts, so a squash merge could be done without needing to rebase. Or else I'd be happy to rebase and squash manually first.
OK, I'll rebase it onto main, which now has the Mac legacy Qt update, let it build, and then check it on my Mac. |
edcd230
to
b4b71ee
Compare
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've just loaded the Mac legacy version built with Qt 5.15 and noticed a couple of issues which need to be addressed first. I'm happy to look at these.
- The button is too narrow for the delete character (it's ok on other platforms and was ok with Qt 5.9). This is the same as I reported in "Delete server" button doesn't show properly on macOS #3241
- If I type in a custom directory address and finish with "Enter", the field goes blank and the address isn't added. I need to use Tab, or to click outside the field, to make it lose focus. I did see some comments about pressing Enter, but thought they had been resolved. Evidently not, at least on some platforms.
Yep Qt on MacOS certainly seems to come with its own UI layout peculiarities that aren't present on other platforms. The action/focus trigger for updating the list has also been a bit hard to pin down: it works right sometimes on both Windows and Linux for me. It also works wrong sometimes, too... Or has done (it's a while since I ran Qt5 - it might be fixed in Linux/Windows Qt6). (I'm thinking of getting the Android to Qt6 work done - to see if it helps with the other Android issues we have open. I tried it over the weekend and it mostly looks like permissions stuff... but that doesn't look trivial to fix.) |
I fixed the issue with Enter. The problem was that pressing Enter within the combi box was causing a button push to delete, because the default setting for Will investigate the button appearance on Mac later. |
For the delete buttons, I needed to change the horizontal size policy from "Maximum" to "Fixed", so that the buttons were definitely wide enough, but not allowed to grow. Need to check they are ok on all platforms. |
I've tried the latest build above on Mac Legacy, Windows and Pi Linux. Not current Mac though. The button width is now fine on Mac Legacy, but it's a bit wider than ideal on Windows and Linux. Must be scaling differences. It may be acceptable, but if not, we would need to add code to adjust the width of those buttons at runtime for Mac only. Thoughts? |
Maybe set the size policy to maximum only for Mac if that's where it's needed? (Quite why Qt can't get their cross-platform UI toolkit to work for something you'd have though to be pretty obvious like that, I have no idea. Qt's meant to hide those kinds of differences...) |
It's the other way around. It was previously maximum only, but that allows the button to be shrunk as much as needed. But on Mac from 5.12 on, the button was shrinking right down. My guess is that it couldn't correctly calculate the size of the contained text when it was just a Unicode character for backspace, so took the text width as 0. I found I needed to specify Fixed so that both maximum and minimum were constrained. Either way, to fix it we would need to add conditional runtime code for Mac only, as there is no way to put architecture conditionals in a I have wondered whether it might be worth putting an image in the button instead of a Unicode character? e.g. a wastebasket or trashcan? |
A further thought: maybe merge this PR without the button width fix, since that applies to both the settings and connect dialogs? The connect dialog is arguably outside the scope of this PR. Then raise a separate PR to fix #3241 in both places for Mac? |
OK by me. So, dropping the third commit... |
In Advanced Settings, changes the method of deleting a custom directory to use a delete button, for consistency with the similar method in Connect.
84c6eb6
to
5ec1b26
Compare
Ok. So this also needs new screenshots for the docs potentially. |
Yes. But that should show up automatically |
jamulussoftware/jamuluswebsite#1002 raised for documentation. |
I added a horizontal box layout which include the box and the delete button. I wrote a fonction to implement the delete button.
It works well when we change the focus with the mouse to add a new directory but I can't make the enter key work : it delete the input and nothing happend. I tried to add the QLineEdit::returnPressed signal but it changed nothing. I struggle to understand the former use of the QComboBox::activated signal since I commented it and nothing seems to have changed.
TODO :
Allowing to add directory via enter key.
Improve spacers in the ui.
Short description of changes
CHANGELOG: Client: Add "Delete Entry" button to Advanced Settings, Custom Directories
Context: Fixes an issue?
#3233
Does this change need documentation? What needs to be documented and how?
Status of this Pull Request
What is missing until this pull request can be merged?
Checklist