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

No checked hint of checkable actions inside menu entries #338

Open
mgrojo opened this issue Nov 11, 2023 · 7 comments
Open

No checked hint of checkable actions inside menu entries #338

mgrojo opened this issue Nov 11, 2023 · 7 comments

Comments

@mgrojo
Copy link
Contributor

mgrojo commented Nov 11, 2023

Describe Your Environment

[Versions from your environment]

  • QDarkStyle: v3.2.1
  • OS: Ubuntu 22.04.3 LTS
  • Python: N/A

Language

C++

Description / Steps to Reproduce [if necessary]

Place a checkable action in a menu. Check and uncheck the entry.

Actual Result

There is no display hint about whether the menu entry is checked or not.

image

Expected Results / Proposed Result

Clear indication of the checked entries, like in the default style:

image

Relevant Code [if necessary]

Related UI definition in DB Browser for SQLite:
https://github.com/sqlitebrowser/sqlitebrowser/blob/e77ae65c11a44c00489596120aff990e4df0a9d4/src/MainWindow.ui#L823

     <string>&amp;View</string>
    </property>
    <addaction name="viewDBToolbarAction"/>
    <addaction name="viewExtraDBToolbarAction"/>
    <addaction name="viewProjectToolbarAction"/>
    <addaction name="separator"/>
   </widget>
  <action name="viewDBToolbarAction">
   <property name="checkable">
    <bool>true</bool>
   </property>
   <property name="icon">
    <iconset resource="icons/icons.qrc">
     <normaloff>:/icons/toolbar</normaloff>:/icons/toolbar</iconset>
   </property>
@dpizetta
Copy link
Collaborator

Hey @mgrojo thanks for reporting. QMenus and QComboBox are very complicated to deal with and correlated. This case is a special one where there is an icon + checkable action. You can also notice a space between the icon and name, which it was supposed to have a checkbox, or another indicator without this space as you mentioned. This is related to #308 and many other closed ones like #214. @ccordoba12 do you think @conradolandia can help us with this, since its more related to CSS?

@ccordoba12
Copy link
Collaborator

@ccordoba12 do you think @conradolandia can help us with this, since its more related to CSS?

Yep, I think so. Is the idea to add a new css rule to the checked state of actions in QMenus?

@conradolandia
Copy link
Contributor

I think something like this could work:

image

@conradolandia
Copy link
Contributor

I would like to know if its possible to alter the icon in any way or if it's possible to add another icon... if so, I was also thinking about a checkmark icon added to the checked menu items. Something like this:

image

@ccordoba12
Copy link
Collaborator

I think something like this could work

Yep, I think so too.

I would like to know if its possible to alter the icon in any way or if it's possible to add another icon

Probably not with css alone, but I really don't know.

@conradolandia
Copy link
Contributor

Probably not with css alone, but I really don't know.

Maybe using pseudo-classes like .myclass:checked::after {...}?

@dpizetta
Copy link
Collaborator

In the first example, maybe we can remove the extra space (where the check status go). It should be tested with checkable combo boxes too. Thanks for your attention on this.

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

No branches or pull requests

4 participants