Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-29-2024, 10:47 AM   #1
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,611
Karma: 7891011
Join Date: Sep 2020
Device: none
QScrollBar handle

Hello Kovid,

I remember you're not much a fan of adding CSS/QSS in the code, because it tends to break things.

Today I went to update Xnview, which is also a Qt-based program, then I found it has an option to skin the scrollbar handle, as shown in the screenshot for a test I did:

Click image for larger version

Name:	QScrollBar handle.png
Views:	87
Size:	619.1 KB
ID:	211734

So I wonder: since Qt has been updated in recent Calibre versions, would it be possible now to change the scrollbar handle color?

This is the relevant code in that screencap:

PHP Code:
QScrollBar::handle{
    
background-colorrgb(1764949);
    
border1px solid yellow;
}

QScrollBar::handle:horizontal{
    
min-width20px;
}

QScrollBar::handle:vertical{
    
min-height20px;
}

QScrollBar::handle:hover {
    
background-colorrgb(130130130);
}

QScrollBar::handle:pressed {
    
background-colorrgb(180180180);


Their complete QSS is below:

Spoiler:
QScrollBar{
background-color: rgb(40, 40, 40);
}

QScrollBar::add-page, QScrollBar::sub-page {
background: none;
}

QScrollBar::horizontal{
border: 1px solid rgb(90, 90, 90);
border-left: 0px solid red;
border-right: 0px solid red;

margin: 0px 16px 0px 16px;
}

QScrollBar::vertical {
border: 1px solid rgb(90, 90, 90);
border-top: 0px solid red;
border-bottom: 0px solid red;

margin: 16px 0px 16px 0px;
}

QScrollBar::handle{
background-color: rgb(176, 49, 49);
border: 1px solid yellow;
}

QScrollBar::handle:horizontal{
min-width: 20px;
}

QScrollBar::handle:vertical{
min-height: 20px;
}

QScrollBar::handle:hover {
background-color: rgb(130, 130, 130);
}

QScrollBar::handle:pressed {
background-color: rgb(180, 180, 180);
}

QScrollBar::add-line:horizontal {
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgb(60, 60, 60), stop:1 rgb(90, 90, 90));
border: 1px solid rgb(90, 90, 90);
border-left:0px;

width: 15px;
subcontrol-position: right;
subcontrol-origin: margin;
}

QScrollBar::sub-line:horizontal{
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgb(90, 90, 90), stop:1 rgb(60, 60, 60));
border: 1px solid rgb(90, 90, 90);
border-right:0px;

width: 15px;
subcontrol-position: left;
subcontrol-origin: margin;
}

QScrollBar::add-line:horizontal:hover{
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgb(100, 100, 100), stop:1 rgb(150, 150, 150));
}

QScrollBar::sub-line:horizontal:hover{
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgb(150, 150, 150), stop:1 rgb(100, 100, 100));
}

QScrollBar::add-line:horizontal:pressed{
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgb(130, 130, 130), stop:1 rgb(180, 180, 180));
}

QScrollBar::sub-line:horizontal:pressed{
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgb(180, 180, 180), stop:1 rgb(130, 130, 130));
}

QScrollBar::add-line:vertical {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(60, 60, 60), stop:1 rgb(90, 90, 90));
border: 1px solid rgb(90, 90, 90);
border-top:0px;

height: 15px;
subcontrol-position: bottom;
subcontrol-origin: margin;
}

QScrollBar::sub-line:vertical{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(90, 90, 90), stop:1 rgb(60, 60, 60));
border: 1px solid rgb(90, 90, 90);
border-bottom:0px;

height: 15px;
subcontrol-position: top;
subcontrol-origin: margin;
}

QScrollBar::add-line:vertical:hover{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(100, 100, 100), stop:1 rgb(150, 150, 150));
}

QScrollBar::sub-line:vertical:hover{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(150, 150, 150), stop:1 rgb(100, 100, 100));
}

QScrollBar::add-line:vertical:pressed{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(130, 130, 130), stop:1 rgb(180, 180, 180));
}

QScrollBar::sub-line:vertical:pressed{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(180, 180, 180), stop:1 rgb(130, 130, 130));
}

QScrollBar::left-arrow:horizontal{
background-image: url("UI:arrow_left_V2.png");
background-position: center;
}

QScrollBar::right-arrow{
background-image: url("UI:arrow_right_V2.png");
background-position: center;
}

QScrollBar::up-arrow:vertical{
background-image: url("UI:arrow_up_V2.png");
background-position: center;
}

QScrollBar::down-arrow:vertical{
background-image: url("UI:arrow_down_V2.png");
background-position: center;
}
Comfy.n is offline   Reply With Quote
Old 10-29-2024, 10:48 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'm afraid I am still not a fan of themeing Qt via stylesheets.
kovidgoyal is offline   Reply With Quote
Advert
Old 10-29-2024, 10:51 AM   #3
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,611
Karma: 7891011
Join Date: Sep 2020
Device: none
Oh well.
Comfy.n is offline   Reply With Quote
Old 10-29-2024, 11:31 AM   #4
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
I find the calibre scrollbar really difficult to see in dark mode. Both viewer and editor preview windows have great scrollbars, with great contrast. IRC, @Kovid said that they were generated by QtWebengine.

Maybe just the scrollbars in dark mode could be changed. It's really hard to see.
thiago.eec is offline   Reply With Quote
Old 10-30-2024, 01:58 PM   #5
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 195
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
Originally Posted by thiago.eec View Post
I find the calibre scrollbar really difficult to see in dark mode.
If you find the scrollbars merely really difficult to see in dark mode, then your eyes are better than mine. Black on black it is.
Brett Merkey is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How handle different covers? Paula-59 Conversion 0 03-11-2016 12:57 PM
new here, handle with care kiloJoe Introduce Yourself 3 07-04-2013 10:03 AM
How would you handle this issue? AnemicOak Library Management 12 04-13-2013 09:31 AM
How Do You Handle Stress?? desertgrandma Lounge 219 10-29-2010 10:31 AM
Kindle DX handle ? nimblem Amazon Kindle 0 08-14-2010 03:17 PM


All times are GMT -4. The time now is 02:35 PM.


MobileRead.com is a privately owned, operated and funded community.