Example of Sencha Touch loadmask: here
Is there any way to customize the loadmask properties without needing to create a new one? I want to increase the size of the darker grey box (i think its the inner-mask right?) because i want to use html to make the loadmask looks better. But with box that has a size like that, there's little thing that you can do to make the loadmask looks better.
masked: {
xtype: 'loadmask',
message: 'Now Loading..',
}
How would i set that darker grey box size? I tried with height and width but that one modifies the whole loadmask size, not the darker grey box area.
i tried some, here is the result.
Solution 1
{
xtype: 'loadmask',
id : 'testMask',
message: 'Now Loading..'
}
CSS
div#testMask{
font-size: 20.95px;
}
it's working but note that it will increases font size.
Solution 2
CSS
.x-mask .x-loading-spinner-outer {
min-width: 20.5em !important;
height: 19.5em !important;
}
it's also working, but it overrides the existing style.
Related
I have a button on which I set the background image using css, and then sometimes need to change it dynamically in the code. But if I change it, I see both images, one on top of the other.
Here's my css:
ExpertVideoButton{
cn1-derive: Label;
background-image: url(images/play-video.png);
cn1-source-dpi: 180;
cn1-background-type: cn1-image-scaled-fit;
}
And my code:
mStateMachine.findViewVideoBtn(f).getAllStyles().setBgImage(mStateMachine.res.getImage("no_video.png"));
The previous background image doesn't get replaced by the new one. Any ideas on how to solve this?
Update
The original background image wasn't actually being set from the css - there was a css style that was unused, and the image was being set from the code, twice. The first time I had made it the Label's icon, and the second time its background image. Unfortunately, this was a case of me having trouble reading my own code!
Since you use transparent images you need to set the bgTransparency of the style to transparent (0) in the CSS (not sure how you do it there).
Here's the problem:
I tired to make the textarea from javafx have a black color, so i tried to add the parameter:
"-fx-background-color" with the value "black"
It did change something: Around the text area a black border appeared. I tried to change the background size with:
"-fx-background-insets" with the value "100" (for testing purposes, i know there are up to 4 values)
But nothing visual happend.
However, if i set the value to "-100", the screen 100 pixels outwards of the textarea is painted black. So, in theory, reversed parameter delivers the reversed result of what i want.
Therefore i ask: Why is it not working? I looked up other solutions, and they do it with the "-fx-background-color" parameter, so what a i missing here?
Use the following in an external css file:
.text-area .content {
-fx-background-color: black;
}
don't forget to include this css file, either through FXML or through code. You can use this tutorial.
I just found the solution to change the color of the background of TextArea in JavaFX. Write this in your controller class:
textarea.setStyle("-fx-control-inner-background: black;");
I was deep searching on the stackoverflow and eventually found it. The link is given below: Textarea javaFx Color
Happy coding!
Im trying to get a dynamic scrollpane in my JavaFX (FXML) application using CSS. my CSS for the scrollpane looks like this:
.scroll-pane {
-fx-width: 80%;
-fx-height: 80%;
-fx-background-color: #FF3333;
}
the color works, but the size properties don't if I open the CSS in JavaFX scene builder it doesn't show the height and width lines at all.
I assume im missing something pretty basic, but I can't seem to figure it out.
As far as I know you cant use -fx-width/-fx-height at all and you cant use percentage values for it. The width and height of elements are read-only. You can set -fx-pref-width, -fx-pref-height, -fx-max-width, -fx-min-width, -fx-max-height and -fx-min-height to adjust the size of Java FX elements.
Check the CSS Reference Documentation out to see which CSS styles are possible.
If you want to have the size as percentage you probably need to bind the size to another property.
As example:
myView.prefWidthProperty().bind(myOtherView.widthProperty().multiply(0.75));
There is another post about percentage values with the use of a GridLayout.
How do specify a width percentage in JavaFX 2 using FXML?
I need my visual content to become darker (like when modal Alert is shown). I've tried to look up in the source code of Alert and PopUpManager, but found only blur and fade effects there... Is there any basic Filter to do set content darker? Thanks
You can use ColorTransform with color multipliers:
component.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5);
There are 4 styles you can set on the global identifier in styles to set all modal popup background effects. I think you'll want something like this:
global
{
modal-transparency-blur:0; /* no blur */
modal-transparency:0.5;
modal-transparency-color:#000000;
modal-transparency-duration:0; /* no animation, goes straight to faded black. in ms */
}
What about creating a new UIComponent/Sprite whatever you use, making it black with opacity liek 50% and pushing on top of the display list just below stuff you want to show.
I have a ASP:Menü in vertical style.
The MainItem is only 1 Button, deisgned by a Image (no text, pure image).
The ChildItems are normal Text.
Here is a very high zoomed screenshot: http://s2.imgimg.de/uploads/UnbenanntesBild661673a8png.png
Now, beacuse of the image, the childItems look very... strange, because the ChilItems begin, where the button is not there (very hard to explain, sorry).
I want to have the child menü begins at the pixel the button beginns after the white seperator in the image.
So, I want to move the whole childItems 2-4px to the right, how I can do this?
You need to add a left rule to the style of the sub-item, similar to the following:
.subitem
{
...
left: 1px;
...
}
You will need to figure out the exact spacing for yourself, as you have not included the actually styling for me to test with.