1. 20 Jul, 2014 1 commit
  2. 05 Jan, 2014 2 commits
    • Matthias Clasen's avatar
      GtkModelMenuItem: set initial accessible role · b4d9ea18
      Matthias Clasen authored
      The initial state of GtkModelMenuItem is that of a normal menu
      item, but the accessible we are using, GtkCheckMenuItemAccessible,
      starts out with a role of 'check menu item'. Fix that up by
      explicitly setting the initial accessible role.
      b4d9ea18
    • Matthias Clasen's avatar
      GtkModelMenuItem: Add some property notification · 2a3d5823
      Matthias Clasen authored
      GtkModelMenuItem emits no property notification, since none of its
      properties are readable. But the toggled property is just a proxy
      for GtkCheckMenuItem::active, so we should ensure that property
      notification is emitted for the ::active property.
      2a3d5823
  3. 13 May, 2013 1 commit
    • Allison Karlitskaya's avatar
      add GtkMenuTrackerItem · a4276a6c
      Allison Karlitskaya authored
      Add a new class, GtkMenuTrackerItem that represents a menu item, to be
      used with GtkMenuTracker.
      
      GtkMenuTracker's insert callback now works in terms of this new type
      (instead of passing reference to the model and an index to the item).
      
      GtkMenuShell now handles all of the binding tasks internally, mostly
      through the use of property bindings.  Having bindings for the label and
      visibility attributes, in partiular, will help with supporting upcoming
      extensions to GMenuModel.
      
      GtkModelMenu has been reduced to a helper class that has nothing to do
      with GMenuModel.  It represents something closer to an "ideal" API for
      GtkMenuItem if we didn't have compatibility concerns (eg: not emitting
      "activate" when setting toggle state, no separate subclasses per menu
      item type, supporting icons, etc.) Improvements to GtkMenuItem could
      eventually shrink the size of this class or remove the need for it
      entirely.
      
      Some GtkActionHelper functionality has been duplicated in
      GtkMenuTracker, which is suboptimal.  The duplication exists so that
      other codebases (such as Unity and gnome-shell) can reuse the
      GtkMenuTracker code, whereas GtkActionHelper is very much tied to
      GtkWidget.  Supporting binding arbitrary GtkWidgets to actions vs.
      supporting the full range of GMenuModel features for menu items turns
      out to be two overlapping but not entirely similar problems.  Some of
      the duplication (such as roles) can be removed from GtkActionHelper once
      Gtk's internal Mac OS menubar support is ported to GtkMenuTracker.
      
      The intent to reuse the code outside of Gtk is also the reason for the
      unusual treatment of the enum type introduced in this comment.
      
      This adds no new "public" API to the Gtk library, other than types that
      we cannot make private due to GType limitations.
      a4276a6c
  4. 22 Apr, 2013 1 commit
  5. 01 Apr, 2013 1 commit
    • Allison Karlitskaya's avatar
      Introduce GtkMenuTracker · 5617b584
      Allison Karlitskaya authored
      GtkMenuTracker folds a nested structure of sections in a GMenuModel into
      a single linear menu, which it expresses to its user by means of 'insert
      item at position' and 'remove item at position' callbacks.
      
      The logic for where to insert separators and how to handle action
      namespaces is contained within the tracker, removing the need to have
      this logic duplicated in the 3 or 4 places that consume GMenuModel.
      
      In comparison with the previous code, the tracker no longer completely
      destroys and rebuilds menus every time a single change occurs.  As a
      result, the new gtkmenu testcase now runs in approximately 3 seconds
      instead of ~60 before.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=696468
      5617b584
  6. 17 Sep, 2012 3 commits
    • Allison Karlitskaya's avatar
      gtkmodelmenu: simplify logic, expose bind API · dd143479
      Allison Karlitskaya authored
      Make the main (and only) entry-point to gtkmodelmenu.c the now-public
      gtk_menu_shell_bind_model().
      
      Move the convenience constructors (gtk_menu_new_from_model() and
      gtk_menu_bar_new_from_model()) to their proper files.
      
      Remove the private header file.
      
      Simplify the code a bit by making the initial populate part of the
      bind() call.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=682831
      dd143479
    • Allison Karlitskaya's avatar
      GtkAccelLabel: add manual accel API · 778aa7ad
      Allison Karlitskaya authored
      Add an API to GtkAccelLabel for hardcoding the accel key to be displayed
      (ie: allowing us to bypass the GtkAccelGroup lookup).
      
      Use that from the GMenuModel-based GtkMenu construction code instead of
      passing around the accel group.
      
      This makes accel labels work in bloatpad again.
      
      This patch effectively removes any hope of automatic runtime accel
      changes in GMenuModel-based menus without additional application
      support but it leaves the door open for this to be supported again in
      the future (if we decide that it's important).
      
      https://bugzilla.gnome.org/show_bug.cgi?id=683738
      778aa7ad
    • Allison Karlitskaya's avatar
      GtkModelMenuItem: add a submenu action attribute · 338b5f6c
      Allison Karlitskaya authored
      Add support for a stateful action associated with a submenu.  The action
      state is set to TRUE when the menu is shown and FALSE when it is
      unshown.
      
      This is useful to avoid unnecessary processing for menus that have
      frequently-changing content.
      
      A possible future feature is to add support for asynchronously filling
      the initial state of the menu by waiting until the action actually emits
      its state-change signal to TRUE before showing the menu.
      
      A silly example has been added to Bloatpad to demonstrate the new
      feature.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=682630
      338b5f6c
  7. 20 Aug, 2012 2 commits
    • Lars Uebernickel's avatar
      gtkmodelmenu: add support for action namespaces · 71067472
      Lars Uebernickel authored
      If a section or submenu item has a "action-namespace" attribute, the
      action names of the created GtkModelMenuItems will be prefixed with that
      namespace.  Namespaces can be cascaded.
      71067472
    • Allison Karlitskaya's avatar
      gtkmodelmenu: move to new action regime · dd45862a
      Allison Karlitskaya authored
      Drop the explicit passing of GActionGroup into the GtkMenu(Bar)
      constructors and operate from the action context instead.
      
      With GtkMenuItem implementing GtkActionable, this turns out to be pretty
      easy (and most of the code can be removed from GtkModelMenuItem,
      including the GActionObserver implementation).
      dd45862a
  8. 27 Feb, 2012 1 commit
  9. 25 Jan, 2012 1 commit
  10. 20 Dec, 2011 1 commit
  11. 19 Dec, 2011 6 commits