lwouis / alt-tab-macos

Windows alt-tab on macOS
https://alt-tab-macos.netlify.app
GNU General Public License v3.0
10.2k stars 316 forks source link

fix: fixed the issue where the traffic light button on the white thumbnail is difficult to see in dark mode. #3433

Closed Allsochen closed 1 week ago

Allsochen commented 1 month ago

Fixed the issue where the traffic light button on the white thumbnail is difficult to see in dark mode.

Fixed the issues https://github.com/lwouis/alt-tab-macos/issues/2892

In dark mode, there are two situations where it is difficult to distinguish:

image image

After fixed:

decodism commented 1 month ago

It seems it could be done more directly by forcing the appearance of TrafficLightButton to aqua.

Allsochen commented 1 month ago

It seems it could be done more directly by forcing the appearance of TrafficLightButton to aqua.

Thank you for the reminder. I re-implemented it on TrafficLightButton, but encountered an issue: adding a background to TrafficLightButton didn't work. Ultimately, changing the inheritance of TrafficLightButton to NSView solved the problem.

decodism commented 1 month ago

I'm not sure I follow you, but I was thinking of something like this:

class TrafficLightButton: NSButton {
    [...]
    init(_ type: TrafficLightButtonType, _ tooltip: String, _ size: CGFloat) {
        [...]
        appearance = .init(named: .aqua)
    }
    [...]
}
Allsochen commented 1 month ago

I'm not sure I follow you, but I was thinking of something like this:

class TrafficLightButton: NSButton {
    [...]
    init(_ type: TrafficLightButtonType, _ tooltip: String, _ size: CGFloat) {
        [...]
        appearance = .init(named: .aqua)
    }
    [...]
}

I don't know how to fix it using aqua, but I fixed it another way by extending NSView.

lwouis commented 3 weeks ago

Hi everyone,

Indeed, I think this MR is quite large, for its intended goal. I was able to reproduce the issue by switching to Dark Mode. Then I applied the fix suggested by @decodism, and it fixes the issue for me. One line of code seems to fix the issue:

image
Allsochen commented 3 weeks ago

Hi everyone,

Indeed, I think this MR is quite large, for its intended goal. I was able to reproduce the issue by switching to Dark Mode. Then I applied the fix suggested by @decodism, and it fixes the issue for me. One line of code seems to fix the issue:

This MR not only fixes the issue with the transparency of the traffic lights button but also does the following:

I have thoroughly tested these features and have been running them on my computer for quite some time, ensuring they are correct to the best of my abilities. If you think these changes are difficult to understand within a single MR, I can split them into multiple MRs, although this will increase my workload.

lwouis commented 1 week ago

I'll grab the change on the dev branch. It will be in the next release 👍