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

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"

Related

visual studio code import custom css and js extension

I'd like to install custom styles in order to have different fonts for classes and attributes in visual studio code.
I installed the Custom CSS and JS Loader extension, and followed the guide but it doesn't seem to work.
Here's what I've tried. I created a file styles.css where I put this code:
.mtk1,
.mtk2,
.mtk8,
.mtk9,
.mtk10,
.mtk12,
.mtk11,
.mtk7,
.mtk3,
.mtk13,
.mtk16 {
margin-left: 1px;
font-family: "Indie Flower";
font-size: 1em;
}
.mtk7,
.mtk4 {
font-family: "Arial";
font-size: 0.7em;
}
/*
For the tab titles.
*/
.monaco-icon-label-description-container .label-name {
font-family: "Indie Flower";
font-size: 1.3em;
}
.tabs-container .monaco-icon-label-description-container .label-name,
.sidebar .monaco-icon-label-description-container .label-name,
.quick-open-row .monaco-icon-label-description-container .label-name {
font-family: -apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,Ubuntu,Droid Sans,sans-serif;
font-size: 1em;
}
Then in settings.json I added the following settings:
{
"vscode_custom_css.imports": ["file:///home/mat/vscode_extensions/styles.css"],
"vscode_custom_css.policy": true
}
I took the path by typing inside this directory pwd, so it should be correct path. However, it still doesn't want to apply styles, neither fontFamily nor fontSize.
Does anyone knows where the problem is?
Extension didn't work for me but For what it's worth....while i was messing with this...if you go to the help menu, toggle the Developer Tools....
It will
Check the network tab > you will see there is one css file that vscode loads up.
file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.css
I went into this file and directly edited the css directly...
since i already had a css file that i intended to use with this extension...
#import url("file:///Users/adrian/.vscode/vs-code-styles.css");
Reload & Problem solved.
For example, i love my font but all i wanted was the tag to by with a different font-family then the attributes. After some trial and error, this did it. Mileage may very depending on whether or not vscode is changing these classes all the time.
span:not(.mtk1) + .mtki, span:not(.mtk1) + .mtk6{
font-family: 'Courier New' !important;
}
You have to run VSCode as Administrator and then Enable CSS in JS.
Example path to VSCode located in Applications:
sudo /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron
And don't forget to install all those custom fonts to your Mac device.

Difficult to increase the profile text in Moodle

I'm having trouble finding which file to change the css in Moodle tool. In pagia the "view profile", the data is cut by "..." I would vizualisar throughout.
Follow the link to the image:
https://www.dropbox.com/s/ewzdf4mj4vwfmcc/sesi.JPG
Right click on it and press the INSPECT BUTTON in Chrome. You will see a panel that says wich file is the one been used.
In moodle, There is chance to come mostly css from selected theme.
If the css is not coming from selected theme then it may from standard theme or from particular module.
The css is put into one large file for performance. To switch this off, add this line to config.php
$CFG->themedesignermode = true;
Remove the line or set it to false after you have finished because it will make the site verrrry slow...
http://docs.moodle.org/dev/Creating_a_theme#Theme_designer_mode
Refresh the profile page and now you can use inspect element in Chrome, it should show the original css file.
It seems to be this file /theme/canvas/style/core.css
Around lines 288 to 296 (In Moodle 2.5.4)
.userprofile dl dt {
padding-left: 0;
font-weight: bold;
display: inline-block;
padding-right: 2%;
min-width: 100px;
width: 15%;
clear: both;
}
So edit this file in your theme
/theme/yourthemename/style/core.css
And add this to override the default min-width.
.userprofile dl dt {
min-width: 120px;
}
Refresh the profile page and it should display okay. 120px seems to be minimum for "Endereço de email" to be displayed in full.
Don't forget to remove this or set it to false after you have finished - config.php
$CFG->themedesignermode = false;

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.

CSS is not working in GXT

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...

Tinymce stop adding a class "mceItemTable" to my table

When I check the content area within tinymce using firebug, I notice that TinyMce is adding a class=mceItemTable to each of my tables. This is annoying because in the theme stylesheet it has definition for this which sets all tables to have a dotted bored and looks horrible.
Is there any way to turn this off?
Cool jsfiddle for tinymce
PS: Is there a correct name for a css definition/group like this?
.className {
background: blue;
color: red;
font-size: 12px;
}
You may set whatever class you like using this configuration setting: http://www.tinymce.com/wiki.php/Configuration:visual_table_class