.NET MAUI: Change off color of switch - maui

is there an opportunity to change the off color of a switch control? I can change ThumbColor or OnColor, but unfortunately not OffColor.
When switch is not toggled, you can't see the complete switch control very good:
Thank you!

When switch is not toggled, you can't see the complete switch control
very good.
The background color set for the switch affects the visual effect.
You can try to set to another color.
Please refer to the following code:
<Switch OnColor="Orange"
BackgroundColor="WhiteSmoke"
ThumbColor="Green"
Toggled="Switch_Toggled" />

Related

VSCode "View Problem" Dialog Background Property

I searched through the VSCode Docs, but was unable to locate any useful documentation that explained what the properties that highlight the background colors for the widget demonstrated in the image below.
What VSCode Theme property modifies the "View Problem" dialogue's background color?
After two hours of isolating individual properties and trying to diagnose the issue, I can confirm that the property that controls the background color of VSCode's "View Problem" dialog is called: 'editorMarkerNavigation.background'.
I hope this helps others in the future.
So this isn't a problems widget, its a navigation widget, and it helps to communicate important statuses in the current script you have loaded into the editor. It attempts to help you find and locate issues. I find that it is most useful when used inside of a very large code base. It doesn't just relay what problems exist, it can show errors, info, & warnings too.
So the property you suggested colors the majority of the background, but part of the widget is a header, and to change the background color of the header you will also need to use "editorMarkerNavigationError.headerBackground".
This is the full property list for "Marker Navigation Widget".
// #file "./themes/your-vscode-theme.json"
{
"editorMarkerNavigationInfo.headerBackground": #000000,
"editorMarkerNavigation.background": #000000,
"editorMarkerNavigationError.background": #000000,
"editorMarkerNavigationInfo.background": #000000,
"editorMarkerNavigationWarning.background": #000000,
"editorMarkerNavigationWarning.headerBackground": #000000
}

Custom Switch - Yes No Type - iPhone

Is there any chance of getting this above switch implemented? Any reference source would be helpful.
You can create Custom switch button with the Help of image. Create a switch button (Set Alpha below to 1) and place a image above UISwitch it will work perfect.
https://github.com/samvermette/SVSegmentedControl
https://github.com/samsoffes/sstoolkit
https://github.com/alinux/iPhone-custom-switch-UIView
This isn't going to be an answer to solve your question, as it is going to be more of a piece of UX advice.
This type of switch goes against Apple's HIG.
You should never display a segmented control or switch where the user will not be able to tell when the control/switch is "On" or "Off". If I were someone who hadn't used switches in an iOS application before, I would not be able to tell what's "On" or "Off" in the image above. It may be easy for you to determine this, but you need to consider the possibility of someone (with less intuition than you) using your application.
Hope this helps.
Take a look at this replacement UISwitch project.

Make an iPhone InfoButton light/dark based on color behind it

How do I detect what color is under the InfoButton... so I can change the button
from DARK to LIGHT?
I set my view's color... but how do I tell if it's "kind of light" or "kind of dark"?
Besides... I can't change the info-button from light to dark anyway. (read only)
Ugh.
Shouldn't Apple have some kind of a simple "cmdButton.doThisExtremelyCommonThingForMe = TRUE" statement?
InfoButtons are useless if you can't even see them.
(Or how would I put an image behind the button to make it stand-out more?)
but how do I tell if it's "kind of
light" or "kind of dark"?
Um, look at it?
Shouldn't Apple have some kind of a
simple
"cmdButton.doThisExtremelyCommonThingForMe
= TRUE" statement?
Yeah, that would be great. But only if they'd also supply a cmdButton.doThisOtherExtremelyCommonThingForMeToo.

Why is a disabled SWT link not grayed out?

I disable org.eclipse.ui.forms.widgets.Hyperlink control just calling hyperLink.setEnabled(false).
However after that the link doesn't looks like disabled control. The link is not grayed out (but I can't click it of course).
The question is: why the link is not grayed out and what should I do to gray out disabled links?
Just extend Hyperlink and set the default colors. Alternatively you could create a composite delegate and forward the interface if it isn't too big - that's probably preferable.
Note that, in addition to Santosh's answer, with Eclipse 4.3 M6, you can restore the default color more easily, since you now have:
A new constant (SWT_COLOR_LINK_FOREGROUND) has been added that will return the native color of hyperlinks on all platforms.
did you try setting gray foreground explicitly ?
you can use following helper method:
public static void setEnabled(Link link, boolean enable){
if(link.isEnabled()!=enable){
if(enable)
link.setForeground(null); // resets to system's default color
else
link.setForeground(link.getDisplay().getSystemColor(SWT.COLOR_GRAY));
link.setEnabled(enable);
}
}

How to change background color of GtkTextView?

How to change background color of GtkTextView? I tried with normal widget set bg functionality but gtk is just changing border color of GtkText View.
Plus can some some please explain me with simple example, that how to change Text Color/Font/Text Size in GtkTextView (Whole text in GtkTextView)?
I fond some examples but they are not working..
Thnaks,
PP.
gtk_widget_override_background_color()
This the GTK 3.x+ way (until GTK 3.16). From
https://developer.gnome.org/gtk3/unstable/GtkWidget.html#gtk-widget-modify-base
"gtk_widget_modify_base has been deprecated since version 3.0 and should not be used in newly-written code. Use gtk_widget_override_background_color() instead"
UPDATE: thegtknerd notes that this method too is now deprecated and it has been since 3.16.
gtk_widget_modify_base()
http://library.gnome.org/devel/gtk/unstable/GtkWidget.html#gtk-widget-modify-base
As of gtk3, I believe the proper way to do that is through CSS. Register a gtk style sheet though GtkCssProvider, then you can write this CSS:
textview text {
background-color: #theme_bg_color;
}
We can see the relevant CSS nodes in the documentation for GtkTextView. In this case I put #theme_bg_color which is an adwaita CSS variable, but you can as well put anything that goes in a usual CSS file, like red or #ff0000.