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

Allow plugins to handle Custom Draw in TreeView controls (bug #15077) #15078

Conversation

oviradoi
Copy link
Contributor

@oviradoi oviradoi commented May 3, 2024

This PR attempts to fix bug #15077 .

I have modified the code that handles the CustomDraw messages sent by TreeView controls to also call the base subclass and merge the result with the one from the dark mode code.

This will allow the plugins to also handle the custom draw messages and add customizations to the TreeView items.

I have tested this with the Explorer plugin and also several built-in panels (Folder as Workspace, Document List).

@donho donho self-assigned this May 13, 2024
@donho
Copy link
Member

donho commented May 13, 2024

The eventual problem of this PR is: it could make the other plugins, which don't want to deal with the dark mode, broken.

@ozone10
What do you think about this PR?

@ozone10
Copy link
Contributor

ozone10 commented May 13, 2024

@donho
We already do this for listview. IMHO I would align the code with the listview’s implementation for consistency. However, I still find the current PR acceptable.

I would also include similar handling for toolbar in another PR, if requested.

@oviradoi
Copy link
Contributor Author

I don't think it would break any plugin. If a plugin does not subclass a TreeView, the call to DefSubclassProc will not have any effect and the previous behavior will be kept. If a plugin does subclass TreeView, these changes will allow the plugin to add its own customizations.

@donho
Copy link
Member

donho commented May 14, 2024

@oviradoi
Could you show me what's wrong of my screenshot:
#15077 (comment)

@donho
Copy link
Member

donho commented May 14, 2024

@ozone10

We already do this for listview.

Could you point it out please?

@ozone10
Copy link
Contributor

ozone10 commented May 14, 2024

@donho
#11767

@donho
Copy link
Member

donho commented May 15, 2024

@ozone10
Thank you!

@donho donho added enhancement Proposed enhancements of existing features plugin accepted labels May 15, 2024
@donho donho closed this in 8055b56 May 15, 2024
donho pushed a commit that referenced this pull request May 17, 2024
Tweak dark mode custom draw for plugin:
- add plugin custom draw support for toolbar
- make code more consistent
- make plugin's authors custom draw implementation
to have higher priority than one from generic dark mode

ref #15078 (comment)

Close #15147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted enhancement Proposed enhancements of existing features plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants