Results 1 to 9 of 9

Thread: [20.04] Konsole: How to just use Qt theme for scrollbars?

  1. #1
    Join Date
    Jun 2016
    Beans
    2,831
    Distro
    Xubuntu

    [20.04] Konsole: How to just use Qt theme for scrollbars?

    In 18.04, Konsole scrollbar was styled according to Qt theme. In 20.04, it seems to be styled partially based on the default background and foreground colors of the current Konsole terminal color scheme?

    I liked it better when the Qt theme was totally in charge of styling Konsole's scrollbars. This suggests that KDE devs wanted the color scheme to control the colors of the scrollbar. But I can't find the option?

    How to configure my Konsole color scheme to just use Qt theme for scrollbars?
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    When your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: [20.04] Konsole: How to just use Qt theme for scrollbars?

    I could change the scrollbar in Konsole by changing themes in System Settings > Application Style. Don't know if that helps with your request. It might be too blunt an instrument.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Jun 2016
    Beans
    2,831
    Distro
    Xubuntu

    Re: [20.04] Konsole: How to just use Qt theme for scrollbars?

    Quote Originally Posted by SeijiSensei View Post
    I could change the scrollbar in Konsole by changing themes in System Settings > Application Style.
    That's KDE System Settings, right? I use Xubuntu (with qt5ct), what packages do I need to install to get this preference panel? I installed systemsettings, but looks like something else is needed too.
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    When your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  4. #4
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: [20.04] Konsole: How to just use Qt theme for scrollbars?

    I don't know. I've used Kubuntu since 8.04. I don't think it would be easy to implement this on another platform. The Plasma workspace in KDE is pretty elaborate.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Jun 2016
    Beans
    2,831
    Distro
    Xubuntu

    Re: [20.04] Konsole: How to just use Qt theme for scrollbars?

    I figured out how to get that systemsettings panel, but it didn't produce the desired effect.

    Now I'm looking into compiling Konsole from source for other reasons, and decided to revisit this while I'm at it. In the version I'm trying to compile, I don't see any path in the code that could skip the scrollbar restyling. I tested and I can just remove that code and get the effect I want, but I think this minor detail is not worth the maintenance burden.
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    When your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  6. #6
    Join Date
    Jan 2017
    Beans
    235

    Re: [20.04] Konsole: How to just use Qt theme for scrollbars?

    Don't know if this will help or not but you can style Konsole using style sheets.

    For example to change the color of the scrollbar handle you would use the following:
    Code:
    QScrollBar:vertical::handle {
        color : red;
    }
    I tested this by putting the .css file in ~/.kde/share/config and then pointed at it in Konsole by checking the "Use user-defined stylesheet:" box under Settings->Configure Konsole->Tab Bar/Splitters->Miscellaneous

    Qt has extensive documentation on how to use stylesheets here: https://doc.qt.io/qt-5/stylesheet-reference.html

    If you change themes often you would need a css file for each theme and then change the Konsole settings.

  7. #7
    Join Date
    Jun 2016
    Beans
    2,831
    Distro
    Xubuntu

    Re: [20.04] Konsole: How to just use Qt theme for scrollbars?

    Quote Originally Posted by norobro View Post
    you can style Konsole using style sheets.

    For example to change the color of the scrollbar handle you would use the following:
    Code:
    QScrollBar:vertical::handle {
        color : red;
    }
    I tested this by putting the .css file in ~/.kde/share/config and then pointed at it in Konsole by checking the "Use user-defined stylesheet:" box under Settings->Configure Konsole->Tab Bar/Splitters->Miscellaneous

    Qt has extensive documentation on how to use stylesheets here: https://doc.qt.io/qt-5/stylesheet-reference.html
    Thanks for the tip norobro! Interesting, I'm using Oxygen qt5 theme and this just turned the scroll arrows red??
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    When your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  8. #8
    Join Date
    Jan 2017
    Beans
    235

    Re: [20.04] Konsole: How to just use Qt theme for scrollbars?

    Hi halogen2.

    The only system that I have with KDE5 is Debian Sid but I don't think that would make a difference. My only experience using stylesheets with Qt is when programming in C++.

    This pic is the result after copying the css for the vertical scrollbar from here: https://doc.qt.io/qt-5/stylesheet-ex...ing-qscrollbar
    Code:
    QScrollBar:vertical {
         border: 2px solid grey;
         background: #32CC99;
         width: 15px;
         margin: 22px 0 22px 0;
     }
     QScrollBar::handle:vertical {
         background: white;
         min-height: 20px;
     }
     QScrollBar::add-line:vertical {
         border: 2px solid grey;
         background: #32CC99;
         height: 20px;
         subcontrol-position: bottom;
         subcontrol-origin: margin;
     }
    
    
     QScrollBar::sub-line:vertical {
         border: 2px solid grey;
         background: #32CC99;
         height: 20px;
         subcontrol-position: top;
         subcontrol-origin: margin;
     }
     QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {
         border: 2px solid grey;
         width: 3px;
         height: 3px;
         background: white;
     }
    
    
     QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
         background: none;
     }
    Maybe the note applies in this case:
    Note that if one property or sub-control is customized, all the other properties or sub-controls must be customized as well.
    konsole.jpg

  9. #9
    Join Date
    Jun 2016
    Beans
    2,831
    Distro
    Xubuntu

    Re: [20.04] Konsole: How to just use Qt theme for scrollbars?

    Ah, it's that your CSS sets color whereas that Qt example CSS sets background .

    For some CSS properties of the scrollbar, setting them in the stylesheet seems to completely remove all Oxygen styling for the scrollbar, so unfortunately this can't do what I was looking for here. But I still appreciate the tip about stylesheets though!
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    When your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •