How to tune a GTK theme? Is there an exhaustive list of properties? - gtk

I'm trying to make GTK-based applications look more compact by customizing a theme, as suggested by an answer for my other question.
I reduced some values I saw in the gtkrc and it got better, but not enough.
I want to shrink it further:
How to do it?
Are there any tools helps me to adjust various paddings or at least show me the exhaustive list of properties I can set in gtkrc? Is there a document with full list of properties can be in gtkrc?

You can try gtkparasite, which is a Firebug-like for GTK+. You have to run it as:
$ GTK_MODULES=gtkparasite my_program
And then you can inspect the properties of each widget, change its values, etc. In the web page you will also see a screencast on how to use it.

Related

Is there a manual/list of special Gtk CSS properties?

I'm trying to redesign some Gtk3 widgets in my application (like scrollbars or paned) but was unable to set borders and other properties for paned specifically.
I then found some CSS data in /usr/share/themes/Adwaita/gtk-3.0/gtk.gresource, which use special Gtk properties like "-GtkPaned-handle-size", "-GtkCheckButton-indicator-size" etc.
These were not listed in DevHelp, nor was I able to find it on developer.gnome.org. I think such properties could be exactly what I need. Is there a listing of them with or without a possible description?
EDIT: I wouldn't mind too much searching for them in source code if it is the only way to find names of the properties. Could anyone point me to the right place where to look, please?
Thank you.
These are taken from the names of "style properties" - you can find them in Devhelp, in the sections below the regular properties.
The corresponding CSS property names are built like -ClassName-property-name; so -GtkPaned-handle-size would be the handle-size property of GtkPaned.
Note that style properties are going to be removed in GTK 4, and everything will be customizable by regular CSS properties.
Is there a listing of them with or without a possible description?
Run your program
open the inspector (Ctrl + shift + i)
How to enable GTK inspector
select the widget you're interested in.
From the combo-box, select CSS Nodes

How to programmatically change help contents in Eclipse?

I have an eclipse plugin and I would like to programmatically disable help content TOC's based on a variable I define. In a nut shell, I want to prevent some help docs from showing up in the help contents if a specific type of user is accessing the plugin.
Preferably I would like to do this in the ApplicationWorkbenchAdvisor somewhere.
One thought would be to modify the "primary" value to be false if the variable were set.
Not sure if it would work, but try using the org.eclipse.ui.activities extension point. The tutorial from Vogella tells it is possible to hide only UI elements like wizards, views and so on, but it is from 2009.. Not sure if hiding TOC is now possible. If you try it out, would be nice to give a feedback ;)

ICEFaces: values for the "icon" attribute

I'm writing a menu bar made up of icons.
The easiest way, in my opinion, is relying on the icon attribute of the ace:menuItem component.
Unfortunately, I couldn't find, neither in the showcase nor in the documentation, a complete list of the built-in values allowed for that attribute (i.e. ui-icon, ui-icon-contact etc.).
Where could I find it? In case there isn't such a list, how could I work it out?
You can check the source of the page, then open theme.css
Have a look at:
http://jquery-ui.googlecode.com/svn/tags/1.6rc5/tests/static/icons.html

How to globally style elements which doesn't support appearance

I have learned that in iOS 5, properties that are marked with UI_APPEARANCE_SELECTOR can be styled using appearance. Eg [[UINavigationBar appearance] setTintColor:....]. However, I seem not to be able to style all elements. UIButton, for instance, has no properties marked UI_APPEARANCE_SELECTOR, hence I am not able to use the above technique to style it.
My question is: How do I best style elements globally (all appearances in the application), when I cannot use appearance?
Right now I have defined some colors, fonts, shadow offsets etc. that I use many different places in my code. This allows me to change the look and behaviour of a lot of elements, but it still doesn't allow me to style all instances of a certain object with only one line of code.
Edit
In lack of better solutions I have created a number of categories with simple methods as the following:
+ (UIButton *)customLabelWithFrame:(CGRect)frame andText:(NSString *)text;
Also I have found that - in combination with the described categories - stretchable images are nice and useful.
With the above I am able to style in a global-ish manner, however I am not satisfied with the result and I still hope to find a better solution
What about standard subclassing or factory classes, as you mentioned yourself!?
For buttons I'm using factory classes myself.
I think a really nice solution could be the Android way of designing interfaces. Android relies on XML files to define the user interface. As a matter of fact, I'm working on a library that aims to give the projects I'm working on much the same capabilities. It's still a work in progress / experiment and as such really messy code (you have been warned!), but it might give you some ideas.
An example project can be downloaded here: http://dl.dropbox.com/u/6487838/WSLayoutManager.zip
Experiment a bit with the XML files by adding controls. Create custom control classes and instantiate them from the XML file, etc... It's fun stuff :)

Creating GTK Widget Using Expander

I am trying to create GTK Widget like shows in following Images
Is it possible to create it in GTK+ under C,
I tried using GtkExpander but it is not working out ...
Can any one Help....
Stripping the arrow is quite trivial. Just append the following code to you $HOME/.gtkrc-2.0 (or create it if not found):
style "pradeep" {
GtkExpander::expander-size = 0
GtkExpander::expander-spacing = 0
}
widget "*.GtkExpander" style "pradeep"
This is done by customizing the appearance using resource files. You can get the same result programmatically by changing the GtkExpander style properties.
Furthermore, you can connect your own callback to its "activate" signal and switch the background color of the widget whenever is active or not. And a lot more...
Just remember someone loves to have a consistent user interface.
If what you want is to duplicate the look, then there are two very inefficient solutions to the problem:
Write your own GTK theme engine (see Murrine or Clearlooks).
Replace your entire program by a GtkDrawingArea widget and use Cairo to draw exactly the look you want. You'll be on your own then, though, so you'll have to write all your widget placement algorithms, buttons, expanders, menus, and whatnot, from scratch.
GTK isn't really meant for this sort of thing. The whole point of GTK is that you design your user interface with the standard widgets, and they just work with whatever theme, language, or accessibility technologies your users need to use. If you design your own look and there's no way to change it, then someone with color blindness or poor eyesight won't be able to use it. Or the text will get all misaligned if someone uses your application in another language. Or at the very least, maybe someone just likes a black desktop with white lettering, and your application will stick out and look really ugly on that user's computer. If you really need to make it look exactly that way, then probably GTK isn't the right tool for you.