Is there a way to get ride off the thickness ContentDialog in web assembly? - uno-platform

I am using the ContentDialog as modal in my app and I need to get rid of the thickness in it, so I don't get any padding in it. Done it in UWP by overriding the style of the element, since that doesn't work in a WASM is there another way of doing this?
<ContentDialog.Resources>
<Thickness x:Key="ContentDialogPadding">0,0,0,0</Thickness>
<x:Double x:Key="ContentDialogMaxWidth">972</x:Double>
<x:Double x:Key="ContentDialogMaxHeight">928</x:Double>
Wanted result(UWP):
Result I got(WASM):

Currently Uno Platform doesn't support overriding individual framework resources this way, this is slated for a future Uno release.
For now, the only way to do this with Uno is to override the entire ContentDialog style:
Copy the default ContentDialog style into your app, and include it in Application.Resources.MergedDictionaries.
Modify the ContentDialogPadding property within that style.

Related

GTK+3 C gtk_label_set_use_markup for a GtkButton + CSS style

I'm porting a GTK+2 based application to GTK+3 on Ubuntu 16. I'm trying to set the markup for the label of a button but it seems something has been deprecated. Here is the original code:
gtk_label_set_use_markup(GTK_LABEL(GTK_BIN(button)->child), TRUE);
GCC now complains that GTK_BIN doesn't have a member 'child'. So is there another technique I can use to do this? I've really struggled to find any useful information on this.
Related to this...I'm also looking for a WORKING example of using CSS to setup widget styles for a GTK+3 app. The current app uses gtk_widget_override_background_color() which is now deprecated. It seems the only way to control color is with CSS but I can't seem to glue the pieces together yet. I need to setup different colors for different widgets.
After some searching and experimentation found a solution to part of the problem. This works to set the markup of a button label as long as the label is the only child of the button widget:
gtk_label_set_use_markup(GTK_LABEL( gtk_bin_get_child( GTK_BIN(button) ) ), TRUE);
I still have not found a way to dynamically control the background color of a label or button widget using styles.

GTK3: Getting a style's class property

I'm trying to get the text color of a class of a GTK style.
I have a GtkStyleContext with the widget path and the classes that I want to get their properties.
GtkWidgetPath* widgetPath = gtk_widget_path_new ();
gtk_widget_path_append_type(widgetPath, GTK_TYPE_WINDOW);
gtk_widget_path_iter_set_name(widgetPath, -1 , "UnityPanelWidget");
GtkStyleContext *context = gtk_style_context_new();
gtk_style_context_set_path(context, widgetPath);
gtk_style_context_add_class(context, "gnome-panel-menu-bar");
gtk_style_context_add_class(context, "unity-panel");
I used gtk_style_context_lookup_color and it gets the normal text color but not the text color in gnome-panel-menu-bar or unity-panel.
I tried using GtkCssProvider but it gets the generic style without the classes I added.
I'm using it in a Qt application to get a native GTK3 look and feel.
This code is working fine in a GTK application.
Thanks!
As far as I know you won't able to use the code above because Qt uses Gtk2 and not Gtk3. This means that you will get a core dump with a message similar to:
Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in
the same process is not supported
You might be able to do something hacky by accessing the Gtk 3 libs from a diff process, but is a hack.

Adobe AIR: Controls flipped (mirrored) in certain build environments

I'm having an issue where certain controls are flipped, depending on the machine that I'm building my project on. On my development machine, when I build it, everything is okay. However, when I build it on our build server, some things are flipped. It seems to be things that are on a higher layer - for instance, options in the select control (see first image below), alerts/overlays (see second image below), etc. It's not just the text, either - the entire content is flipped, images and all.
I have verified that the code is exactly the same in both instances, so it must have something to do with settings or the flex SDK version. On my development machine, the Flex SDK version is 4.0.0.14159, and on the build server, the Flex SDK version is 4.1.0.16076. I can downgrade the SDK on the build server if needed - but could it really be an issue with the SDK? Any ideas?
Thanks!
It looks like this will be fixed in the 4.5 SDK--see SDK-26473 for workarounds.
I was able to fix the mirroring by turning off Flex 3 Compatibility Mode in the Flex compiler settings (if using mxmlc, -compatibility-version=4.0).
Your build machine must be set to a locale which uses right-to-left text, such as Hebrew or Arabic keyboard setting.
Oops - hadn't read all of dpstone's answer before I posted my comment to the question.
The answer to this problem is in the bug he linked to. You need to explicitly set the layout direction. You can do this in one of two ways.
1) in a .css file that you import into your main application file:
global
{
layoutDirection: "ltr";
}
OR
2) you can set it in a <style> tag in your main application file.
<mx:Style>
global
{
layoutDirection: "ltr";
}
</mx:Style>

How to suppress specific CSS 2.0 validation errors in Visual Studio 2008?

A typical CSS property that I use often is overflow-x or overflow-y. Sometimes I use CSS 2.1 or later properties or selectors. These (correctly) raise a validation error:
Validation (CSS 2.0): 'overflow-y' is not a known CSS property name.
For years I ignored this, but it kinda feels wrong. It's possible to switch off warnings in C# and other languages for a particular line, block, file or project. Is something similar possible for CSS (or HTML) errors or warnings? Instead of switching it all off, I prefer a more granular solution.
If you're willing to muck around a bit you can get exactly what you want.
Go to Visual Studio folder \Common7\Packages\1033\schemas\CSS
Copy css21.xml to css21mod.xml
Find the section:
<cssmd:property-def _locID="overflow" ...
After that section, insert:
<cssmd:property-def
_locID="overflow-x" _locAttrData="description,syntax"
type="enum"
description="Visibility of content extending beyond element's dimensions in x"
syntax="One of the overflow values | inherit"
enum="inherit auto hidden scroll visible"/>
<cssmd:property-def
_locID="overflow-y" _locAttrData="description,syntax" type="enum"
description="Visibility of content extending beyond element's dimensions in y"
syntax="One of the overflow values | inherit"
enum="inherit auto hidden scroll visible"/>
Open regedit, go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Packages\{A764E895-518D-11d2-9A89-00C04F79EFC3}\Schemas
If on 64-bit, you will have to go to SOFTWARE\Wow6432Node\Microsoft etc
Create a new key called Schema 5, and fill in the "File" and "Friendly Name" string values with css21mod.xml and CSS 2.1 (mod)
Should be all set!
Hi I just discovered this. In Visual Studio 2010 SP1 there is support for HTML5 validation.
Tools -> Options -> Text Editor -> HTML -> Validation
Now personally because I hate VS telling me I have duplicate ID's(Which is fine for non server controls) I turn off all warnings and set my validation to XHTML5 (Which is an option).
You can however tweak the settings till your hearts content. Sadly this is not project specific and other team members will need to do the same.
How to make Visual Studio stop "compiling" .js and .css files
Similarly as Jeremy Child suggested, but specific for Visual studio 2008 (as specified in the opriginal question):
Tools -> Options -> Text Editor -> CSS -> CSS Specific : uncheck
"Detect unknown properties"
This removes all CSS validation. This is a good solution if you need the problem to disappear fast (I have no time/bit lazy to manually add each property in an xml file and check the windows registry...) and if you are good in CSS (validation not really needed when you use built-in intellisense or styles that you are sure work -e.g. taken from previous websites you did-).
Get support for CSS 3.0 in order to suppress some of the warnings:
how to make visualstudio 2008 support css v3 & html v5
CSS 3 Intellisense Schema
So this is what happened to me. I had a successfully working project. I made a copy and started working on some label changes. And I started getting
"Validation (CSS 2.0): 'overflow-y' is not a known CSS property name."
The above error kept appearing even after reopening the projects.
So I went back to my original project, opened, started debugging to see if I get that error in that project also. The project successfully. Stopped there. Came to my new error throwing project, and now the error is no longer there.
Something to think about what caused it go away. Something in a memory. May be

Are Qt's stylesheets really handling _dynamic_ properties?

Is Qt's dynamic properties really so dynamic with stylesheets?
I have the basic example from stylesheets and dynamic properties:
/*stylesheet:*/
*[field_mandatory="true"] { background-color: "yellow";}
And I have this happening at runtime somewhere in the code:
/*code:*/
myWidget->setProperty("field_mandatory", field->isFilled() );
Nothing changes in UI, when this property is changed at runtime.
Does anyone have ideas what must be done to update Qt's stylesheet engine when changing properties, or is it even capable handling these kinds of cases?
Btw. I'm using Qt 4.4
Qt has the following recommendation in their FAQ:
style()->unpolish(theWidget);
style()->polish(theWidget);
They also say you can reset the stylesheet by doing the following but it is more expensive:
setStyleSheet(styleSheet());
I found a quick, although a bit hackish, way to update widget's styling.
myWidget->style()->unpolish(myWidget);
myWidget->ensurePolished();
Doing this after changing properties keeps correlation between property data and UI.
The following works for me to ensure a proper restyling of the widget:
myWidget->setStyle(QApplication::style())
Forcing a recomputation of the stylesheets as proposed by mdcl did not work for me. I am using Qt 4.5.3.
I tried this too with no luck, and when I found the following text in the documentation, I gave up. See The Style Sheet Syntax:
Warning: If the value of the Qt
property changes after the style sheet
has been set, it might be necessary to
force a style sheet recomputation. One
way to achieve this is to unset the
style sheet and set it again.

Resources