Remove or change colour of window border?

Asked by Luke Thorburn

I have modified the background colour of my installation to be a very dark blue, but there is still a border around the window (and the background of the tabs) that is white or light gray, which I find quite distracting. An example screenshot is at the following link:

https://i.imgur.com/VZEr8ma.png

Is there a way to remove the border (excl. the tabs), or to change it to be the same colour as the user-specified background colour, or even just have a 'dark mode' so that it is black and blends into the background?

Thanks, Luke

Question information

Language:
English Edit question
Status:
Answered
For:
qpdfview Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Adam Reichold (adamreichold) said :
#1

Hello Luke,

I think the only way to modify qpdfview's presentation short of changing code is using Qt style sheets [1], e.g. by changing the hidden "styleSheet" setting in section "mainWindow" as described in the man page.

Best regards,
Adam

[1] https://doc.qt.io/qt-5/stylesheet.html

Revision history for this message
Luke Thorburn (lukethorburn) said :
#2

Okay, thank you!

Revision history for this message
Luke Thorburn (lukethorburn) said :
#3

Hi Adam,

Could you please briefly explain (or point me to a resource that does explain) how to make use of the style sheets? I know CSS inside-out so have that intuition, but am having trouble getting the Qt stylesheet hooked up, and I can't find answers in the Qt documentation. Specifically, 3 sticking points:

1. What file extension does a Qt stylesheet take? I tried '.qt' but it seems that's for QuickTime videos.

2. What syntax do I use to link to the stylesheet in qpdfview.conf? I've tried just adding a row with 'styleSheet="style.qt"' (and with a .txt extension) but neither seem to work.

3. How can I work out which visual components of the pdfview GUI correspond to which Qt modules?

Thanks in advance, and apologies for the probably very-basic questions.

Luke

Revision history for this message
Adam Reichold (adamreichold) said :
#4

Hello Luke,

ad 1.: The idea is to put the style sheet itself into the configuration file as a string, not as a file path that is loaded by the application. (QSettings which reads that configuration file does support multiline string literals.)

ad 2.: You find the section called "[mainWindow]" in qpdfview.conf and add a key with an inline style sheet "styleSheet = "QMainWindow {...}" directly there.

ad 3.: I guess from the source code is actually the easiest option. But if you want to inspect the UI elements at the runtime, I only know KDAB's GammaRay tool: https://doc.qt.io/GammaRay/index.html

Best regards,
Adam.

Revision history for this message
Adam Reichold (adamreichold) said :
#5

> Thanks in advance, and apologies for the probably very-basic questions.

Please feel free to ask whatever you want to know. The worst thing that can happen is that I don't find the time to answer...

Revision history for this message
Arash Sal Moslehian (arashsm79) said :
#6

I managed to solve this problem by adding the following line of code to the "[mainWindow]" section of ~/.config/qpdfview/qpdfview.conf

styleSheet="QScrollBar, QScrollBar::handle {background: #1c1c1c; border-style: none;} QFrame { border-style: none;}"

Changing the border of QFrame somehow completely messes up the background of ScrollBar and its handle, so I had to manually change them as well. (put whatever color you want instead of "#1c1c1c")

Can you help with this problem?

Provide an answer of your own, or ask Luke Thorburn for more information if necessary.

To post a message you must log in.