I want to make a very basic GUI: tabs, text area.
But I want to color my tabs and make them always looking the same on MAC, Windows and Linux.
So, I tryed to use a stylesheet:
QTabWidget::pane
{
border-top: 2px solid #1B1B1B;
background-color: #262626;
}
QTabWidget::tab-bar
{
left: 5px;
alignment: left;
background: #3E3E3E;
}
QTabBar::tab
{
background: transparent;
color: #757575;
padding: 15px 5px 15px 5px;
}
QTabBar::tab:hover
{
text-decoration: underline;
}
QTabBar::tab:selected
{
color: #DEF600;
background: qlineargradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #262626, stop: 1.0 #3D3D3D );
}
But even if the tabs looks well, there is a problem: The tab pane is still transparent...
I can force a background color by adding:
QWidget
{
background-color: #262626;
}
But as you know, this change the background color of ALL the widgets, even my QPlainTextEdit that I still want to have a white background. And more annoying, this reset the OS skin and display ugly scrollbars (I really want to keep them as they were).
Is there a way to change the tabs pane background without having to reskin all the components ?
I had the same problem. I could get it to work with this:
QTabWidget::pane > QWidget {
background-color: #262626;
}
Try this.
QTabWidget::pane {
background: red;
}
You can read this for details. And one more thing to comment. You can use QObject::objectName() as style sheet's id selector. for example,
QTabWidget#myTab { ... }
hope this helps.
It is possible simply by:
* {background: green;}
This style set background for this widget and all their childs so you need to know one important thing. The area you think is QTabWidget in fact is QWidget which is set inside of QTabWidget. You can easly check where QTabWidget is and where is their child by adding to your style
QTabWidget::pane {background: green; padding: 10px;}
green area is a QTabWidget, all inside is overlapped by QTabWidgets child (any QWidget added by addTab() function).
add style
"background-color:rgb(255,255,255)"
to each tab.
Refer this:
http://doc.qt.digia.com/qt/stylesheet-syntax.html
Read ID Selector under Selector Types. You can instruct a certain style to be applied only for a given object name. So you can use whatever the name you have given to your tabWidget.
Try enabling document mode with
myTab->setDocumentMode(true);
This has worked for me when everything else has failed. You can do it in code, or by twiddling the property in qtcreator.
You still might have to apply some styles to the pane like so:
QTabWidget:pane{
background: red;
}
Read more about this in the documentation.
Related
I want to modify the color and the border in a Bootstrap nav bar but when I write this on my SCSS nothing happens:
.nav-link.active {
color: #495057;
background-color: chartreuse;
border-color: black;
}
When I inspect the element in Chrome my code is dismissed, It only takes into account the Bootstrap default style.
Image
Any help will be welcomed.
Thanks.
For a CSS rule to be overriden, you have a lot of options. The cleanest would be to be more specific (by at least one rule) than the one you want to override.
If I follow your example:
.nav-tabs li.nav-link.active {
color: #495057;
background-color: chartreuse;
border-color: black;
}
You'll find more informations here : https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
I have been asked to theme my APEX 19.2 app and the designer has come back with a fairly simple ask. The top left hamburger be white and purple like below:
I am using the theme roller to apply the settings and can't seem to get the active and inactive state to stay white and purple.
I have even tried my own CSS in the theme roller like below but only with limited success.
Any ideas how I can achieve this?
CSS I am currently trying
t-Button--icon {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
t-Button--header {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
t-Button--headerTree {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
t-Header-controls {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
is-active {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
NavigationBar {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
Even with all of this my button active and hover still looks like this:
I feel like I am close but after several hours of fiddling, I thought it was about time I consult the collective experts. Any help and advice would be greatly appreciated. If you can't already tell I am still learning CSS.
You ought to use the CSS :hover selector which is used to select elements when one mouses over them.
Assuming the hamburguer menu has a class named burguer
.burguer:hover {
color: #393093;
background: #ffffff;
border-color: #393093;
}
Then change the hover and active effects :)
.burguer:hover {}
.burguer:active {}
It might be worth checking if Apex does not use a selector that has "higher ponctuation" than something so simple. In such case, you might want to create a composite selector
button.t-Button--header .burguer:hover{}
Good Luck
I am styling some popups for a map displayed through Mapbox using Mapbox's GL JS. However, I cannot find in their documentation regarding the classes that are automatically assigned to the popups. Thus far, my CSS looks like this:
.mapboxgl-Popup-content {
color: #F3F3DD;
background-color: #91785D;
border-color: #91785D;
max-width: 250px;
box-shadow: 3px 3px 2px #8B5D33;
font-family: 'Oswald';
}
This yields these pretty little boxes:
My issue is the white triangle at the very bottom that points to the marker. I want to change its color.
I have tried a number of CSS classes to fix this. Including, but not limited to, .mapboxgl-popup, .mapboxgl-popup-anchor, .mapboxgl-popup-pointer, etc. I am not sure where to acquire the documentation I need to know what CSS class I should be using to change the color of this pesky triangle.
Here's what you need. It's not just one class because the tip can change position:
.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
border-bottom-color: #fff;
}
.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip {
border-top-color: #fff;
}
.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
border-right-color: #fff;
}
.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
border-left-color: #fff;
}
The CSS class that you need to update is ".mapboxgl-popup-tip". If there is no any class like that in your CSS file, just create it and give the color what you want to "border-top-color: " attribute.
I figured out why applying CSS doesn't affect the element (in this case, the tip).
I did some debugging in Chrome with Inspect Element.
It turns out my CSS was indeed being applied; however, it was being overridden from the MapBox stylesheet I applied in my index.html.
At first, I thought that maybe if I reordered my stylesheets I could have my stylesheet be invoked after the MapBox stylesheet, then I'd be fine.
This was not true.
Inspect element still showed my CSS was being overridden.
The solution was to add !important:
border-top-color: black !important;
This would override any previous styling done by MapBox.
For more info see:
What do the crossed style properties in Google Chrome devtools mean?
https://www.w3schools.com/css/css_important.asp
.mapboxgl-popup-anchor-bottom > .mapboxgl-popup-tip { border-top-color: #f15b28; }
i finally got it how this works. <Popup archor={'bottom'}, use .mapboxgl-popup-anchor-bottom plus .mapboxgl-popup-tip changing border color (top, bottom, left, right).
The TinyMCE 4 button for Remove Formatting is , which is certainly not intuitive to me. I'd like to make the button face something more obvious, like by, say assigning an image to it. But I'm not finding anywhere to change the button face. The markup assigned to the button is
.
I'm not sure how that gets that Tx symbol on the button, but there it is.
Thanks for any help.
In skin.min.css change
.mce-i-removeformat:before {
content: "\e01d";
}
to something like
.mce-i-removeformat:before {
background-image: url("http://i.stack.imgur.com/0rzf2.png");
background-size: 15px 15px;
background-repeat: no-repeat;
}
You can probably remove the background-size and background-repeat if you make your image the right size
If you don't want to edit the css directly, you could just make a new css file and load it after the default one to override the settings. If you did this, you would have to override the contents to remove the original icon
These icons come from the tinymce font. for me in the tinymce source i have the fonts at
tinymce/skins/lightgray/fonts/tinymce.woff|ttf|etc
If you added your own font file withyour own icon it should allow you to change the icon
If you inspect the css you'll notice there are two parts that control the icons being used
On the ::before inside the tag
.mce-i-italic:before {
content: "\e02b";
}
on the i tag itself
.mce-ico {
font-family: tinymce, Arial
}
both comefrom skin.min.css
What do you say that instead of new image you use :after pseudo element and remove :before one.
This is how it would look
https://jsfiddle.net/nj6yn4bq/4/
And the code
<button><i></i></button>
i:before { display: none; }
i:after {
content: 'FMT';
text-decoration: line-through;
font-style: initial;
font-size: 15px;
}
button {
background: linear-gradient(#FFF,#E0E0E0);
padding: 0.7em;
border: 1px solid #DEDEDE;
border-radius: 3px;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.22);
}
The new <p:ribbon> component in PrimeFaces 5.1 overrides the background attribute of spinner component buttons using the class .ui-ribbon .ui-button (ribbon.css), which makes the spinner look like this:
.ui-ribbon .ui-button {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
box-shadow: none;
color: #333;
}
When background rule is disabled in the browser, the spinner looks perfect
How can I write my CSS to make it ignore the background definition on .ui-ribbon .ui-button, so it can keep using the theme background definition?
You should try the following:
.ui-spinner.ui.ribbon .ui-button {
background: none!important;
}
OR if .ui-spinner is a container element:
.ui-spinner .ui-ribbon .ui-button {
background: none !important;
}
Basically, what this is saying is that when a spinner is also a ribbon, don't show a background on button even if it's already defined.
In the second case, it's saying when button is a child of ribbon which is also a child of spinner, then don't show a background even if it's already defined.
Edit:
Ah, so you're worried about overriding a previously applied background. Makes much more sense. In that case, change the above CSS to this:
.ui-spinner.ui.ribbon .ui-button {
background: inherit!important;
}
OR if .ui-spinner is a container element:
.ui-spinner .ui-ribbon .ui-button {
background: inherit!important;
}