Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-11-09 04:49:41

fulalas
Member
Registered: 2016-11-11
Posts: 16

[SOLVED] How to add shadow and dotted rectangle on selected buttons?

At the moment the dark theme I'm working on Xfce 4.12 (GTK2) looks like this when cancel button is selected:
https://www.mediafire.com/view/ebg1qpyh … -42-36.png

I would like to have something like this:
https://www.mediafire.com/view/dz80pq21 … -42-27.png

Thanks! smile

Last edited by fulalas (2021-11-11 10:42:29)

Offline

#2 2021-11-09 14:56:19

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: [SOLVED] How to add shadow and dotted rectangle on selected buttons?

Just to confirm, you would like to have the dialog background grey-coloured and the currently active button displayed with dotted lines?

Which program generated this dialog? Is it a GTK or QT-based (or other) app?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2021-11-10 02:57:23

fulalas
Member
Registered: 2016-11-11
Posts: 16

Re: [SOLVED] How to add shadow and dotted rectangle on selected buttons?

Sorry, I wasn't clear enough indeed.

I just want to add dotted lines and a shadow in this GTK dark theme.

Offline

#4 2021-11-10 11:28:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: [SOLVED] How to add shadow and dotted rectangle on selected buttons?

The dotted lines are called a "focus-line" and one does exist in the dark theme that you posted. So does the shadow. The "focus-line" in the dark theme image is a solid line, not a dotted line. Look in your theme's gtk-2.0 files for some reference to "function = FOCUS" and it might indicate which file is being used to provide this feature.

Using Adwaita-dark as a base, the following snippet in ~/.gtkrc-2.0 will enable a grey lined focus-line:

style "focusline"
{ 
  GtkWidget::focus-line-width = 1
  GtkWidget::focus-padding = 3
  GtkWidget::focus-line-pattern = "\4\3"

  engine "pixmap" {
    image {
      function = FOCUS
      recolorable = TRUE
      file = "assets/focus-line.png"
      border = { 2, 2, 2, 2 }
      stretch = TRUE
    }
  }
}

class "GtkWidget" style "focusline"

The "focus-line-pattern" setting should create a dotted line, but for some reason it doesn't work. The "assets/focus-line.png" file I pulled from another dark theme's gtk-2.0/assets directory.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2021-11-11 10:44:04

fulalas
Member
Registered: 2016-11-11
Posts: 16

Re: [SOLVED] How to add shadow and dotted rectangle on selected buttons?

I found this png in another theme and with your code it's working quite well!

Thank you very much! smile

Offline

#6 2021-11-12 05:47:00

fulalas
Member
Registered: 2016-11-11
Posts: 16

Re: [SOLVED] How to add shadow and dotted rectangle on selected buttons?

I found out how to make the dotted lines to work: just remove the focus scope (that contains function = FOCUS) and add this (inside style "default"{}):

  engine "adwaita" {
  	focusstyle = 1
  }

However, the dotted lines are too white, while in GTK3 they're bit greyed out, which looks better IMHO. Do you know if there's a way to dim it a bit?

Offline

#7 2021-11-12 11:44:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: [SOLVED] How to add shadow and dotted rectangle on selected buttons?

Unfortunately, I can't find any documentation on the adwaita engine.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 9 queries executed - Memory usage: 545.8 KiB (Peak: 546.65 KiB) ]