Skip to content

Use custom delegate to unify combobox item style #642

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

Merged
merged 2 commits into from
Aug 3, 2024

Conversation

mizaki
Copy link
Contributor

@mizaki mizaki commented May 10, 2024

On Linux (tested) changes:
image
Which are oversized checkboxes to:
image

@mizaki
Copy link
Contributor Author

mizaki commented May 10, 2024

A combined delegate for read and modify could be worked out (signals etc.) but for ease right now.

@lordwelch
Copy link
Member

Now it's even worse on MacOS....
Screenshot 2024-06-21 at 7 14 52 PM

@mizaki
Copy link
Contributor Author

mizaki commented Jun 22, 2024

Now it's even worse on MacOS.... Screenshot 2024-06-21 at 7 14 52 PM

So it's an extra tick but is the tick also a bit larger too?

I was wondering if PyQt6 is going to make any difference to this at all but I don't think it will.

IIRC the problem was only on Linux (I'll check), so I think it's possible to do this change only for Linux.

@mizaki mizaki force-pushed the modify_cb_delegate branch from 0ca56b8 to 66cfceb Compare July 6, 2024 22:25
@mizaki
Copy link
Contributor Author

mizaki commented Jul 6, 2024

Try this. It looks like the "tick" was being drawn twice (didn't notice because it was perfectly aligned) so I've removed the draw from the code here.

@lordwelch
Copy link
Member

Now I don't get any visible check on MacOS and It crashed when I clicked on the 'Write Tags' checkbox too much

2024-07-27 14:14:05.686 Python[23532:673543] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
2024-07-27T14:14:23 | comictagger | CRITICAL | Uncaught exception: AttributeError: 'NoneType' object has no attribute 'checkState'
Traceback (most recent call last):
  File "/Users/timmy/build/source/comictagger/comictaggerlib/ui/customwidgets.py", line 144, in eventFilter
    self.toggleItem(index.row())
  File "/Users/timmy/build/source/comictagger/comictaggerlib/ui/customwidgets.py", line 205, in toggleItem
    if self.model().item(index).checkState() == Qt.Checked:
AttributeError: 'NoneType' object has no attribute 'checkState'

@mizaki
Copy link
Contributor Author

mizaki commented Jul 28, 2024

Try this. If not then skipping it on MacOS might be the option. I did wonder about the purpose of if platform != "darwin": and so left it in. I thought it might only draw the tick but the whole check box was missing?

Not too sure on the None as it shouldn't be related but let's see if it goes away once the box is drawn again.

@lordwelch
Copy link
Member

By default on MacOS it only has a tick. There is no checkbox

@mizaki
Copy link
Contributor Author

mizaki commented Jul 29, 2024

By default on MacOS it only has a tick. There is no checkbox

In the double tick screenshot you gave above; is the box there not usually there?

Does this just draw a box and the tick or just the box? Any harm in having the boxes?

If there's still a problem: Because I can't try different solution, if I put in some different options commented out so you can try them, is that okay?

@lordwelch
Copy link
Member

If there's still a problem: Because I can't try different solution, if I put in some different options commented out so you can try them, is that okay?

Sure

@lordwelch
Copy link
Member

It looks like you can reset to a44e037 and then you just need to remove the extra import platform

@mizaki mizaki force-pushed the modify_cb_delegate branch from 99e7ac0 to 8ace830 Compare July 31, 2024 21:13
@mizaki
Copy link
Contributor Author

mizaki commented Jul 31, 2024

It looks like you can reset to a44e037 and then you just need to remove the extra import platform

I've reset and removed the double import. Is that original one now working (with the PyQt5 5.15.11 update)?

If not, I'll push the other options.

@lordwelch
Copy link
Member

It works on MacOS now

@lordwelch lordwelch merged commit d089c4b into comictagger:develop Aug 3, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants