LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-18-2020, 05:57 AM   #1
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 684

Rep: Reputation: 77
Scrollbars in current with GTK theme


I'm running current, ktown and multilib. Updated 2020-03-16.

I'm running with the Oxygen Theme in System Settings.

I'm running with the Tango Theme in LibreOffice.

I'm trying to see the up and down arrows on the Vertical Scrollbars

In Gnucash I initially see arrows at the top and bottom of the vertical scrollbar, Unfortunately the arrow at the top of the scrollbar is < and the arrow at the bottom of the scrollbar is >. They are only visible for as long as Gnucash's "Tip of the day" dialog is present. When the "Tip of the day" is closed the arrows disappear, leaving a block that blends in with the background.I can mouse click on this empty space and scrolling behaves as I would expect.

In Libreoffice I never see the arrows. All I get is the block where the arrow show be blending in with the background. I can mouse click on this empty space and scrolling behaves as I would expect.

I've got as far as creating a file .config/gtk-3.0/gtk.css

Code:
@import 'colors.css';

scrollbar {
  -GtkScrollbar-has-backward-stepper: true;
  -GtkScrollbar-has-forward-stepper: true;
}

scrollbar, scrollbar button, scrollbar slider {
   min-width: 24px;
   min-height: 24px;
Altering the min-width and min-height alters the width of the scrollbar and the width/height of the block where the arrows should go. This is most helpful as I can see that changing the contents of .config/gtk-3.0/gtk.css does change how the scrollbars are being presented.

I can change .config/gtk-3.0/gtk.css to remove the empty block where the arrows should go by toggling -GtkScrollbar-has-backward-stepper and -GtkScrollbar-has-forward-stepper to false. See below.

Code:
@import 'colors.css';

scrollbar {
  -GtkScrollbar-has-backward-stepper: false;
  -GtkScrollbar-has-forward-stepper: false;
}

scrollbar, scrollbar button, scrollbar slider {
   min-width: 24px;
   min-height: 24px;

The next step is where I'm stuck. How do I get the downward and upward pointers to appear at the top and bottom of the scrollbars and in the correct orientation?


Thanks

Alex

Last edited by aikempshall; 03-18-2020 at 05:58 AM. Reason: Change title
 
Old 03-18-2020, 04:03 PM   #2
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 324

Rep: Reputation: 135Reputation: 135
The GTK 3 theme should map the scrollbar buttons to icons as follows:

Code:
scrollbar.vertical button.up {
        -gtk-icon-source: -gtk-icontheme("pan-up-symbolic");
}

scrollbar.vertical button.down {
        -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
}

scrollbar.horizontal button.up {
        -gtk-icon-source: -gtk-icontheme("pan-start-symbolic");
}

scrollbar.horizontal button.down {
        -gtk-icon-source: -gtk-icontheme("pan-end-symbolic");
}
If your theme is not doing this, it is broken. GTK 3 themes are too complex for casual editing. The easiest solution would be to try another theme.
Ed
 
1 members found this post helpful.
Old 03-19-2020, 04:03 AM   #3
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 684

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by EdGr View Post
The GTK 3 theme should map the scrollbar buttons to icons as follows:

Code:
scrollbar.vertical button.up {
        -gtk-icon-source: -gtk-icontheme("pan-up-symbolic");
}

scrollbar.vertical button.down {
        -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
}

scrollbar.horizontal button.up {
        -gtk-icon-source: -gtk-icontheme("pan-start-symbolic");
}

scrollbar.horizontal button.down {
        -gtk-icon-source: -gtk-icontheme("pan-end-symbolic");
}
If your theme is not doing this, it is broken. GTK 3 themes are too complex for casual editing. The easiest solution would be to try another theme.
Ed

That was most helpful.

I decided to concentrate on the file /usr/share/themes/Breeze/gtk-3.0/gtk.css

Adding your suggested code got me the right up/down characters in the scrollbar buttons.

I eventually then noticed something odd in my /usr/share/themes/Breeze/gtk-3.0/gtk.css about the configuration of scrollbar button

Code:
  scrollbar button {
    min-width: 24px;
    min-height: 24px;
    margin: 0px;
    padding: 0px 0px;
    border: none;
    border-radius: 0px;
    background-image: none;
    background-color: transparent;
    color: transparent;
    box-shadow: none; }

in that the background-color and the color were both transparent.So I hashed out the color config setting as follows

Code:
  scrollbar button {
    min-width: 24px;
    min-height: 24px;
    margin: 0px;
    padding: 0px 0px;
    border: none;
    border-radius: 0px;
    background-image: none;
    background-color: transparent;
#    color: transparent;
    box-shadow: none; }
In gnucash I then had the correct up/down image in the scrollbar buttons and they were always visible if appropriate.

So a success.

Now need to translate that into how I configure this locally in .config/gtk-3.0/gtk.css otherwise I may have problems when breeze-gtk is next upgraded.
 
Old 03-19-2020, 04:25 AM   #4
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 2,409

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
I don't know if GTK's own CSS differs from standard CSS, but this is how to comment in standard CSS:
Code:
scrollbar button {...
    background-color: transparent;
    /*color: transparent;*/
    box-shadow: none;}
It may be that your # simply makes that line an invalid rule, so is ignored.

I would probably have tried changing transparent to inherit for both color and background-color before commenting the color rule.

Thanks to EdGr!
 
Old 03-19-2020, 08:48 AM   #5
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 324

Rep: Reputation: 135Reputation: 135
That's cool.

It sounds like you are debugging Breeze. I suggest creating a standalone theme rather than a delta so that you won't have to deal with upgrade breakage.
Ed
 
Old 03-19-2020, 09:06 AM   #6
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 684

Original Poster
Rep: Reputation: 77
What I've settled for is
  1. The /usr/share/themes/Breeze/gtk-3.0/gtk.css as supplied in package breeze-gtk-5.18.3-x86_64-1alien
  2. A bespoke .config/gtk-3.0/gtk.css in the home directory. See below.

Code:
@import 'colors.css';

scrollbar {
        -GtkScrollbar-has-backward-stepper: true;
        -GtkScrollbar-has-forward-stepper: true;
        min-width: 24px;
        min-height: 24px;
}

scrollbar button {
        min-width: 24px;
        min-height: 24px;
        color: black;
}

scrollbar slider {
        min-width: 24px;
        min-height: 24px;
}

scrollbar.vertical button.up {
        -gtk-icon-source: -gtk-icontheme("pan-up-symbolic");
}

scrollbar.vertical button.down {
        -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
}

scrollbar.horizontal button.up {
        -gtk-icon-source: -gtk-icontheme("pan-start-symbolic");
}

scrollbar.horizontal button.down {
        -gtk-icon-source: -gtk-icontheme("pan-end-symbolic");
}
This seems to have fixed the scrollbar problems with gnucash and libreoffice.

Still have to see If I can repeat successfully on one of my other test virtual machines.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Disable GNOME's Overlay Scrollbars (Have The Scrollbars Permanently Visible) LXer Syndicated Linux News 0 09-17-2019 05:12 PM
Disable colored scrollbars Wynd General 2 12-15-2005 01:32 PM
No Scrollbars Hectic Slackware 2 10-12-2004 06:06 PM
java tiny scrollbars alaios Programming 3 05-29-2004 12:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration