View Single Post
Posts: 341 | Thanked: 607 times | Joined on Dec 2008
#5
Good stuff. From a themeing perspective, the most common mistakes I encounter are:

- Use HildonEntry instead of GtkEntry. This is a no-brainer, and HildonEntry completely replaces GtkEntry. The only caveat is that HildonEntry has to be at least 70px in height (and ideally exactly 70px). This is ensured when using the constructor with HILDON_SIZE_FINGER_HEIGHT flag, and will also be the default size for subclasses soon.

- Make sure buttons get the correct themeing hint. Most buttons should either be finger height, or thumb height, by using hildon constructor functions and the appropriate size flags. If this isn't possible then hildon_gtk_widget_set_theme_size() can be used instead, but it requires that the classname ends in *Button (because it sets the widget name to <ClassName>-size (e.g. HildonButton-finger) and the theme is matching widgets ending in *Button-finger). Otherwise the widget name has to be set manually. This also goes for HildonCheckButtons and other widgets which look like buttons.

If you absolutely have to use auto sized buttons, try not to mix them with properly themed buttons, or it will look very inconsistent.

- Any custom button that acts like a picker button (pressing it allows you to choose a value, which is then displayed in the secondary line of the button) should use the picker style, which can be set with hildon_button_set_style (button, HILDON_BUTTON_STYLE_PICKER).

- Avoid notebook tabs, in most cases it is better to split things up into multiple windows, or to use a pannable area with group titles.

- Speaking of group titles, this is still a bit of a work in progress. But the bottom line is that you should put every group in a GtkFrame, and add 35px of vertical spacing between the groups. This may look odd right now in the SDK, but that will be fixed.

- Avoid comboboxes at all cost! Try to find an alternate method using HildonEntries or picker buttons. We will have one supported method of creating a widget that looks liked a ComboBoxEntry (unified look of entry with a button/arrow on its right), but its implementation is a bit involved and not really intended for regular applications.

- Don't add custom borders and margins without a specific purpose. Elements like HildonButtons and HildonEntries generally already have themed margins and are meant to line up neatly when placed next to each other.

- Avoid labels. New UI elements are generally designed in a way that uses the whole space for the widget, instead of requiring extra space for the label. This is why HildonCheckButtons put the label and checkbox on a button, and HildonEntry has the placeholder text.

If you are at all unsure about something, I suggest to post your UI on this forum and ask for suggestions. I will do what I can to help out, and hopefully we will be able to create a development culture where people get excited about creating slick and consistent UIs down to the last pixel.
 

The Following 10 Users Say Thank You to kanishou For This Useful Post: