Skip to content

WIP: Modern Gtk3 - part 2

Luca Bacci requested to merge lb90/gparted:modern-gtk3-part-2 into master

This is about migrating away from stock items which have been deprecated in Gtk 3.10.

Stock items just make it way easy to provide common UI elements that are found on many UIs: new, quit, cut, copy, paste, about, etc.

A stock item bundles:

  • a translatable, underscorized label text.
  • an icon name.
  • a keyboard accelerator (this one does not change with language).

For example, with stock id GTK_STOCK_QUIT you get:

  • "_Quit" label text
  • "application-exit" icon name
  • "Ctrl+Q" keyboard accelerator

Tanslations for stock label texts are provided by Gtk.

So stock items make it easy and direct to build menu items, toolbar buttons and even simple buttons, labels or images, because they bundle all that's needed. The underscore in label text is for keyboard navigation in menus.

Some references:

Merge request reports