Is there a way to change the height of the items of the drop down list of a QComboBox through the stylesheet? - qt5

I would like to have all the comboboxes of my application similar to the PyCharm ones. I was able to change the box itself but not the drop-down list.
Here's what I would like to have:
Here's what I have:
I would like to increase the height of the items, the space between them and to remove the dotted border when the mouse hovers the item. All of this using the stylesheet, since I want all QComboBox to be like this.
Here's my stylesheet:
QComboBox{
font-family: "Segoe UI";
font-size: 8pt;
border-radius: 3px;
border: 1px solid;
border-color: rgb(175, 175, 175);
padding: 3px;
padding-right: 8px;
padding-left: 8px;
background-color: white;
margin: 1px;
}
QComboBox:focus, QComboBox:on{
border-radius: 4px;
border: 3px solid rgb(151, 195, 243);
margin:0px;
}
QComboBox::drop-down{
border:none;
}
QComboBox::down-arrow{
right: 4px;
image: url(:/custom/custom_icons/down-arrow.png);
}
QComboBox QAbstractItemView{
border: 1px solid rgb(175, 175, 175);
}
QComboBox QAbstractItemView::item {
height: 50px; /*not working*/
}

Related

Power virtual agents UI Send box

Hi Currently my send message box appears like this
I want to integrate it within the chatbot
I have this styles added to the box
.style {
position: fixed;
right: 0px;
height: 85%;
bottom: 50px;
width: 30%;
margin-right: 16px;
margin-bottom: 18px;
border: 2px solid #053364;
z-index: 2;
border-radius: 25px 25px 25px 25px;
}

I created a input and i want to make the icon on the left of input bar and the text to the right of input bar, i tryed text-align in css doesnt work

HTML:
<input id="bill" placeholder="&#xf155">
CSS:
#bill {
display: block;
margin: auto;
position: relative;
top: 80px;
left: 35px;
display: inline-block;
border-radius: 3px;
padding: 4px;
width: 35%;
border: 2px solid rgb(13, 158, 143);
font-family: 'fontAwesome';
}
I want dollar sign on the left corner of input bar and text on the right corner of
input bar.

Change pseudo element color on selected state

I want to change arrow color as well as circle when click on it. I am using LESS and getting right place to add border-top-color: #0066ff; Can anyone suggest please? Here is code:
LESS:
.circle {
border-radius: 50%;
box-sizing: border-box;
width: 225px;
height:225px;
border: 6px solid #ff6600;
border-radius: 50%;
position: relative;
cursor:pointer;
&.selected {
border: 6px solid #0066ff;
}
&:after {
top: 104%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(136, 183, 213, 0);
border-top-color: #ff6600;
border-width: 10px;
margin-left: -10px;
transform: scaleY(1.6);
&.selected {
border-top-color: #0066ff;
}
}
}
HTML:
<div class="circle"></div>
JS:
$(document).ready(function(){
$('.circle').on('click', function(){
$(this).addClass('selected');
});
});
JS fiddle is here:
https://jsfiddle.net/kunjsharma/6eu431hp/1/
You need to put :after inside .selected: see this fiddle
.circle {
border-radius: 50%;
box-sizing: border-box;
width: 225px;
height:225px;
border: 6px solid #ff6600;
border-radius: 50%;
position: relative;
cursor:pointer;
&.selected {
border: 6px solid #0066ff;
&:after { // <-- moved this inside .selected
border-top-color: #0066ff;
}
}
// rest of the styles...
}

Increase width of first column in HTML/CSS table only

I have a basic table built from a table generator.
I need to increase the size of the first table column only. However the code below increases the first and fourth column.
CSS
table.paleBlueRows {
font-family: Arial, Helvetica, sans-serif;
border: 1px solid #FFFFFF;
width: 85%;
height: 200px;
text-align: center;
border-collapse: collapse;
}
table.paleBlueRows td, table.paleBlueRows th {
border: 1px solid #0B6FA4;
padding: 3px 2px;
}
table.paleBlueRows tbody td {
font-size: 13px;
}
table.paleBlueRows td:nth-child(even) {
background: #D0E4F5;
}
table.paleBlueRows thead {
background: #0B6FA4;
border-bottom: 3px solid #FFFFFF;
}
table.paleBlueRows thead th {
font-size: 17px;
font-weight: bold;
color: #FFFFFF;
text-align: center;
border-left: 2px solid #FFFFFF;
border-TOP: 2px solid #FFFFFF;
}
table.paleBlueRows thead th:first-child {
border-left: none;
width: 8em;
min-width: 8em;
max-width: 8em;
}
table.paleBlueRows tfoot td {
font-size: 14px;
}
The below code controls the column width
}
table.paleBlueRows thead th:first-child {
border-left: none;
width: 8em;
min-width: 8em;
max-width: 8em;
}
Can anyone assist with increasing the first column only?
Here is the CODEPEN
It is increasing the width of the 1st titled Package because you're using the CSS selector table.paleBlueRows thead th:first-child.
Although, the 4th column is also being affected because you have a rowspan and the column Each is also selected - it's the first column of the spanned row.
To fix this problem you can use the selector table.paleBlueRows td:first-child that affects only the 1st td element of your table row.
Replace:
table.paleBlueRows thead th:first-child {
border-left: none;
width: 8em;
min-width: 8em;
max-width: 8em;
}
With:
table.paleBlueRows td:first-child {
border-left: none;
width: 8em;
min-width: 8em;
max-width: 8em;
}
Please check my reviewed pen: https://codepen.io/Rechousa/pen/mXXPwW
What about just making those two changes:
Assign the #first id to your first row.
<th id="first" rowspan="2">Package</th>
Change the name of your table.paleBlueRows thead th:first-child to:
#first {
border-left: none;
width: 8em;
min-width: 8em;
max-width: 8em;
}

QSlider with a custom stylesheet to make pressed handle bigger

i want to make a material like slider. The slider handle should get bigger when pressed, but when I click on it, it makes this:
top: not clicked, bottom: klicked
And after I move the handle its getting bigger.
I'm using a stylesheet:
...
QSlider::handle:horizontal {
background: #009ceb;
width: 24px;
margin: -12px 0;
border-radius: 12px;
border-style: solid;
border-width: 1px;
border-color: #009ceb;
}
QSlider::handle:horizontal:pressed{
background: #009ceb;
width: 36px;
margin: -18px 0;
border-style: solid;
border-radius: 18px;
border-width: 1px;
}
...