I have a qtreewidget in my application. I have set the stylesheet like below for it.
setFrameShape(QFrame::NoFrame);
setStyleSheet("QTreeView { border: none; background: transparent; outline:none; }" "QTreeView::item:!selected:hover { border: 1px solid #AAAAAA}" "QTreeView::item:selected { border: 1px solid #0053A6}");
Now the problem is that there is no border around qtreewidget which is correct behaviour but when I click on any item of this widget a black border appears around the widget. Although I have mentioned the border for this widget to none then why it is appearing on clicking any item.
This is a focus rectangle. To completely disable it:
setFocusPolicy(Qt::NoFocus)
Related
So I'm using ant.design to create my navbar. Initially, ant's menu items have a underline when either selected or hovered upon (this underline is a blue-ish border-bottom). I now want to change this underline's color to suit the rest of my design. I managed to change the bar's color when selected by targeting a specific class like this:
&& .ant-menu-item-selected::after{
border-bottom: 2px solid #659e38 !important;
}
However, I want the color changed also when hovered upon, but when I target the menu item like this:
&& .ant-menu-item:hover{
border-bottom: 2px solid #659e38 !important;
}
I get a undesired result of:
How can I get what I want? Note that I'm using styled.components for styling.
The solution was to change:
&& .ant-menu-item:hover{
border-bottom: 2px solid #659e38 !important;
}
to:
&& .ant-menu-item:hover::after{
border-bottom: 2px solid #659e38 !important;
}
this is (I believe) due to bar's being created as a pseudoelement by ant.d.
If you click on that image (which is inside a button) an Alertify message pops up. This (the image above) happens when the message closes.
I have this problem wherein the button defaults back to the default button decoration. How do I prevent this from happening? I already tried the outline: none !important CSS element but it still does not work. Is there an "aggressive" way of getting rid of this?
EDIT: I have double-checked on the developer tools already and it seems that the outline CSS code has already applied. However, this problem still persist.
If you are trying to remove the background blue and the border. Try the following styles..
These will add a 1px wide transparent border which will change color to grey when clicked. It will turn back to transparent when click is released.
Also the background blue color will be removed.
button, button:focus{
outline: none;
background: transparent;
border: 1px solid transparent;
}
button:active{
outline: none;
background: transparent;
border: 1px solid grey;
}
I am working on a website where a user can select an icon and send it as a request to one of my bots.
I've already got it sorted out. I'm mainly just working on improving the aesthetics.
What I want to happen is, when hovering over an icon (or even selecting it), it shows a light blue background colour to indicate that it's been selected, because right now there is nothing to indicate a chosen icon except for the div at the very top (which isn't always in sight when you scroll further down).
The code I have atm is:
.flair:hover, .selected{
background-color: #3498db;
border-radius: 2px;
}
I've tried adding some padding but since each image is in a spritesheet, it will overlap with other images.
I've also tried using a border instead to emulate the same effect, but hovering over an image would slightly move the other images due to the border being applied and it gets annoying.
Is there some way I can get my background-color to 'overflow' behind the images?
How about you add a transparent border add the begining as a placeholder and change your margins since borders gonna add some space
.flair {
border: 2px solid transparent;
background-clip : padding-box;
margin-right:6px;
margin-top:6px;
}
and then you color it with some additional glow when hovering
.flair:hover {
box-shadow: 0 0 10px #3498db;
border: 2px solid #3498db;
}
Please try this :
.flair:hover, .selected {
border: 1px solid #3498db;
border-radius: 2px;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
How to tune QLineEdit view to:
show as label with transparent background for displaying mode.
show as common QLineEdit widget when user clicks on it to editing.
Use this css to apply QLabel-like style when it is not in edit mode:
QLineEdit:!focus
{
border: 1px solid transparent;
background: transparent;
}
QLineEdit:focus
{
background: white;
}
I would like to "graphically disable" a combobox in extjs by appling a CSS class to remove the borders while the user does not click on it.
How can I apply this CSS class? It is not the border of the field but of a wrapper which wrap both field and picker.
(I have the same problem for datefield)
Ext applies special CSS classes when fields are focused, so that's rahter easy to do focus-dependent styling. Use dev tools to explore the markup and see what you need to change.
For example, for removing all visual clues that it is a field from a combo that is not focused, use this CSS (example fiddle):
.custom-combo .x-form-field:not(.x-field-form-focus) {
border: 1px solid transparent;
background: none;
}
.custom-combo .x-form-item-body:not(.x-form-trigger-wrap-focus) .x-form-trigger {
background: none;
border-bottom: 1px solid transparent;
}
I use border: 1px solid transparent instead of border: 0 to prevent a 1px offset when the combo get focused.