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

Enhance spacing in menu with/without icons/indicators - overlaps #214

Open
dpizetta opened this issue Jan 20, 2020 · 2 comments
Open

Enhance spacing in menu with/without icons/indicators - overlaps #214

dpizetta opened this issue Jan 20, 2020 · 2 comments

Comments

@dpizetta
Copy link
Collaborator

dpizetta commented Jan 20, 2020

Currently, on Windows 10 we have this behavior, that depends on the Qt version <=5.13, and >=5.14. This is a Qt problem that we have faced for a long time.

The main problem is that when there are only indicators on the menu (checkable actions) the space for the indicator is not reserved, and the text overlaps. However, if you have one icon attributed to any other action in the menu, space is reserved.

There is no way to check if there are indicators/icons to change the padding according to them.

If we add padding, all texts are shifted.

See the examples. More info about the versions is in the gifs. The order is: 5.[12,13,14,15].latest

win-qt512
win-qt513
win-qt514
win-qt515

WORKAROUND

Add a transparent icon to at least one action in the specific menu with the problem. I've tried to add a background/image background but it does not work. This should be a good way to keep the best spacing. I'll reopen a related problem in the Qt repository.

win-qt512-workaround

@dpizetta dpizetta added this to the 2.9 milestone Jan 20, 2020
@dpizetta dpizetta self-assigned this Jan 20, 2020
@dpizetta dpizetta removed this from the 2.9 milestone Mar 29, 2021
@dpizetta dpizetta changed the title Enhance spacing in menu with icons Enhance spacing in menu with/without icons/indicators Mar 30, 2021
@dpizetta dpizetta changed the title Enhance spacing in menu with/without icons/indicators Enhance spacing in menu with/without icons/indicators - overlaps Mar 30, 2021
@dpizetta
Copy link
Collaborator Author

@PhenomRetroShare
Copy link

Hello,
We have the same like behavior.
I fix it replacing item delegate with:

	QList<QComboBox*> widgetList = this->findChildren<QComboBox*>();
	for(auto& it : widgetList)
		it->setItemDelegate(new QStyledItemDelegate(it));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants