How to style GtkNotebook stepper arrows? - gtk

I'm trying to style a GtkNotebook using a GtkCssProvider. I can control most things using a GtkNotebook or GtkNotebook tab selector, but I can't figure out how to style the scroll arrows on the side:
If I apply a style that changes every element, e.g.:
* {
color: #f00;
}
it changes the arrows (and everything else), so it appears they do support theming:
What is the actual selector that matches those arrows, so I can apply a style to just them?

Looking at the source code, arrows in GtkNotebook are not full fledged widgets; they are just rendered with gtk_render_arrow().
The code of gtk_render_arrow shows the CSS class arrow is applied before the rendering. This means you can customize the position within the notebook class and the rendering in the arrow subclass, e.g.:
.notebook {
-GtkNotebook-initial-gap: 20;
-GtkNotebook-arrow-spacing: 20;
}
.notebook.arrow {
color: black;
}
.notebook.arrow:prelight {
color: white
}
.notebook.arrow:insensitive {
color: gray
}
Different theme engines can provide additional customizations.

Related

How to disable highlight active line in codemirror when editor is not selected?

I only want to have active line on when the current code editor is selected. How would I set this on editor initialisation?
Use .CodeMirror-focused class, so that the line is only styled when the cursor is focused within the editor. Then make the normal .CodeMirror-activeline-background transparent so that when the cursor is not focused within the editor, it will not be styled.
.CodeMirror-activeline-background {
background: transparent !important;
}
.CodeMirror-focused .CodeMirror-activeline-background {
background: rgba(100, 100, 100, 0.1) !important;
}

How do I change the color and width of material drawer component in angular-dart in css?

My first question ever - so apologies if I am not specific enough.
How do I change the color and width of material drawer component in angular-dart in css? I have tried it several ways in the CSS, including as below:
::ng-deep material-drawer {
color: #9437FF;
width: 200px;
}
.material-drawer {
color: #9437FF;
width: 200px;
}
FYI, the following worked with the material-header, which is inside a header tag:
::ng-deep header.material-header.material-header {
background-color: white;
color: #9437FF;
}
My material-drawer is not in a div or anything, just directly an HTML element on its own.
Any pointers are appreciated!
Setting the width of the drawer is a bit complicated. It involves setting a good amount of values as such it is best to use the mixin. You can see an example here
As for the color that is a little bit harder. What color are you trying to change? The background color?
For the background color you can set the background-color on the drawer. The problem is going to be that the content itself is going to override that color. In this case the material-list has it's own white color associated with it. Removing that color you could have problems with the divider colors.

Ag-grid RowStyle with selected row

I am using ag-grid 5.1.2
I've configured a getRowStyle function to set the background-color for certain items.
I've noticed that has overridden the 'selected row' color now, so when a row is selected the background will not change to indicate as such.What is the correct way to still let highlighted row color work with the custom getRowStyle. Here is the typescript for the rowStyle function:
self.customRowStyle = function (params: AgParams) {
if (!params.data.isShaded) {
return {
"background-color": "#CEDDDD",
};
}
return null;
};
In your CSSyou can choose not to target the selected row.
ag-Grid adds the class onto the row that is returned from your getRowStyle callback
It also adds .ag-row-selected for rows that get selected.
You can simply use CSS to only target not selected rows or even apply a different style to the rows that are both selected and have your custom class.
Here is an example:
CSS
.bg-red.ag-row:not(.ag-row-selected) {
background-color: red ;
}
OR different style for both selected and bg-red
.bg-red.ag-row {
background-color: red;
}
.bg-red.ag-row.ag-row-selected {
background-color: pink;
}
JS
rowClassRules: {
'bg-red': () => {
return true; // applies class bg-red to all rows
},
},
Here is a live running code example of this in action.
Also here is another live example that overrides row styles on click of a button, but this doesn't involve styling callbacks:
Is this what you are looking for?
Use the getRowClass gridOption instead of getRowStyle. Then in CSS set the appropriate styles for your background row and the brackground row when highlighted.

Can't set CSS to specified widget in GTK+

I'm using Vala with GTK+ and now I'm trying to add custom CSS to specified widget.
I can add fe. backgroudn to GtkWidget but not for #sidebar
#sidebar { //It doesn't work
color: white;
}
GtkWindow { // It works
background-color: red;
}
I'm adding class to widget like that:
sidebar = new Gtk.Label("Hello");
sidebar.set_name("sidebar");
And it's changes color to GtkWindow, but not for this label.
Any ideas?
I haven't programmed in Vala, but you should add class to StyleContext.
This is in C
sidebar = gtk_label_new ("Hello');
gtk_style_context_add_class ( gtk_widget_get_style_context ("mysidebar"), sidebar);
Also, style "sidebar", is already defined in GtkStyle. You should change the "sidebar" in CSS into something else (sidebar is used by views, toolbar etc)
But if you persist, the syntax should be:
.mysidebar {
#anything
}

GWT: how to change celltable alternate row background colors

I am trying to change my celltable alternate rows background colors.
by default they have white and lite blue color .. is there a possibility i can change these colors to lets say white and red..
attached is the screenshot .. you can see a white and blue color rows .. if there is a solution to change these colors.
I am aboe to change color , but it looks like it is changin each cell color and not the complete background , see the attached image , any way i can avoid these white spaces.
this is my css
.cellTableEvenRow {
}
.cellTableOddRow {
background: powderblue !important;
}
.cellTableEvenRowCell {
}
.cellTableOddRowCell {
}
thanks
You have to provide a custom CellTable.Resources instance.
To do that you have to create sub-interfaces of CellTable.Resources and CellTable.Style. In the your custom CellTable.Resources you can add your own CSS file in addition to the default style:
public interface CustomResources extends CellTable.Resources {
#Source({Style.DEFAULT_CSS, "CustomCellTable.css"})
Style cellTableStyle();
}
public interface CustomStyle extends CellTable.Style {
}
Now you can specify your custom style in the CustomCellTable.css:
.cellTableEvenRow {
background: white;
}
.cellTableOddRow {
background: red;
}
To create an instance of your custom CellTable.Resources simply call:
CellTable.Resources res = GWT.create(CustomResources.class)
Now you can give that instance to the CellTable instance using its constructor:
CellTable cellTable=new CellTable(15, res);
15 is the default page but can be changed. CellTable has no constructor with only the resources as parameter. At least the page size has to be specified.