I am new to QML, so I wanted to ask .. is it possible to import/convert/use CSS templates in QT ?
because I found many stylish CSS component. more than QML templates.
QML by default allows CSS styling with limited options. The limitations are mentioned here.
But if your intention is to add a .css file into the project and make that as a style sheet then there is no default way.
Here is the out of the box project with GitHub, which allows direct integration of CSS style sheets into QML. You can refer to the examples in that project
Related
I need to build a custom Style for a Qt VirtualKeyboard on a small screen to maximize its readability. I have built a custom layout into my project, and using the QT_VIRTUALKEYBOARD_LAYOUT_PATH it works great.
The problem I am having is that the documentation states that the custom style must be placed in the Qt Directory. I need this style to be portable, however, so storing this newly built style on my local machine, rather than in the project itself, will not be acceptable.
Is there any way to build a use a keyboard style within a project?
It doesn't have to be in the Qt directory, just in a directory that is under QtQuick/VirtualKeyboard/Styles/ and in the QML import path.
As an example, take a look at the auto test:
http://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/tests/auto/styles/data
You can also put the style in a .qrc file under that folder structure:
http://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/src/virtualkeyboard/virtualkeyboardsettings.cpp#n70
I've created a task to make this clearer: https://bugreports.qt.io/browse/QTBUG-66172
Since Angular uses view encapsulation is it possible to support multiple themes in Angular 2? I mean the user should be able to click on a button and change the color theming of the whole application.
PS: I am using Angular 4 with angular-cli with SASS support.
Currently I am able to generate static themes with a _variable.scss file which is imported in each component's sass based stylesheet.
But, my requirement is end user should be able to choose his own color theme.
Ideally in non-angular websites I would just add a new compiled css file to the <head> tag using javascript. Since shadow DOM generates separate style for each component and adds them in to the <head> how I change the style for each component dynamically?
you can try the css method var(), for more details can read this blog
I want to style default javaFX date picker to our custom theme, but i cant see any Documentation/Guide to change CSS proprties.
any help would be appricated
Default javaFX Calender style
I want to customize its color to match below guideline
The best documentation, in this case, can be default CSS file called modena.css. This style sheet is applied for every JavaFX components.
You can find this file in the JavaFX jar file jfxrt.jar (should be located /jdk1.8.x/jre/lib/ext/jfxrt.jar). After unzipping that jar file you should find the modena.css under com/sun/javafx/scene/control/skin/modena/
Find in the file a commented section DatePicker (in my file it's line# 2999) and you get all style properties that you are looking for.
Hope it helps.
I've made a library in flex with different components and my CSS I want to use in different projects (the goal of a library....).
BUT even if I can use my components, I can't use my CSS file which is in the library.
When I try <mx:Style source="assets/style.css" />, it wasn't found :(
So, how I should do to have a CSS file in my library which can be use in a project ??
Thanks for all your help
Right click your project in the package explorer and locate your CSS file. It should show up automatically if your source path is set up correctly and the asset is descendant of that directory. Then just make sure the checkbox next to the CSS file name is checked.
1) If I create a theme and a skin file and a css file to go with that theme, does the skinfile automatically pickup the css file I created? What happens if you have multiple css files under a theme?
2) Do css files in themes override global css files? I created a global one and the theme that had a css file did not change the background color to the one I had in the theme, but the theme that did not have a css file, did change the background color to the one in the global css file.
3) It appears that skins and css files are the same? Can't I just create a theme and use css files within the themes instead of skins? Are skins just for asp.net server controls?
I dont like skinning and prefer to just use plain ol CSS. Thats precisely what a skin is but very limited. I say drop the skin and stick to CSS files.
You can have many theme folders within the App_Themes folder. An ASP.Net Theme can consist of many skin files and many css files.
Yes, the Skin file is aware of the CSS file. When you apply a Theme, your page is made aware of all of the .css files in the Theme automatically.
I'm not sure. Testing is the only way to go.
No, .skin files are different than .css files. Yes, you can just use css files in a theme and skip the skins. Yes, skins are just for asp.net server controls.
Themes vs. Cascading Style Sheets
Themes are similar to cascading style sheets in that both themes and style sheets define a set of common attributes that can be applied to any page. However, themes differ from style sheets in the following ways:
Themes can define many properties of a control or page, not just style properties. For example, using themes, you can specify the graphics for a TreeView control, the template layout of a GridView control, and so on.
Themes can include graphics.
Themes do not cascade the way style sheets do. By default, any property values defined in a theme referenced by a page's Theme property override the property values declaratively set on a control, unless you explicitly apply the theme using the StyleSheetTheme property. For more information, see the Theme Settings Precedence section above.
Only one theme can be applied to each page. You cannot apply multiple themes to a page, unlike style sheets where multiple style sheets can be applied.
Quoted from: ASP.NET Themes and Skins Overview
My Opinion:
Generally, if you've got a good understanding of CSS you don't really need .Skin files but Themes are still useful.
The Themes in asp.net are a bit confusing, they are somewhat css and a somewhat finicky.
Stick to normal css and create your own skin framework (eg: configured css folder)
It will be much easier to use things like jQuery plugins with normal css and it will easier to work with designers who know normal css for cross browser development.