Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

If I want my GTK+3 theme that I'm writing to theme certain UI elements in some applications a bit differently than for most applications, how would I go about doing that?

For example, I might have a GTK+3 theme which specifies round buttons in most applications, but in Calculator (gcalctool) I want square buttons instead.

How do I find out how to refer to these applications' UI elements in my theme's CSS files?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

It seems you need to dig into the source files for the different applications and see what they call the different UI elements in their code, likely in the toplevel code.

For the gcalctool example, it appears that the relevant file is gcalctool.c, in which the following line can be seen:

static MathWindow *window;

Thus, to refer to its UI elements (buttons in this case), a section in the theme's CSS should read like:

MathWindow .button {
  /* Properties to modify here for buttons in gcalctool */
}

As each application has its own code, it's apparently up to the theme creator to review the source code of the applications they want to theme and find the relevant UI element names to reference in the CSS.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.