I have a flex app, in which I need to change the color of the focus rectangle of a textinput if the input is empty. This used to work when I was writing inside a mx:script tag, but now I'm writing a new component (an AS3 class that inherits from VBox) myself. And now it isn't working anymore. I used to run the following statement to change color:
txtName.setStyle("themeColor", "#ff0000");
txtName.focusManager.getFocus().drawFocus(true);
Is it something related to the mxml? How can I fix that?
Which SDK version are you using? My guess is that you are using 4.x since this is no longer working for you. In versions prior to 4.0, the focus color was derived from the "themeColor". Not so in 4.0+, which now uses "focusColor" for the focus color (naturally).
Related
I am working with a freelance client on the side that wants to utilize Angular Material throughout the project. However, they do not like the way that the underline looks in the angular material input. I have tried a variety of approaches to change this, but I haven't found any success yet.
To be honest, I haven't even been able to find the tag in the DOM that would let me alter that border.
Here are the Angular Material docs, as you can see all of the available options have at least some form of a bottom border.
Some approaches I've tried:
This one is from the old angular material and no longer works for the new angular material
The accepted answer here is for the new angular material, but I was not able to get it to work. I implemented exactly as described and no styling changed.
This approach looked like it would work. Unfortunately, I could not get it to work either.
Any help or input on this topic would be appreciated.
For reference, the client said that any changes that deviated from the desired design would be denied. So I have to get this to work. I believe I could maybe, possibly lobby to build a custom input component as a solution, but I know that they are dead set on Angular Material.
Edit. Added a pic of desired look:
this little code did it for me. I didn't want to display it and just set height and width to 0.
::ng-deep .mat-form-field-underline{
height:0 !important;
width:0 !important;
}
However I think its kinda hard to style the Angular Material Components and for me its sometimes better to built my own.
First of all, you'll need a .scss to be imported either within the default theme.scss or after the import of the material stylesheet in main.scss.
Now, Material offers you the option of customising colours and some of the styles by overriding their #mixins found somewhere in the Material folder ( I don't have the folder in front of me.. very sorry for the vague pointing... ).
Back to the newly added file; You can override material's default styling by checking the DOM for certain classes and then adding them in said file with the desired changes. Because the file is loaded after Material's, the default styling in overridden. Same thing applies for the #mixin you chose to override. Just have a look in the file, copy-paste the whole #mixin and change accordingly.
Now if you wish to go even further, my colleagues and I have a custom library that uses Material BUT the whole styling is stripped off leaving you with the bear input within the mat-form-group and then using a <input disabled/> with a position:absolute over it. That way you get to benefit from material without using their style.
I use C++/Qt 5.12, Windows 7 OS, Visual Studio 2017.
I'd like checkable QPushButton background to ignore checked/pressed state. I'd like to have a default background in a QPushButton instance, but only font color should be changed if the user checked the button. How can I achieve this effect?
You can use QSS (CSS with Qt's flavor) to customize QWidgets:
https://doc.qt.io/qt-5/stylesheet-syntax.html
I would recommend creating an application-wide QSS that you load at startup, and use QApplication::setStyleSheet(...). But you can use Qt Designer (right click on a specific control), or plain C++
myButton->setStyleSheet("QPushButton { background: yellow; }");
You may need to redefine border to have it visually applied, and then margins to have a correct button size, but it is fairly easy. Try experimenting from Qt Designer.
You can find a comprehensive reference of all selectors and attributes available here: https://doc.qt.io/qt-5/stylesheet-reference.html
I have a problem when using md-buttons, md-select or md-field in a vue project created by the vue CLI from the webpack template.
I have a MWE of the situation here, featuring the three introduction examples from the vue material website on each type of form item combined with the vue-cli template. It doesn't look very nice, but if you run it it breaks down as follows:
The first row are a set of radio buttons; however, the buttons are invisible (yet you can click on them, get a ripple effect and the correct value is recorded by vue)
Next is a select box; however, the background of the box is transparent.
Finally there are a few text boxes; however, the outlines seem to be transparent.
I can solve the issue with the select boxes by inserting a style block
<style>
.md-menu-content-container {
background-color: white;
}
</style>
and that will make md-select work as expected. I still decided to include it here, because it seems related to the other issues and may have a common origin.
Unfortunately, I have not figured out how to solve the other issues yet or which attribute to modify to "patch" the problem. So any help or pointers are highly appreciated.
It appears that when using he latest version of vue-material, the default template has to be loaded explicitly. Hence adding
import 'vue-material/dist/theme/default.css'
to the main.js file from vue-cli seems to fix this issue.
I am creating a custom Control in QML for my application. I want to run on both desktop and Android, so I'm using Material Style for the application. This applies a colour scheme to all existing Qt Quick Controls 2 controls (buttons, toolbars, etc). But how do I use those colours on my control? I know I can just use the same colours with a hex code or whatever, but I want my control's colours to change if I change the accent colour in the theme, etc.
I've tried SystemPalette but the colours there don't seem to follow Material Style but rather always follow the default style.
Is it possible for me to get access to the Material colours? What will happen if the application is run in non-Material mode?
You can import the styles :
import QtQuick.Controls.Material 2.2
or
import QtQuick.Controls.Universal 2.2
The colors are then available through a singleton:
console.log(Material.accent)
console.log(Material.primary)
// etc...
The current style can be retrieved from C++ with QQuickStyle (you need to link against the Qt5QuickControls2 library)
Just figured it out. Set an id on any actual control, then you can access the "extra" colours as controlId.Material.buttonColor etc
Remember that you can also set style colors. And it is not that much of a complex theme either, there are 3-4 colors per style.
So you can define your own set of colors in a singleton, set whatever style you are using to those colors, and use those same colors in your custom stuff. This way you will achieve uniformity between stuff that is styled by default and your elements, and color changes will affect everything, regardless of which style you are using.
Is there any way to turn off all special FX's and especially dropShadow's on all objects inside the application ?
( The idea is to increase the performance , another ideas on increasing preformance is more than appreciated. )
You need to override a lot of skin files or use (or create) a custom theme. Flex does a lot of drawing in its skins... for instance the default Spark TextInput draws a 1px shadow inside the text box. It does NOT use the "dropShadow" filter to do this.
Overriding skin files is easy to do and you can make them defaults in your CSS like this:
s|TextInput{
skinClass: ClassReference("you.com.view.skins.LookMaNoShadowTextInputSkin");
}
You should look into Flex 4 theming to remove anything that you want/don't want. By default the Spark theme is used for a Flex project. Look into your project's properties and change it around. I believe there are some themes in Flash Builder that doesn't have shadows.