How to display an ExtJS window with a different colour - extjs

I need to display a window Ext.Window with a colour different to that of the default theme.
Changing the colour of the guts of the window is easy enough. Changing the colour of the chrome of all popup windows is also very easy. Changing the chrome of a single window seems extremely hard. Best as I can tell, you need to copy all the styles (x-window and similar), rename and customise them and set the baseCls of the window.
Is there an easier way to do this?

In configs for the window ...
bodyCls: 'popWindow',
and then somewhere in a css
.popWindow
{
background-color: blue;
}

You can add your own custom class to the window, then write CSS rules for that class.
Check out the cls config option or the addCls method on Ext.Window. Try it out, then inspect the class applied to your window to figure out where to apply your CSS rules.
Here's the doc for Ext.Window. In Ext 3.x, I believe the method is addClass. But the config option was still cls (I think).

Sorry to answer my own question, but I finally worked out a way to colour a single window in isolation of other windows. Initially I thought I was going to have to clone the entire x-window set of classes and modify the clone but I have since found an easier way to do it.
I got a lot of help from this link but also used a lot of trial an error as my CSS skills suck
You'll need to clone and edit the background images used by
the overriding css. The files you'll need are top-bottom.png, left-right.png, left-corners.png, right-corners.png and tool-sprites.gif
The window that you wish to colour needs to have an id ('defn_display' in this
example).
Set the bodyCls of the window to a separate class that sets the background colour. For example:
.defn_content
{
background: #FFFFDD !important;
}
You need to set up the css class selectors to override the
x-window classes based upon this id using the new images cloned in step 1.
#defn_display * .x-window-tc {
background-image: url("/static/images/defn-top-bottom.png");
}
#defn_display * .x-window-ml {
background-image: url("/static/images/defn-left-right.png");
}
#defn_display * .x-window-mr {
background-image: url("/static/images/defn-left-right.png");
}
#defn_display * .x-window-tl {
background-image: url("/static/images/defn-left-corners.png");
}
#defn_display .x-window-tl {
background-image: url("/static/images/defn-left-corners.png");
}
#defn_display * .x-window-bl {
background-image: url("/static/images/defn-left-corners.png");
}
#defn_display * .x-window-tr {
background-image: url("/static/images/defn-right-corners.png");
}
#defn_display * .x-window-br {
background-image: url("/static/images/defn-right-corners.png");
}
#defn_display * .x-window-bc {
background-image: url("/static/images/defn-top-bottom.png");
}
#defn_display .x-tool {
background-image: url("/static/images/defn-tool-sprites.gif");
}
#defn_display * .x-window-header-text {
color: #515111;
}
The CSS seems to do the trick with one exception: the drag ghost is tricky to override since it is not a child of the window. As such, I still get a blue ghost during dragging.
(Tested under FF, Chrome and IE6 with ExtJs 3.4)

Check the ui property. I never tried it by myself, but I heard on Sencha conference that it's possible. Good luck...

Related

Changing scss variables in React

so i've got some colors as variables in my scss file
$primary_background: #1E1E1E;
$primary_button: #F2F2F2;
$primary_sharp: #171717;
$primary_button_active: #9D9D9D;
$primary_sharp_active: #2D2D2D;
$bluish_background: #0C002D;
$bluish_button: #C2C1EF;
$bluish_sharp: #04001E;
$bluish_button_active: #5F52AE;
$bluish_sharp_active: #0C0054;
and use them like this
.button_active {
background-color: $primary_button_active;
}
.button_text_hidden {
color: $primary_button;
}
is there any way in react i can either replace all 'primary_' with 'bluish_' styles or their values, for example:
$primary_background: #1E1E1E => $primary_background: #0C002D
i acknowledge it's probably not the best practice to change styles directly like that, but manipulating classes is the last resort here i think

Codename One - transparent foreground and fonts

I have not yet found any option to provide transparency to the foreground color of a component, or to the font for that matter.
What I want to do is:
Label halfTransparentLabel = new Label("Half Transparent text");
Style s = halfTransparentLabel.getAllStyles();
s.setBgColor(0);
s.setBgTransparency(255);
s.setFgColor(0xffffff);
s.setFgTransparency(128); // this method does not exist
I know drawing translucent stuff is heavy on the performance, but I want to do it on particular pieces only. would greatly improve the visual appeal and design, having this option.
Can this be worked around?
UPDATED ANSWER
Thanks to the Shai's comment, I update my answer. The workaround I suggested is not necessary. The same result of the posted screenshot can be obtained with https://www.codenameone.com/javadoc/com/codename1/ui/plaf/Style.html#setOpacity-int- or with the opacity property in the CSS, for example:
BigLabel {
font-size: 6mm;
font-family: "native:MainRegular";
color: red;
background-color: transparent;
opacity: 0.5;
}
OLD ANSWER - Yes, it's possible to workaround this problem using the .toImage() method, as in this screenshot:
I'm not sure if this workaround is the best, however it works.
The code of this example:
Form hi = new Form("Semitransparent Example", BoxLayout.y());
hi.getToolbar().setUIID("Transparent");
hi.setUIID("FormBackground");
Container cnt = FlowLayout.encloseIn(new Label("Half Transparent Text", "BigLabel"));
// .setSize() and .revalidate(), in this case, are necessary to use the .image() method
cnt.setSize(new Dimension(hi.getContentPane().getWidth(), CN.convertToPixels(8, false)));
cnt.revalidate();
hi.add(cnt.toImage().modifyAlpha((byte) 125));
hi.show();
and the CSS:
#Constants {
includeNativeBool: true;
}
Transparent {
background-color: transparent;
}
FormBackground {
background-image: url("background.jpg");
}
BigLabel {
font-size: 6mm;
font-family: "native:MainRegular";
color: red;
background-color: transparent;
}
thanks for your answers. with the above tips, the easiest solution in code is the following:
component.getAllStyles().setOpacity(128);
so what is the benefit to use CSS?
Having the designer to all the formating and styling, I already hate to do some parts in code and some in the designer. So why make it even more complex by introducing CSS? is CSS support supposed to replace the designer?

How should I use tooltip-speed properly?

I'm trying to set transition speed of [720kb/angular-tooltips] tooltips show/hide to 0.5sec.
Default speed in "slow" mode is 0.65sec(from default css), and that's ok for me - I can use this instead of 0.5sec.
But after set mode to slow, nothing really changes.
{{n.FileName}}
http://jsfiddle.net/u898mg2m/17/
above is test of using tooltip-speed attribute
Alternative question: is there another way to delay tool-tips (show and/or hide)?
https://github.com/720kb/angular-tooltips/blob/master/lib/angular-tooltips.scss You can change the values in the following .scss as you can see or define your own new transition variable.
You can set 0 for fast 1 for slow and 0.5 for steady variables.
Now to get the delay you need to change the opacity variables depending upon your requirements. Set the percentages according to the delay.Allow for smaller opacity to get a smooth transition.
Here is a fiddle for you http://jsfiddle.net/u898mg2m/21/
/*
* angular-tooltips
* 1.1.1
*
* Angular.js tooltips module.
* http://720kb.github.io/angular-tooltips
*
* MIT license
* Wed May 18 2016
*/
tooltip._bottom tip tip-arrow,tooltip._top tip tip-arrow{border-left:6px solid transparent;border-right:6px solid transparent;left:50%;margin-left:-6px}._exradicated-tooltip{position:absolute;display:block;opacity:1;z-index:999}tooltip{display:inline-block;position:relative}#-webkit-keyframes animate-tooltip{0%{opacity:0}50%{opacity:0}60%{opacity:0}70%{opacity:0}90%{opacity:0}}#-moz-keyframes animate-tooltip{0%{opacity:0}50%{opacity:0}60%{opacity:0}70%{opacity:0}90%{opacity:1}}#-ms-keyframes animate-tooltip{tooltip 0%{opacity:0}tooltip 50%{opacity:.5}tooltip 60%{opacity:.8}tooltip 70%{opacity:.9}tooltip 90%{opacity:1}}#keyframes animate-tooltip{0%{opacity:0}50%{opacity:0}60%{opacity:0}70%{opacity:0}90%{opacity:1}}tooltip._multiline{display:block}tooltip._slow._ready tip{animation:animate-tooltip 1s}tooltip._fast._ready tip{animation:animate-tooltip 0s}tooltip._steady._ready tip{animation:animate-tooltip .5s}tooltip tip{border-radius:3px;background:rgba(0,0,0,.85);color:#fff;display:none;line-height:normal;max-width:500px;min-width:100px;opacity:0;padding:8px 16px;position:absolute;text-align:center;width:auto;will-change:top,left,bottom,right}tooltip tip._hidden{display:block;visibility:hidden}tooltip.active:not(._force-hidden) tip{display:block;opacity:1;z-index:999}tooltip tip-tip{font-size:.95em}tooltip tip-tip._large{font-size:1.1em}tooltip tip-tip._small{font-size:.8em}tooltip._top tip{left:50%;top:-9px;-webkit-transform:translateX(-50%) translateY(-100%);transform:translateX(-50%) translateY(-100%)}tooltip._top tip tip-arrow{border-top:6px solid rgba(0,0,0,.85);content:'';height:0;position:absolute;top:100%;width:0}tooltip._bottom tip{right:50%;top:100%;-webkit-transform:translateX(50%) translateY(9px);transform:translateX(50%) translateY(9px)}tooltip._bottom tip tip-arrow{border-bottom:6px solid rgba(0,0,0,.85);bottom:100%;content:'';height:0;position:absolute;width:0}tooltip._left tip tip-arrow,tooltip._right tip tip-arrow{border-bottom:6px solid transparent;border-top:6px solid transparent;content:'';height:0;margin-top:-6px;position:absolute;top:50%;width:0}tooltip._right tip{left:100%;top:50%;-webkit-transform:translateX(9px) translateY(-50%);transform:translateX(9px) translateY(-50%)}tooltip._right tip tip-arrow{border-right:6px solid rgba(0,0,0,.85);right:100%}tooltip._left tip{left:-9px;top:50%;-webkit-transform:translateX(-100%) translateY(-50%);transform:translateX(-100%) translateY(-50%)}tooltip._left tip tip-arrow{border-left:6px solid rgba(0,0,0,.85);left:100%}tip-tip #close-button{cursor:pointer;float:right;left:8%;margin-top:-7%;padding:3px;position:relative}
/*# sourceMappingURL=angular-tooltips.css.map */
#link {
padding:200px;
}
Hope it may help you.

Mixing id- and class-selectors in CSS with JavaFX 8

Is there a way to make class- and id-selectors work together in JavaFX 8?
E.g.: I´d like to style a progressbar the following way:
.myprogressbar #greenBar .bar {
-fx-background-color: green;
}
This solution used to work before JavaFX 8.
Your css selector is matching a Node with class "bar" which is a descendant of a Node with id "greenBar" which in turn is a descendant of a Node with class "myprogressbar".
I assume you're setting the class "myprogressbar" and the id "greenBar" on the same node (a ProgressBar). To match this, you need to remove the space between .myprogressbar and #greenBar:
.myprogressbar#greenBar .bar {
-fx-background-color: green;
}
If you want to set a css style by id but just for a part of a node, the following code snippet did the trick for me:
In my css stylesheet file I defined this:
#agile-board *.split-pane-divider {
-fx-background-color: #C9C9C9;
-fx-border-style: dashed;
-fx-border-width: 1px;
}
In my class where I wanted to use this style I did this:
this.board = new SplitPane();
this.board.setId("agile-board");
The node got the style wit the id #agile-board applied but just the divider of that SplitPane.
Good programming :-)

Wordpress background images not showing - issue with database

There are some background images missing from my site: http://www.test.cwscambodia.org/
These include:
arrows.png (arrows on the right and left of the image slider)
sponsor_title.png (behind the the 'our supporters' text) down the bottom of the home page.
sponsor_arrows.png on each side of the 'our supporters' images at the bottom of the home page
search_bg.png which is background of the search field.
You can see how these images should look on the theme's test site: http://themes.themolitor.com/wpaid/
I have been told by the theme developer and the host that it is database problem in the wp_options table. However, I do not know which area to fix.
I have been trying to solve this issue for about 3 weeks so I would be really grateful if anyone can help me.
In the /wp-content/themes/wpaid/style.css you link to the folder /images. This folder does not exists.
example
.pxs_navigation span.pxs_prev {
left: 50%;
margin-left: -560px;
background:url(images/arrows.png) no-repeat left top;
}
.pxs_navigation span.pxs_next {
right: 50%;
margin-right: -560px;
background:url(images/arrows.png) no-repeat right top;
}
.pxs_navigation span.pxs_prev:hover {background:url(images/arrows.png) no-repeat left bottom;}
.pxs_navigation span.pxs_next:hover {background:url(images/arrows.png) no-repeat right bottom;}
In this case you will see that the arrows are linked to images/arrows.png, a folder that not exists. The good url link is /wp-content/themes/wpaid/images/arrows.png
That is the problem why you dont see all the backgrounds on your website. You can use a replace function in a text editor to change them all in one time.

Resources