! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Gtk-xfce-engine, gtk3: No default button indication
Status:
CLOSED: FIXED
Product:
Gtk-xfce-engine
Component:
General

Comments

Description Klaus Kusche 2012-02-13 14:38:41 CET
None of the predefined Xfce themes provide any visual indication
of the default button (the one which is pressed by hitting <Enter>).

This is a big problem, especially for dialogs like yes/no or ok/cancel:
One does not know what action is caused by just hitting <Enter>.

In gtk2, one gets a beautiful and indicative sunken border by setting
GtkButton::default_border. In gtk3, setting -GtkButton-default-border or
-GtkButton-default-outside-border just makes the default button larger
or smaller compared to the other buttons (which looks ugly),
but gives no special border or other visual indication:
The additional space is filled with the normal button background.

I helped myself with 

.button.default {
    border-width: 5 5;
    border-style: solid;
    border-color: @fg_insensitive;
}

This gives a solid dark border, but the effect is very different from gtk2.
Using "inset" or "outset" instead of "solid" is ignored: No 3D or sunken effect.
Comment 1 Peter de Ridder editbugs 2012-02-19 12:08:34 CET
There is currently no way for the theming engine to use the -GtkButton-default-border.
I reported this upstream:
https://bugzilla.gnome.org/show_bug.cgi?id=670387
If this isn't solved in time. A solution would be to add -xfce-GtkButton-default-border to be able to mimic Gtk2
Comment 2 Klaus Kusche 2012-02-19 15:09:44 CET
Well, there are ways to indicate the default button visually in gtk3:
The code I gave in my original bug report (with a colored button border instead 
of a 3D button frame), or similar code based on .button.default {...}
which assigns different background images (or foreground colors or whatever) 
to default buttons.

However, all these workarounds look very different from gtk2's sunken 3D border.

Besides, GtkCssProvider allows to define arbitrary border images.
I didn't try to use them for button borders, but perhaps they could to the trick
with a carefully defined (semi-transparent?) image.

I don't know if solving the different appearance is worth the effort
if it can't be done easily.
Comment 3 Peter de Ridder editbugs 2012-02-19 16:01:09 CET
(In reply to comment #2)
> Well, there are ways to indicate the default button visually in gtk3:
> The code I gave in my original bug report (with a colored button border instead 
> of a 3D button frame), or similar code based on .button.default {...}
> which assigns different background images (or foreground colors or whatever) 
> to default buttons.
> 
> However, all these workarounds look very different from gtk2's sunken 3D
> border.

This is an option, And it might be posible to make the Gtk2 themes look the same as the Gtk3 themes instead of the otherway around.

> Besides, GtkCssProvider allows to define arbitrary border images.
> I didn't try to use them for button borders, but perhaps they could to the
> trick
> with a carefully defined (semi-transparent?) image.

With the gtk-xfce-engine I intentionally don't support border images. This means that this is not posible with the gtk-xfce-engine, it might be posible to tweak another engine to look like the Xfce engine. But that wouldn't make sense for the default themes.

> I don't know if solving the different appearance is worth the effort
> if it can't be done easily.
It is my goal to make Gtk2 and Gtk3 look simular so I would like to solve it. I hope they pick it up upstream. If not I could make a workaround by adding the default-border property to the Xfce engine properties. I don't think that would be to difficult to implement, but it will add some none obvious property to the themes.
Comment 4 Peter de Ridder editbugs 2012-03-30 12:55:13 CEST
Implemented -xfce-button-default-border in commit 955dd15

Bug #8454

Reported by:
Klaus Kusche
Reported on: 2012-02-13
Last modified on: 2012-04-08

People

Assignee:
Peter de Ridder
CC List:
1 user

Version

Version:
Unspecified

Attachments

Additional information