Reputation: 801
In gtk2 (.rc) and GTk3 (.css) how do you theme the default button in a dialog ?
(The one that will be activated when hitting enter)
Upvotes: 1
Views: 1132
Reputation:
In Lubuntu 12.10, the default theme (/usr/share/themes/Lubuntu-default) has a file in the gtk-2.0 folder called button.rc
. There are five "states" listed: normal, prelight, insensitive, active, and focus. It is my impression (from a bit of fiddling), that the "focus" state represents the one you are interested in. In other words, if a window with a few buttons is present, it is the button in the focus state that will be "pressed" or "clicked" by hitting enter.
In Lubuntu 12.10, the screen that appears when you click "Logout" from the main menu (or run lubuntu-logout
from a terminal) illustrates this well. Of the seven "buttons" that appear, the topmost one, Shutdown, is shaded slightly differently (or has a focus ring) whereas the other six are similar to each other except for the text. Hitting "enter" without doing anything else is equivalent to clicking the "Shutdown" button.
I too am trying to figure out how to make the button in focus, if we call it that, a bit more contrasty.
For the gtk2 side of things, if you're happy with making the focus ring more obvious (but a bit more ugly), editing the theme's gtkrc
may be one way. Look for a section captioned style "default" and then for a line that has something like
GtkWidget ::focus-line-width = 1
Changing 1
to 2
or 3
will make the focus ring more obvious.
(I haven't got round to looking at gtk3 apps.)
Upvotes: 2