-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Disable comboboxes with no and one item #61864
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
base: master
Are you sure you want to change the base?
Disable comboboxes with no and one item #61864
Conversation
🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. 🪟 Windows buildsDownload Windows builds of this PR for testing. 🍎 MacOS Qt6 buildsDownload MacOS Qt6 builds of this PR for testing. |
e86c67b
to
885734d
Compare
@MoritzMoreira i get the rationale here, but I don't like how the widget greys out the field value text when it's disabled. Are you able to overwrite the widget's palette too so that the text still appears in the normal font color? |
2eaa227
to
224da1e
Compare
@nyalldawson I agree, it's better with black test, just added that. Now I will continue to include all widget types with drop boxes, like enumeration in the test, or would it be sufficient to only test value map and value relation? |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
224da1e
to
7818508
Compare
7818508
to
b433e43
Compare
disable the comboboxes of the attribute form editor widgets when they contain no or only one item. Set the tooltip to inform the user.
b433e43
to
b7de30a
Compare
Disable the combobox of all the widget types that can have one, when they contain no or only one item. They appear in the attribute form upon generating new features and in the attribute table. The comboboxes tooltip is set accordingly to inform the user about why there is no option.
As of now, clicking on a combobox with only one item will open it's item list with that one item, changing the whole format in an awkward way and changing the background color to blue. Clicking on an empty combobox does nothing, but hovering over it canges the background color.
The proposed change is mainly for a better graphical user experience, giving immediate information for why there are no other options.
undesired behaviour in case of one item:

Note: The constraint result label (green checkmark) does not behave correctly in many cases, but that is a separate issue)
desired behaviour for hovering over a checkbox with no item:

and one item:
