CSS is not working in GXT - gwt

I am in learning phase of GWT GXT,
I my project some of the css are working fine , but some are showing me a strange behavior .
for login button.
logonBtn = new TextButton("Connect");
logonBtn.setIconAlign(IconAlign.RIGHT);
logonBtn.setIcon(Resources.INSTANCE.login());
logonBtn.setStyleName("Project-Button");
Css
.Project-Button {
color: Black;
border: thin outset #FF6600;
font-family: Courier New, Century Gothic, Times New Roman, Verdana, Arial;
vertical-align: middle;
background-position: left center;
background-color: White;
cursor: pointer;
}
But when i run the project , this css is not showing any effect on connect button.
In my Project i have i have 6 or 7 TextButton.
But this css is showing effect in only one of these buttons
I tried to use Firebug to see the problem. I see there is no Project-Button css attached with this textButton.
Attached is the Image of fireBug.
If somebody understand this , please explain and give the solution.
Thanks in Advance.

If tou change GXT Text button style you have to write your ButtonCellAppereance. GXT button styles too complex as other gxt widgets. example link about appereance
1: http://www.slideshare.net/senchainc/ext-gwt-30-theming-and-appearances i started a project on gwt projects as theme project link
but i have no more time to develop. good hacking...

Related

Unity UI Toolkit - Background image

I was learning the new UI toolkit. I'm trying to add an image to a visual element.
I added an image and saved it. After reopening it, nothing appeared like I didn't add anything.
What can it be about?
SS of it
same here, I could overcome the problem by adding the bg image via an txt editor program.
such as
style="width: 60px; height: 60px; padding-right: 10px; background-image: url('project://database/Assets/Images/xxx.png');"
I have no idea why they didn't fix such an obvious issue yet.

How do I get yad for gtk3 to customize button font, background and foreground color?

I'm using yad for GTK3 (not GTK2) on a Raspberry Pi 3 to display a set of buttons. The screen is far away from where I sit so I need a way to make the button text and highlighted button stand out. I'm totally unfamiliar with the inner workings of GTK3 and just need a step by step of what to do. I don't wish to change themes or other more global settings, I just want it to work for this YAD execution. Is it possible?
I saw a blog that described how to change the button style using an RC file but that was for the version of yad using GTK2 libraries. I soon learned this wouldn't work for me on the Pi 3. I should mention I'm using the default window manager of LXDE.
My hope is someone could provide a newbie step by step of file content, where to put the file and how to make use of it. I know the solution has to do with css but I'm not familiar with how to do something like that and how to make the CSS active for just yad nor do I know what things to put in said css file.
I mostly solved my own situation. Hopefully this helps others. It's not perfect but it accomplished my needs.
The first thing I did was start yad using the GTK debugger.
export GTK_DEBUG=interactive
yad --title "my title" --button "button1:1" --button "button2:2" --button "button3:3" --text "some text"
The most useful thing to me in the debugger was selecting and finding the name of objects and editing css on the fly. I don't know css. I cobbled together bits and pieces I found on other sites which mostly worked.
Then the other thing that helped was the ability to change GTK3 themes "on the fly". I did that using:
export GTK_THEME="Adwaita-dark"
Then I reran the yad line again. It used the new theme temporarily.
I found the theme did mostly what I wanted and it seemed to respect my custom css. For some reason that I haven't dug into, using the default theme of "Adwaita" did not respect my custom css. Obviously if I pick a different theme, you have to put the custom css in that theme's directory instead of 'Adwaita-dark'
To save my customizations, I created $HOME/.themes and created the following directories under there:
$HOME/.themes/Adwaita-dark
$HOME/.themes/Adwaita-dark/gtk-3.0
Then I put my custom css in $HOME/.themes/Adwaita-dark/gtk-3.0/gtk.css
This is my custom css that override yad's defaults:
/* The background of the entire window
box {
background-image: image(rgb(224, 224, 209));
} */
/* The progress slider */
progress {
/* background-image: image(rgb(102, 102, 255)); */
background-image: image(rgb(102, 0, 255));
}
/* this gets us the highlighting behavior */
button:focus {
color: black;
border-top-color: yellow;
border-left-color: yellow;
border-right-color: yellow;
border-bottom-color: yellow;
border-bottom-width: 10px;
border-top-width: 10px;
border-bottom-width: 10px;
background-image: image(rgb(255,102,255));
}
button {
color: yellow;
font: 24px "comic sans";
border-top-color: black;
border-left-color: black;
border-right-color: black;
border-bottom-color: black;
border-bottom-width: 10px;
background-image: image(rgb(100,100,100));
}
Some of the above directives did not really do anything with this theme, but I left them in in case I wanted to try it in the future. My way of starting yad is something like this:
GTK_THEME="Adwaita-dark" yad --title "my title" --button "button1:1" --button "button2:2" --button "button3:3" --text "some text"

How to apply styles for GWT scrollbar

I 've tried to give css to scrollpanel in GWT. But its not working.
The problem is I want to change the foregroung and background colors and also the width of scrollers.
Is it possible? can any1 suggest?
Generally it is based on the browser user agent.
For example : For Chrome You need to do something like,
::-webkit-scrollbar { width: 3px; height: 3px;}
::-webkit-scrollbar-button { background-color: #666; }
::-webkit-scrollbar-track { background-color: #999;}
::-webkit-scrollbar-track-piece { background-color: #ffffff;}
::-webkit-scrollbar-thumb { height: 50px; background-color: #666; border-radius: 3px;}
::-webkit-scrollbar-corner { background-color: #999;}}
::-webkit-resizer { background-color: #666;}
Please refer this Link
GWT scrollbars are simply html ones, so you can style them in the same way you would do with plain html: using css.
Add a class to your ScrollPanel and set the styles in your .css files, or set styles to it using java methods.
But you have to be aware that styling scroll-bars is not a standard thing, webkit supports it via vendor-css-properties and the same with IE, but unfortunately you will not be able to style FF.
UPDATE:
As #Andrea suggest in the comment below, if you can change in your app ScrollPanel by CustomScrollPanel you have much more options to customize bars.
In this case you have to provide your own bars because by default it uses browser native ones. This response can help you.

Fancybox 2 - Include a new Div into Image?

How can I insert a new div (not in .js) into fancybox (when fancybox - image is open)? Like this:
I'm also try to make a div css to fit that description :)) still with no avail. I suck at css styling, will get back on this one when i figured it out. my theory is that it should be a div within a div within the div if you get what i mean :))
!!!!!!!!
UPDATE I tried messing around the css and this is what i got (I'm using 1.3.4v for simplicity's sake in my part) and for reference, these images and codes I used are found in the 1.3.4 demo packege from fancybox.net
If I didn't explain my code well, it just means I'm still working on it so I just hope you get why it is vague, but the point is it's doable and you only need to work out the css file. I hope someone has a nicer looking code
Output:
1.I all of these from jquery.fancybox-1.3.4.css
just change these 1 2 3 and mess around with example7 there in the demo
#fancybox-outer {
position: relative;
width: 100%;
height: 100%;
background: #fff;
padding-right:50%; /*this part extends the right side of the photo so it would look like thet're on the same page*/
}
2.This re-positions the original title to the upper right part of the image
.fancybox-title-inside {
padding-bottom: 10px;
text-align: left;
color: #333;
position: absolute;
top:0;
left:65%;
border:1px solid black;/*for you to see how large the div is*/
height:100%;
}
3.My new RED div where I will be
div.fancycontent{ /*saviour do word wrap here*/
border:1px solid black;
padding:2px;
color: #333;
background: #FF0000;
width:50%;
height: 100px;
}
I tried using fancybox in one of my projects but had to revert back to implementing my own popup's using the DIV elements. Its pretty easy to create your own popups instead of using fancybox or facebox if you know a bit of JQuery try to have a look at these links. You can customize your div tags to contain what ever you need.
output
source
In your fancybox JS, set the type to iframe:
$(document).ready(function() {
$('.callout').fancybox({
type: 'iframe',
width: '640px',
height: '480px',
});
});
Then you can open up anything you want in the fancybox by simply applying the class to your link:
<a class="callout" href="{path}">{link}</a>
If you have issues with the iframe display, you might try adding a secondary class to tell fancybox what type of content you are linking to (this is a new convention introduced in the latest version, so I don't know if I'd recommend using it by default):
<a class="callout callout.iframe" href="{path}">{link}</a>
Hope that helps!
ty
It just happened that I created this fancybox "a la" facebook demo that looks pretty much like what you want:
http://picssel.com/playground/jquery/fancyboxALAfacebook_26Mar12.html

change font size of a flextable in gwt

I was wondering if anyone knew how to change the font size of a flextable in GWT? I've tried numerous attempts and looked online everywhere but no solution seems to work. I have a flexTable in GWT, and a number of labels like...
user_info.setText(5, 0, "Organization:");
Currently I've been trying to write a style in a CSS page with the code
.smallFont
{
font-size: 6pt;
background-color: #66ff66;
}
I set the flexTable to that style and the background of the table changes, but the font does not. Any help would greatly be appreciated. I've looked online everywhere. I've even tried changing the default styling page for each component by doing ...
.gwt-FlexTable
{
font-size: 6pt;
background-color: #66ff66;
}
but to no avail...
So discouraging = (
I used firebug to find out the CSS styles of GWT, then in my CSS file I used "!important" to override the existing CSS styles. There is an example below.
.gwt-TabPanelBottom {
border-width: 1px !important;
background: none no-repeat scroll center center #F6F6FF !important;
padding: 0 !important;
border: 2px solid #BFCC99 !important;
}
Override the CSS imported via your XML with the !important statement.
Or if needed, you can just download those base css files, manually include a copy of them, comment out everything in the xml, and have full style control.
Here's the clean.css file for example:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/theme/clean/public/gwt/clean/clean.css?r=10894
Specifically, to change the font in a GWT Flex Table (assuming you are importing clean.css), add this example to your custom css file and override the table td style you imported:
table td{
font: 18px Arial, sans-serif !important;
}