Fluent UI React Changing the focus outline color to primary inverted color - fluent-ui

I'm rendering a CommandButton with only an icon inside a container with a dark background with gradient and I have set the background color of the button to be transparent. (Note that it is transparent because the container's background color has a gradient.)
The problem I have is that since the default focus outline for the button is black and it's not visible against the dark background. How can I change this so that the focus outline becomes the invert color of the primary color?
I can always attach a custom CSS to change the outline color, but I'm looking for the correct way supported by the Fluent UI framework. I noticed that the Button component puts a white background color when the primary=true prop is specified. So, there seems to be a way to change the outline color, but I could not really figure out how. I also looked into the source code, and it takes a theme object and generates a class name, but this still did not tell me the full story.

There are sometimes ::after selectors in play with FluentUI focus behavior. The "Chrome version >= 86" portion of this answer shows how to put Chrome in a state that will yet you inspect your components without losing focus in the page when you navigate in DevTools.
When I encounter focus styling that I want to change in Fluent, I can find out what's applying the styles I wish to alter using this method and then override them.

Related

Even if the content page background color is set to transparent, while using PushModelAsync to navigate the page, the background color is always black

My goal is to view the content of the bottom page from the top of the other content page. In order to accomplish this, I used PushModalAsync to navigate and set the BackgroundColor property of the navigation page to Transparent. I can view the content on the bottom page on Android. However on the iOS platform, a black color is always displayed and I am unable to read the content of the bottom page. Why is the background color always black even when it is set to be transparent in PushModalAsync?
Note: The iOS platform displays a white screen when I change the navigation to PushAsync.
Expected Behavior:
Background color should not be black and it should be transparent when navigating using PushModalAsync
Actual Behavior:
Background color is always black even when the content page background color is set as transparent when navigating using PushModalAsync
Android Screenshot
iOS Screenshot
The issue reproducing sample is provided below:
DemoSample
If you want to do EXACTLY like that, it is not possible (it will require so much work that you can't expect someone to provide you the solution here).
On iOS that control (ViewController) is drawn that way in that presentation mode. So as long as you use that control and that mode it will work that way irrelevant if you use Xamarin or something else. As ViewControllers are most basic controls it is not realistic to replace them with something else. But you can replace presentation mode. In Xamarin.Forms you can do that this way:
<ContentPage ...
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.ModalPresentationStyle="FormSheet">
...
</ContentPage>
This will result in somewhat different visual presentation but that is the only way to have one ViewController drawn over another without going into some deep customization that would require tons of code, especially on Xamarin.Forms.
You can also try some other values, but the default value will not work.
In iOS, the hierarchy is managed by the view controller. Each page has a separate view controller. A page consists of a window, a root view, and a subview. You cannot see the layout of the previous page by setting the background color to be transparent.
For more details, you can refer to the following documents:
User interface | Microsoft
The View Controller Hierarchy | Apple

Main Activity Support Action Bar Buttons

I'm in Kotlin using the default Action Bar in the main activity:
setSupportActionBar(binding.toolbar)
I see that there are several elements controlling the color of the Title, it's background, the toolbar background and the buttons on the bar. There must be a way to set the entire toolbar one color and the buttons another color. I'm using styling and XML and code to set a lot of colors elsewhere for day/night modes but I can't change the colors of these buttons. Code takes precedence over all and so I prefer Kotlin code. But it doesn't cover everything like the styling XML code does.
EDIT by author August 18, 2022:
Possibly last comment here because this is not possible. One writer here in SO admitted it was easier to build toolbars in each fragment with independent buttons than use the default main activity toolbar. I've done that with success and in adding the ability to slide between fragments but that is not what I think the compiler designers would have hoped for.
With the main activity toolbar, the buttons come from vector assets with their own XML files. If the fill color is changed in those files with this:
android:tint="?attr/colorControlNormal
and this in for example a night theme:
<item name="android:colorControlNormal">#color/yellow_text</item>
I can't get the colors in a button to change at all.
It's the same as in checkbox properties where the background of the checkbox background is tied to the background of the actual background of the "form" itself showing as a page (the main activity and fragment) on an Android. I can't change the background color of the tick mark in the checkbox either. A default seems to be taking over in the day/night themes.

How to achieve the layering effect of one Composable on top of another when showing a dialog using Jetpack Compose

I'm hoping to understand how I can achieve this behavior using Jetpack Compose in Android when displaying a dialog on top of the current Composable view.
Desired State:
Animation when clicking on the Filter button at the bottom. This is from the app Culture Trip on iOS.
I currently have a dialog like below. If you notice, my content is still visible but I would like to have it appear as if it's a page layer that's in the background.
Notice the red arrow in the desired state picture. I can mimic that behavior by having a row and setting the background color with padding but looking for a more elegant solution or wondering if there is standard behavior that I don't know about.
Actual State:
For displaying your dialog above, you need to use Box and call dialog at the very bottom of this Box.

Disable/Customize NSPopUpButton animation in 10.10 Yosemite

Context:
In OS 10.10, Apple added some new subtle animations to various controls. For example, when you check a checkbox, the blue "checked" state now animates in by expanding outward from the center of the checkbox rather than abruptly switching to the "checked" image.
Similarly, when you open an NSPopUpButton and choose an item from the menu, the menu animates closed and the selected item appears to "zoom into" the popUpButton.
The Problem:
I have customized NSPopUpButtons that draw themselves differently than the default NSPopUpButton:
When I select an item in the pop-up menu, the new animation in 10.10 briefly shows the system-default popUpButton style while animating in (blue right-hand side, etc.).
Here's a screenshot of the animation in progress, showing the system-default popUpButton animating in. (The dark-grey rectangle in the back is the "pressed" state of my custom NSPopUpButton):
What I Need
This animation obviously looks terrible with customized controls. Is there any way to disable it or to customize it? I have been unable to find one.
Turning off the Bordered property in Interface Builder seems to do the trick.
Here’s a comparison of Bordered on and Bordered off.
Please note that the Bordered property was showing as being off by default, when it’s actually on. I just had to check then uncheck it to disable it.

Infragistics State Button Checked doesn't show borders

Here is my question. I have some state button tools in my Toolbars Manager. When I set Checked = True, I don't see that button is checked. Actually I see it, but without borders as usual. Instead of that I can see light-light blue background in my state button tool. Could you please answer why is it happen and how can I change my code to view state button checked state as usual (with borders and usual background) ?
I was able to reproduce your problem setting the BorderAlpha property to Transparent.
Resetting to Default reenables the border around the Tool.
The property is present in every Appearance settings of the button, but the one I have used is the PressedAppearance of the Tool (Large or Small depending on your customization)