Windicators

Revision 13 as of 2010-05-26 16:00:35

Clear message

Designed by MarkShuttleworth, written up by MatthewPaulThomas and TedGould

Window indicators, or windicators, are menus that appear at the trailing end of a window’s title bar, or in the panel when the window is maximized. Application developers can use windicators for reflecting status, and allowing change of status, for the item or items presented in the window. The menus should be implemented using DbusMenu.

Separately, hint bars are a transitory alternative to status bars. With any interactive menus moved from a status bar to a windicator, a hint bar can replace a window’s status bar.

Reference: http://www.markshuttleworth.com/?p=333

API

An AyatanaStatus object contains any number of windicators, and/or a stack of messages hint bar, for a given window.

AyatanaStatus * my_window_status = ayatana_status_new(window);

A windicator is constructed using an icon, an accessible label, and a GtkMenu.

AyatanaWindicator * my_windicator = windicator_new("title-icon-name-symbolic", "accessible label", a_menu_i_constructed_earlier);

Once the windicator is constructed, attach it to the window’s AyatanaStatus object:

ayatana_status_append_windicator(my_window_status, my_windicator);

There are separate functions to change the icon, accessible label, or text label of the windicator title once it is constructed.

windicator_set_icon(my_windicator, "some-other-icon-symbolic");
windicator_set_accessible_label(my_windicator, "Larger");
windicator_set_label(my_windicator, "My label");

If the application wishes it can query the status of how the status is currently being displayed.

AyatanaStatusState state = ayatana_status_get_state(status);

Then it gets one of:

  • FALLBACK displayed as a status bar at the bottom of the window

  • TITLEBAR The windicators are in the title and the status items are overlaying the active window.

  • PANEL The windicators are in the panel and the status items are overlaying the active window.

    How would custom fallback like the Evolution example work?

Also we provide the ability to set and push status messages.

ayatana_status_push_message(status, "Clicking will cause computer to explode");
ayatana_status_pop_message(status, AYATANA_STATUS_MESSAGES_ALL);

For users that want more fine grained control of their messages we'll allow for tracking with a message ID.

AyatanaStatusMessageID id1 = ayatana_status_push_message(status, "First Message");
AyatanaStatusMessageID id2 = ayatana_status_push_message(status, "Second Message");
aytana_status_pop_message(status, id1); /* would leave id2 showing */

Or to add to a notification stack of temporary statuses that should be shown to the user for a short time ala notify-osd

ayatana_status_queue_message(status, "Download Complete", DEFAULT_TIMEOUT);

There will also be signal handlers to show when a message is displayed and hidden for those applications that wish to track their messages closely, whether they are timed or permanent.

void message_appear (AyatanaStatus * status, AyatanaMessageID id, gpointer user_data) {
        g_debug("Showing status");
        return;
}

g_signal_connect(G_OBJECT(status), "message-shown", G_CALLBACK(message_appear), NULL);

Other signals:

  • "message-removed" The message is no longer expected to be displayed
  • "message-hidden" The message can not currently be seen by the user as it is behind another message.

    Is this all for hint bars? If so, perhaps it should be a separate subsection.

Placing windicators

Unless the application developer specifies otherwise, windicators should be placed in the order they were requested, starting at the trailing end of the title bar (or, if the window is maximized in Unity, at the leading side of the application indicators).

  • How to add multiple windicators while retaining a fixed order?

Individual windicators

As with ApplicationIndicators, a windicator is a menu with a title.

Title

As with ApplicationIndicators, a windicator title may consist of an icon, or an icon plus brief text. In both cases the icon has a compulsory accessible label, which is exposed to accessibility aids but not shown otherwise.

Application developers should use a symbolic icon (from the -symbolic namespace) for a windicator title, to ensure it is visible regardless of the color of the title bar or panel.

Windicators have no mouseover event.

Contents

A windicator menu may contain the same kinds of items as ApplicationIndicators.

Hint bars

A hint bar, as popularized by Chromium, is a compact, transitory alternative to a status bar. It presents advisory text only when it is needed, and in a faster and less obnoxious way than a tooltip.

If the only interactive controls in an application’s status bar are menu buttons, converting these to windicators may let the application replace its status bar with a hint bar.

Proof-of-concept implementations

We should alter five applications to use windicators, to test the mechanism and to provide examples of how they can be used. One of these can, as a result, also switch from a status bar to a hint bar.

Evolution

evolution.jpg

The Evolution windicator provides examples of (a) radio items with icons and (b) custom fallback.

When windicators are available:

  • There should be a windicator for changing the view mode of the window. It should be a replica of the “View” > “Window” submenu, except that it should always show the icon for each application, and also show a radio mark for the selected application.

  • The application switcher inside the Evolution window should not be present, and neither should the “View” > “Switcher Appearance” submenu.

When windicators are not available, the in-window application switcher and the “View” > “Switcher Appearance” submenu should be present.

F-Spot

f-spot.jpg

The F-Spot windicator provides an example of boolean items with icons.

When windicators are available, there should be a windicator for tagging the selected photos. The menu should consist of a boolean item for each tag. If all selected photos have a tag, the tag item should have a checked checkmark (✓); if only some of them do, the tag item should have an indeterminate checkmark (–).

When windicators are not available, this menu should not be shown anywhere else. (Ideally it would be prepended to the “Tags” menu, but other items in that same menu assume you are using the “Tags” sidebar rather than tagging with a menu.)

Firefox

firefox.jpg

The Firefox windicator provides an example of a windicator that appears and disappears.

Whenever Firefox regards the current page as having a secure connection, and windicators are available, there should be a security windicator instead of the padlock in Firefox’s status bar.

The windicator should have a padlock as its title, with the accessible label “Secure connection”. Activating the menu’s only item, “Security Info”, should open the “Page Info” window to its “Security” tab.

When windicators are not available, the padlock button should be shown in its traditional position in the status bar, or wherever it moves to upstream if Firefox 4 drops the status bar.

Gimp

gimp.jpg

The Gimp windicators provide examples of (a) multiple windicators for the same window, (b) text in windicator titles, (c) custom alignment of item text, (d) a text field in a windicator menu, and (e) a hint bar.

When windicators are available, there should be two windicators for any Gimp document window: one for ruler units, and one for zoom level. These should replace the radio menu and combo box that are present in the status bar when windicators are not available.

The units windicator should list, as radio items, the available units for the ruler.

The zoom level windicator should list as radio items, from lowest to highest, the canned zoom levels for the image. If the current zoom level is not one of the canned ones, it should be included as an extra item in its appropriate numeric position.

The last item in the menu should be a text field for entering a custom zoom level. When the menu is opened with a pointing device, this field should always be empty and focused. (At this point, pressing the Down key immediately should, as usual, highlight the first item in the menu, and thereby unfocus the text field.)

All items in the menu should be aligned such that the “%” symbols line up with each other exactly.

Mumble

mumble.jpg

The Mumble windicator provides an example of a windicator in a mini title bar.

When windicators are not available, there should be no change to Mumble’s interface.

When windicators are available ...

Future work

Define windicators for Chromium (Incognito mode?) and Thunderbird.

Unresolved issues

This spec needs to:

  • define the kinds of indicator menu titles
    • icons
    • numbers+icons? (900 mails)
    • letters (keyboard style?)
  • define windicator ordering
    • apps can add, update, remove windicators
    • apps specify order explicitly (not just order added)
    • mapping into panel when maximised
  • scope and define APIs
  • define visuals
    • theme names?
    • symbolic icons?
  • define window management interaction
    • windicators on alt-tab window previews
    • windicators on expose presentation of windows