I have a black line under my tab pane. The line is always there and goes from the most left pixel of the first tab a few pixels to the right of the last tab.
I've tried so many CSS selectors now and went through all of the listed selectors in the JavaFX 8 Oracle documentation and I have no idea what causes the black line to be there. I've not seen it ony the many other examples regarding the tab pane here.
It is always there, even when I remove all of my prior styling.
How can I remove it?
I've looked into the default caspian.css file embedded into the jfxrt.jar.
This is defined there for the headers-region class:
.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
-fx-border-style: segments(0.166667em, 0.166667em);
-fx-border-width: 1;
-fx-border-color: -fx-focus-color;
}
It can be overriden by using:
.tab-header-area > .headers-region {
-fx-border-width: 0;
Results in:
Related
I have a TableView and trying to fix the cell height through CSS. The following works from java:
myTable.setFixedCellSize(80);
But if I comment that out and rely on the following CSS it doesn't work.
#viewtable .table-row-cell {
-fx-text-background-color: #7f7f7f;
-fx-fixed-cell-size: 80px;
}
The id is set to viewtable, I've already confirmed I'm targeting the proper element as the text color takes affect. And using -fx-cell-size also works fine.
I'm launching this through eclipse and tried running from different environments from javase-1.8 up to 16. The javafx sdk is 17.0.0.1
The fixedCellSize property is part of the TableView class, not the TableRow class. This:
#viewtable .table-row-cell {
-fx-text-background-color: #7f7f7f;
-fx-fixed-cell-size: 80px;
}
Is applying the styles to any TableRow (at least by default) which is a descendent of the node with an ID of #viewtable.
Try the following:
#viewtable {
-fx-fixed-cell-size: 80px;
}
#viewtable .table-row-cell {
-fx-text-background-color: #7f7f7f;
}
On GluonMobile is there a way to have the CSS when a Item is selected in the drawer?
My application will have a lot of menu so I want to be able to see rapidly on wish one we are.
I manage to get the Item color, the Hover color but not the selected.
.navigation-drawer{
-fx-background-color: -primary-swatch-500;
}
.item {
-fx-background-color: -primary-swatch-300;
}
.item > .item-content:hover{
-fx-background-color: black;
}
I try all these thing
.item:selected
.item > .item-content:selected
.item:focused
.item > .item-content:focused
But nothing work.
So first can someone explain me why I need to do
.item > .item-content:hover and why not just .item:hover like in any other CSS ive done before.
Second I find it really hard to work with GluonMobile do to the lack of documentation IMO.
Maybee I dnt find the write documentation yet but the fact that I needed to do a printLn to find the styleSheet of a Node for me I find it weird.
The JavaDoc for Gluon Mobile controls, like the NavigationDrawer.Item is here.
However, you won't find the style classes applied to these controls, as you won't find it either in the JavaFX built-in controls javadoc.
Whenever you have issues with finding out the right style classes and pseudoclasses I'd strongly suggest you use ScenicView.
Find the distribution for Java 8, and run it:
java -jar scenicView.jar
while you also run your Gluon Mobile project on desktop:
./gradlew run
For instance, when you open the drawer of a default Glisten-Afterburner template project, you can see:
The node with item style class is a ViewItem, and it gets the selected and hover states.
The node with item-content is an HBox, child of ViewItem, and while it gets hover, it doesn't get selected:
Following the hierarchy of nodes you can also create the hierarchy of style classes, like:
.navigation-drawer > * > .scroll-pane > .viewport > * > .container > .item > .item-container
So for each item in the drawer, the different states can be:
.item:hover {}
.item:selected {}
.item:selected:hover {}
or for the content node:
.item:selected > .item-content {}
.item:selected:hover > .item-content {}
...
In your case, you could just apply something like:
.item {
-fx-background-color: -primary-swatch-300;
}
.item > .item-content:hover {
-fx-background-color: black;
}
.item:selected > .item-content {
-fx-background-color: green;
}
.item:selected:hover > .item-content {
-fx-background-color: lightgreen;
}
to get something like:
I am using react-bootstrap, specifically Tabs and Tab. Tab has a built-in attribute tabClassName that takes a string. The instructions for usage are "tabClassName is used as className for the associated NavItem".
So I set <Tab tabClassName="main-tab">.
My goal is to remove the blue outline that appears when the tab is focused on. However, the following CSS does nothing.
.main-tab, .main-tab:active, .main-tab:focus {
outline: none !important;
}
Here is the site inspection:
How do I get rid of the blue focus outline?
I found the solution:
the following CSS works:
.main-tab > a,
.main-tab > a:focus {
outline: none;
}
I'm using atom editor version 1.0 stable in ubuntu 14.04.
my question is,
How can I change the background colour of currently selected window tab...
(means current tab..)
by editing style.less file?
I tried,
.tab{ background-color:black; }
to change the tab color,
but,
this code only changed all tab colors except current tab color.
So my question is, how can I change the color of current tab in atom editor by editing style.less file?
.tab-bar .tab[data-type="TextEditor"]::after {
background-color: rgba(20,28,30,0.8);
}
I found this solution by opening developer tools Ctrl+Shift+I, and finding an element by using magnifier tool.
None of these worked for me. Here was my solution (Atom 1.22.1):
.tab-bar .tab.active[data-type$="Editor"] {
background-color: #167373;
}
You have to copy this code and paste in your styles.less file, that's it.
//My awesome tab
.tab-bar .tab.active[data-type="TextEditor"]::after {
background-color: black;
border-bottom: whiTe;
}
.tab-bar .tab.active[data-type$="Editor"] .title {
background-color: black;
z-index: 2;
}
Often I like to open multiple panes and have tabs in all of them. With multiple panes comes multiple active tabs. The other answers here will style the "active" tab in all panes, and not specifically target the tab you have selected.
The problem is selector specificity.
Here's one way to specifically target only the tab you have selected, no matter how many panes you have open:
Open your Atom command palette (on a MAC shift+cmd+p) and search for 'style'.
Select the option for 'Application: Open Your Stylesheet'.
Add this style:
.pane.active {
.tab.active {
background-color: #00BCD4;
}
}
Save the style.less sheet and see your changes!
Note: This was tested while using the Atom Material UI theme, though it shouldn't matter which theme you're using.
that's my solution for atom 1.23.1
File > Stylesheed > styles.less
.texteditor.tab.sortable.active::before, .texteditor.tab.sortable.active, .texteditor.tab.sortable.active::after {
background-image: -webkit-linear-gradient(top, #35404a, #4A7FB2);
}
a beautiful blue gradient.
On selection of tab add a class="tab active"
and below style to your style.less file
.tab.active {
background-color:black;
}
Extending this for other tab types (e.g. settings, git, search results), I'm currently enjoying:
// mine tab color customizations:
.tab-bar .tab.active {
background-color: #00593c;
}
.tab-bar .tab.active[data-type$="Editor"] {
background-color: #103a3a;
}
at style.less file
I'm trying to customize a combo box in JavaFX through css. I can't customize the "arrow button" on the right (I want it to disappear, or to have a custom graphic, for example).
I have been checking the default caspian.css, but no matter what modifications I do to the .combo-box section, the arrow button is not affected.
Any idea of where this can be edited?
Using the following CSS in the style sheet will get rid of all of the ComboBox arrows
.combo-box .arrow, .combo-box .arrow-button{
-fx-background-color: transparent;
}
Use the CSS Analyser option in Scenebuilder to get the CSS of any node that you want to play with
After that just select any node and you'll see all the classes which you can modify using CSS.
Now that I know the class I can make my changes accordingly in my CSS file
.combo-box{
-fx-border-color:#E6E6E6;
-fx-border-style:solid;
-fx-border-width:1;
}
.combo-box .arrow{
-fx-background-color:#2478E9;
}
.combo-box .arrow-button{
-fx-background-color:white;
-fx-border-style:none;
}
.combo-box .arrow-button{
-fx-background-color:white;
}
.combo-box .list-cell{
-fx-background-color:white;
}
Which gives me an end result like this.
For more advanced analysis of CSS and other Events occurring when the application is running, you can try Scenic View.
I wanted it to disappear too. But nothing worked for me on javafx 8 until I tried the following:
css:.combo-box.REFERENCEDONLY .arrow-button {
-fx-padding: 0 0 0 -7;
}
basically it says: use negative padding on the arrow-button's left side to effectively shrink it.
javafx code:myCombobox.getStyleClass().add("REFERENCEDONLY");