Results 1 to 5 of 5

Thread: Yad, selected button color

  1. #1
    aeronutt is offline Grande Half-n-Half Cinnamon Ubuntu
    Join Date
    Feb 2009
    Location
    Central MD
    Beans
    853

    Question Yad, selected button color

    I'm using yad (fork of zenity) to create some simple script interfaces.

    Q: Is there a way to set the "background" color of the selected button?

    Problem: If I run my script in Ubuntu, the pop-up shows up and I can't really tell which button is selected by default. All buttons appear identical except for a very faint difference in the outline of the buttons.
    But, run the same script under another OS, and the default button is obvious from it's color (blue, vs white compared to all non-selected buttons, for example).

  2. #2
    Join Date
    Jan 2017
    Beans
    235

    Re: Yad, selected button color

    Quote Originally Posted by aeronutt View Post
    Q: Is there a way to set the "background" color of the selected button?
    I know of two ways to go about it.

    1. Edit ~/.config/gtk-3.0/gtk.css and add something like this:
    Code:
    button:focus {
        background: lightgray; /*choose any color*/
    }
    The down side to this is that it will override the focus color for every Gtk app.

    2. Create a custom theme. For example on my box the default theme is adwaita. To create a theme named 'yad_theme' do the following:
    Code:
    mkdir -p  ~/.themes/yad_theme/gtk-3.0/
    touch ~/.themes/yad_theme/gtk-3.0/gtk.css
    Add the following to the file:
    Code:
    @import url("resource:///org/gtk/libgtk/theme/Adwaita/gtk-contained.css");
    
    button:focus {
        background: lightgray;
    }
    Then when you run yad preface it with "GTK_THEME=yad_theme".
    i.e. "GTK_THEME=yad_theme yad" should produce a window with the background of the cancel button light gray.

    HTH
    Last edited by norobro; February 18th, 2021 at 02:12 AM. Reason: misplaced HTH

  3. #3
    aeronutt is offline Grande Half-n-Half Cinnamon Ubuntu
    Join Date
    Feb 2009
    Location
    Central MD
    Beans
    853

    Re: Yad, selected button color

    Thanks!!! I'll give #2 a shot and report back.
    I'll also check to see if this is how active yad buttons have color in Neon/Plasma

  4. #4
    Join Date
    Jan 2017
    Beans
    235

    Re: Yad, selected button color

    Sorry about the HTH in the middle of the code. Obviously I meant that to be at the bottom.

    I'll edit the post.
    Last edited by norobro; February 18th, 2021 at 02:13 AM. Reason: fumble fingers

  5. #5
    aeronutt is offline Grande Half-n-Half Cinnamon Ubuntu
    Join Date
    Feb 2009
    Location
    Central MD
    Beans
    853

    Re: Yad, selected button color

    Ha...yea, I saw that HTH and knew better.

    Tried #1, and it's working well, will also try #2 method, but I'm going to mark this solved.

    THANKS!!!!!!!!!

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
  •