-
-
Notifications
You must be signed in to change notification settings - Fork 849
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
GUI: focus and tabbing #1971
base: master
Are you sure you want to change the base?
GUI: focus and tabbing #1971
Conversation
Hello @gzotti! Thank you for this enhancement. |
@gzotti if you like I can review other UIs via this branch |
I don't understand the "colorrole" note - I only use Qt Designer (5.12.8), it does not appear there. https://doc.qt.io/qt-5/qpalette.html#ColorRole-enum @gzotti sure there is no relation with this: stellarium/src/gui/StelGui.cpp Lines 402 to 408 in 0b0ece4
|
The “colorrole” for placeholder’s text was introduced in version 5.12 and, of course, for Qt 5.9 this is unknown instruction. |
Yes. If you rebase #1834 on current master and PR to this branch, we can start with that. But note that there is only so much time to invest in this topic. Nothing will ever be 100% perfect for all users, but some improvements are possible. The new GUI element variants provide focus highlights now for buttons and checkboxes , so they can be included when they make sense. (Not sure about pages like view/markings, would anybody really not use a mouse here?) |
How about doing this in small iterations, so this PR doesn't drag on for too long. I already rebased my branch, you might want to merge that to this PR. (update: still need to rebase to 0b0ece4) However, make sure to check #1834 (comment) before finalizing this PR; did you see it? Once this is closed, I can have a look at other places that could benefit from this change. |
This comment has been minimized.
This comment has been minimized.
0b0ece4
to
cd4a0dc
Compare
This comment has been minimized.
This comment has been minimized.
cd4a0dc
to
f0156a2
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
To which I replied:
As far as I understand your repository "axd1967" is not part of the Stellarium repo at github, therefore I cannot simply check out your branch. (Sure, I can clone your repo, but this is overkill to retrieve 9 lines for a copy&paste issue) I can manage a PR on github when done to the right branch, which is why I had asked you to re-address your PR to the feature branch gui-show-focus. |
aaa...
You are right, I forgot that. To be honest, I have a difficult time after all these rough treatments.
That's why I pushed my branch as a PR on top of your branch :-) |
No, you can only send pull requests. |
Note there is no need to clone; what you do is to add my repo as a remote to your repo ( |
LGTM! Note that the Help dialog is an example where ENTER could trigger the bottom buttons. Shall I open a separate issue to review tab/focus issues in some key dialogs? I will PR the required modifications. |
I have enabled SPACE as the key to trigger the button action. Would ENTER be the better one? Or do the buttons react to ENTER on Ubuntu? I think it is not good to have both SPACE and ENTER available. I suggest you add one GUI panel per PR. As often, Alexander and I may have diverging preferences about these changes, and I definitely cannot guarantee that we will accept all changes. (or even ... almost guarantee we will not... but we can hopefully work out something useful.) I like those changes only when I see the usability becomes better, more intuitive, and tabbing always switches to some element that indicates that it is in focus. (What about the tabs in TabViews? Is there keyboard interaction intended?) For now, there are SpacePushButtons and SpaceCheckBoxes which can replace QPushButtons and QCheckBoxes, respectively. If you need others, I should be able to add them as well. During the next weeks of this development, there should be no need to rebase this branch. I have seen one issue while re-assigning keys. Sometimes the keypress "slips through" and triggers the existing key action. Not sure what happens here. |
SPACE is a very common way to press a button or perform some task on the UI that has focus. ENTER is less common; it is often connected to a "master" button in a dialog, AND can act on the UI element that has the focus. Just look at how Qt does it: ENTER also allows to confirm+close the confirmation dialog (see also #1292 ) (as well as SPACE).
OK
Take a moment to ask yourself: if keyboard interaction obviously never was the highest priority, why would we now impose heavy requirements? There are some simple rules to follow, and tab order is a basic rule that has until now been ignored for whatever reason. please remember: this is all about tab order. that's it. I just want to fix the order, that's all; there is no need to go into deep discussions, all that needs to be done is to re-order the tabbing for the simple reason that developers added new buttons everywhere without paying attention to the tab order, which is worse than imposing wrong tab orders... Just open any decent desktop application and observe how tabbing is a standard and prominent feature I don't know many applications that fall short in tab ordering. The focus issue is indeed not trivial, I'm still surprised that we need to go for a custom UI class, I still cannot believe that Qt is so fussy on that issue. But at least there is a simple solution, so it shouldn't hurt too much if one day a developer comes up and says "guys, this was not the way to do it", or maybe Qt will provide a simple solution in some future release.
The tabs also require attention. (a typical keyboard action is CTRL-PgUp/Down). That can be addressed in a separate issue.
OK. Can we then merge and close this PR?
I think you are referring to #1294. |
I intended to develop things around tabbing a bit further in this branch. The point is that tabbing was a non-issue, it was not bad, it was basically NOT AVAILABLE for the last 20 years of this project. Nobody cared for it, and I don't remember a single user complaining before 2021. You want to introduce it, so it must be done well. There are a few weeks to go before this could go to master. |
OK. I will continue on this branch (via #1997 ), so please don't rebase it any more. |
Just one note: please remember that this is not a "critically important" feature; it has simply been neglected by developers and never contemplated by the vast majority of the users (my guess is that the UI is already unusual, therefore not inviting for this kind of change requests). Now is an opportunity to improve the keyboard UI because I am able to assist here to review that tabbing order (plus some other minor changes). |
This comment was marked as outdated.
This comment was marked as outdated.
* re-enable focus policy * review tab order due to re-enabled buttons * allow tab focus on essential widgets only, and in this order: - tree item - search bar - primary shortcut - alt shortcut - Apply TODO: use new button classes which react to space presses when in focus
ef8703a
to
0b0daf9
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Description
As discussed in #1834 the Qt-based interface allows using the tab key to switch between GUI elements. So far the GUI was not designed to be used that way, and the GUI did not indicate which button had the "focus" to receive the next keypress.
However, for a few users this seems a critically important feature to add. This branch should be used to add the focus highlight to GUI elements where it makes sense, and then to adapt the .ui files to define a "tabbing order".
Fixes # (issue)
Screenshots (if appropriate):
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: