Human Interface Guidelines for Panel Plugins
This page is very much a work-in-progress at the moment. Feel free to contribute. Discussion page.
About
Rationale
UI consistency is an important aspect of a mature desktop like Xfce. On the other hand, there are tons of panel plugins out there, developed by many different people. A written set of UI guidelines will help those developers ensure their plugins maintain some basic level of consistency.
Process
We're trying to do this in a wiki fashion, so everyone is welcome to improve this. When you add something new, put “[draft]” before it. This way, plugin developers know to keep an eye on it, and people can provide their comments. If you aren't sure how something should be handled but think it should be discussed, put “[rfc]” (request for comments) before it.
Plugin Classes
Most guidelines apply differently based on the plugin class. (“Class” here means bin or category - it is not used in the GObject sense). The document is split into sections for each of these classes. The guidelines that apply generally are listed in the “General” section.
General
Possibly 4 spaces:
No spaces:
2 spaces:
Interface guidelines regarding the right-click menu provided by the panel.
[rfc] About?
ongardie 2007/12/18 05:51 The current trend is to not include these at all but to put information on the plugin web site.
fabian 2007/12/18 22:47 GMT Well, some plugins just run the opposite trend: Disk Performance Monitor, Quiklauncher, Genmon.
The three plugins fabian pointed out […] show an About item in their context menu. Each of those about dialogs is rather poor,
IMHO. I think the guideline should be “About menu items are discouraged.” —
Diego Ongaro 2008/01/06 01:12
Interface guidelines regarding plugins' menus, usually opened by left-clicking on a button or running a command.
[draft] Optionally, display a title
If you would like to add a title to your menu, set it insensitive and bold, and place it on top of the menu followed by a separator
I'm not convinced I like this. Perhaps we should discourage menu titles instead. —
Diego Ongaro 2008/01/06 01:28
Settings Dialog
Interface guidelines regarding preferences/properties/setting dialogs.
Button with [image label], [image] or [label]
sometimes opening a menu
examples: menu, places, launcher, window list, mount, …
The widget(s) should be contained in a box, preferably an XfceHVBox for convenience.
The order of the widget(s), top-to-bottom or left-to-right should be:
image
label
The box should have a default border (1px).
[draft] The box should have a spacing of 4px.
[draft] The image inside the button should be set to the same size as the button (usually the size of the panel) without its padding and border size:
GtkIconTheme *icon_theme;
GdkPixbuf *pixbuf;
size = xfce_panel_plugin_get_size (panel_plugin);
size -= 2 + 2 * MAX (panel_plugin->button->style->xthickness, panel_plugin->button->style->ythickness);
icon_theme = gtk_icon_theme_get_default ();
pixbuf = gtk_icon_theme_load_icon (icon_theme, "icon-name", size, 0, NULL);
if (G_UNLIKELY (NULL == pixbuf))
return;
gtk_image_set_from_pixbuf (GTK_IMAGE (panel_plugin->icon), pixbuf);
g_object_unref (G_OBJECT (pixbuf));
Note: this is more a problem of what to do with the size-changed signal —
Mike Massonnet 2008/01/19 18:48
Should we really have code snippets in here? And I seem to remember someone (maybe Brian) telling you a better way than hard-coding the 2… —
Diego Ongaro 2008/03/03 04:47
Use a short label to conserve space
On the label, use capitalization like a title (e.g., “My Button”)
Button with [image] [input field]
database queries, command execution, etc from the panel
examples: verve, dict(ionary)
Class M: Monitor
[image] [label] [meter] [value reading]
the resource monitoring ones. Many plugins display a monitor and give the user the option of showing a label, a value reading, or both. For example, the systemload plugin can show labels and monitors for CPU, memory, and swap usage.
examples: system load monitor, battery monitor, sensors plugin
The widget(s) should be contained in a box, preferably an XfceHVBox for convenience.
[draft] The order of the widget(s), top-to-bottom or left-to-right should be:
Icon
Label
Monitor
Value Reading
fabian 2007/12/17 19:22 GMT. Regard other languages such as arabic, they will most probably want the opposite order.
kalikiana 2007/12/17 19:50 I'm not convinced that the Value must be at the very right. The Free Space Checker shows nicely how you can save space by joining Name and Value.
[draft] The box should have a default border (1px).
[draft] The box should have a spacing of 2px.
Use a short label to conserve space. Abbreviations are acceptable
[draft] Use all lowercase letters (e.g., “cpu”)
Mike Massonnet 2007/12/16 07:13 at some point I liked to modify the systemload to show Cpu and Mem instead
ongardie 2007/12/21 00:59 CPU is an acronym, so “Cpu” would be incorrect, and “CPU” takes too much space. “Mem” just looks bad, IMO.
I don't like lowercase either. It depends on what the monitor stands for. —
Jannis Pohlmann 2007/12/23 13:57
On the label, omit punctuation in acronyms and abbreviations (e.g., “mem” instead of “mem.”)
On the value reading, don't include too much precision (e.g., “95.324234%” is bad)
[draft] On the value reading, include units if they add no more than 3 characters to the string (e.g., “30min”)
[rfc] space between monitor bars? (some plugins combine multiple monitors)
[draft] use a -90° angle for monitor labels in horizontal panels and 0° angle for monitor labels in vertical panels. That might save a lot of space. —
Jannis Pohlmann 2007/12/23 14:10
Class G: Grid
array of buttons with [image] or [label] or [image label]
examples: icon box, task list, system tray
Class O: Other
examples: pager, xfapplet