How to remove the white box around the NSButton checkbox when disabled? - swift

Update:
I have added a demo on my Github to demonstrate the problem: https://github.com/houmie/CocoaPlayground
Build and start the app, then click on the menu symbol as shown below.
There is not much code to this. Adding a NSButton with Style Check and Type Switch into IB.
In IB it looks fine. But starting the app there is a white box appearing around the disabled checkbox. The background is obviously grey hence it shows.
Is there a way to remove/override that?

Related

How can I implement the native macOS screenshot mouse behavior?

I'm implementing a screenshotting app that captures a portion of the screen. I'm currently:
listening for a keyboard shortcut
drawing a transparent view on top of the entire screen
having the user click and drag to select an area inside of that view
screenshotting the coordinates inside of that bounding area.
Here's an example of what it looks like (the transparent view is tinted blue):
This works, but it causes the mouse to stop focusing on whatever it was previously focusing on. In other words, if I'm hovering over a tooltip and I hit the screenshot shortcut, the tooltip vanishes before I have a chance to screenshot it.
It looks like macOS's own screenshot command does not have this problem. If I hover over a date in StackOverflow in order to see the time tooltip, I can press Cmd+Shift+4 and screenshot it pretty easily:
If I try and do the same thing with my own code, the tooltip vanishes after I render my transparent view, even if I haven't moved my mouse.
Is Apple doing something specific to maintain the focus state of the mouse that I could be doing? Alternatively, should I somehow take advantage of Apple's own screenshotting flow myself inside of this app? If it helps, I'm currently using CGWindowListCreateImage to actually take the screenshot.

SearchBar Control Grays Out On Enter

On MAUI RC1 I'm seeing that when I type some characters in a SearchBar control and press Enter, the screen grays out, and then doesn't revert to it's normal color.
I've added a simple example above - you can see the background at the top of the screen is white, but the part of the screen that contains the search bar has the gray filter. I'm just wondering if it's supposed to add that light gray filter on top of the content, and if so, how do you make it clear back out?

My button Not responding on Hover or Click in Unity 2D UI

Ok as you read title you will know problem. The problem is very old and much people tell fixes. But nothing works for me. So please help another time. I have EventSystem in hierchy. See picture
Let me show you my canvas picture of inspector
As you can see I have other Canvas so let me see you picture of that name "Shop Canvas"
My EventSystem in inspector
Panel of buttons in Inspector
And finally button in inspector(These 2 images for buttons because button in inspector is some long).
If you need more Info right below and I will edit the post. Thanks for your help
I had a similar issue of not being able to engage with a button. The reason being there was another UI component with ray cast enabled that did not allow inputs to reach the button.
For your case, I think it's the "The things...". Try disabling that and see if you can engage with the button again.
I had a similar issue, where I couldn't see button interactions in a scroll view. I eventually created a click event (which worked) to find the source of my problem. While it wasn't a Raycast problem, someone else might find this handy (or I will see it in the future!)
Mine (an issue I've accidentally 🤦‍♂️ created in the past) was that I set the color of the attached Image component to black and couldn't see the interaction states in the Button. So to restate, leave Image.Color white/opaque but change button states if you want dark menus.

iPhone red circular button with 'x'

Probably a silly question here but I have been trying to find this for about an hour now. How do I create the circular red button with an 'x' that appears when navigating pages in safari for example. And is there an 'official' name of such a button type?
Screenshot
Thanks !
You'll have to create a button eIther from scratch or from the screenshot in an Image editor like photoshop and then import it into your project and set a button's image to the name of the image. There is no official name for this button and you can't add it to your app using a key or special method.

IPhone: Custom Button - Why is title not showing?

So I basically dragged a button from interface builder's library, turned it into a Custom button. Then I added one png for the "default state configuration" and another png for the "highlighted state configuration". Let's just assume these png's are a red box and a blue box.
Now, I'd like the Title to display for the button i.e., "Press Me" or something. But the Title doesn't show. Am I missing something?? (I also tried to have that text in different colors but no dice...)
Thanks in advance.
Are you setting imageForState or backGroundImageForState? :)