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

NSTableView challenges #18

Closed
rdmeyers opened this Issue Jun 7, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@rdmeyers

rdmeyers commented Jun 7, 2018

Let me start by saying your ThemeKit is brilliant! You have made it so simple to implement, and yet so flexible. I am hoping that flexibility will accommodate the problem I am having with the NSTableView class (or some child within it). A picture is worth a 1000 words, so here we go:

image

Is there any way to keep the cells from being themed? The table itself is theming just fine as the dark theme will attest to. It seems that maybe the NSTextFields in the tableview are getting themed and I would like to see those ignored. I have tried the following in various forms and combinations to no avail, even attempting to skip theming the tableview completely:

[[TKThemeManager sharedManager] setTheme:TKThemeManager.lightTheme];
[TKThemeManager sharedManager].windowThemePolicy = TKThemeManagerWindowThemePolicyDoNotThemeSomeWindows;
[TKThemeManager sharedManager].notThemableWindowClasses = @[[NSTableView class]];

Any suggestions would be greatly appreciated.

By the way, the default dark theme looks even better on Mohave than High Sierra, etc. :-)

@nfgrilo

This comment has been minimized.

Collaborator

nfgrilo commented Jun 11, 2018

Thanks for the feedback!
This is a similar issue to this one. Basically, that relates to the allowVibrancy property of either NSTableView, its parent view or its child cell views (child views inherits vibrancy from its parents). So, I would recommend playing with it. If you have a sample project where you can reproduce the issue I can give a look and give it a try as well!

@rdmeyers

This comment has been minimized.

rdmeyers commented Jun 11, 2018

I have spent the morning trying to isolate the issue. I made a couple of small projects and could not replicate my problem in simple views and windows, so it seems that the issue manifests itself when the tableview is presented on a Sheet. Do you have any thoughts on that? I have no access to the vibrancy attribute that I can see.

@nfgrilo

This comment has been minimized.

Collaborator

nfgrilo commented Jun 12, 2018

@rdmeyers , I will make some experiments and will let you know!

@nfgrilo

This comment has been minimized.

Collaborator

nfgrilo commented Jun 12, 2018

Good news @rdmeyers ,

I have just been able to reproduce the issue! The theming issue only seems to affect view-based NSTableViews, when placed on sheets.

The way to fix this is to make sure any NSTableCellView subview has allowsVibrancy set to false. Please check the attached sample project where this is demonstrated. On the view-based table, you will see that the first column is fixed, as I replaced NSTextField by FixedTextField which only overrides allowsVibrancy to set it to false :)

This should help fix your issue!

Sample Project: Issue18.zip
PS: Don't forget to run pod install before opening the Issue17.xcworkspace file!

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