[gtkmm] Let Gtk::ToolButton implement the Actionable interface
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Let Gtk::ToolButton implement the Actionable interface
- Date: Wed, 9 Nov 2016 09:30:56 +0000 (UTC)
commit 0343107dfdb7a2865ccf255d4307ba322717d9ab
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Wed Nov 9 10:28:24 2016 +0100
Let Gtk::ToolButton implement the Actionable interface
gtk/src/actionable.hg | 20 ++++++++++----------
gtk/src/toolbutton.hg | 12 +++++++-----
2 files changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/gtk/src/actionable.hg b/gtk/src/actionable.hg
index 77185ba..697f22e 100644
--- a/gtk/src/actionable.hg
+++ b/gtk/src/actionable.hg
@@ -30,20 +30,20 @@ typedef struct _GtkActionableInterface GtkActionableInterface;
namespace Gtk
{
-//TODO: Have the appropriate widgets derive from this interface when there is
-//an ABI break. See:
-//http://developer.gnome.org/gtk3/3.3/GtkActionable.html#GtkActionable.implementations.
-
-/** This interface provides a convenient way of associating widgets with
- * actions on a ApplicationWindow or Application.
+/** An interface for widgets that can be associated with actions.
+ *
+ * This interface provides a convenient way of associating widgets with
+ * actions on an ApplicationWindow or Application.
*
* It primarily consists of two properties: "action-name" and "action-target".
* There are also some convenience APIs for setting these properties.
*
- * This interface is presently only meaningful if used on a widget that is (or
- * will be) located inside of a ApplicationWindow and can only be used to
- * associate the widget with actions on that window, or its associated
- * Application.
+ * The action will be looked up in action groups that are found among
+ * the widget's ancestors. Most commonly, these will be the actions with
+ * the “win.” or “app.” prefix that are associated with the ApplicationWindow
+ * or Application, but other action groups that are added with
+ * Widget::insert_action_group() will be consulted as well.
+ *
* @newin{3,4}
*/
class Actionable : public Glib::Interface
diff --git a/gtk/src/toolbutton.hg b/gtk/src/toolbutton.hg
index 9c76983..4da06a2 100644
--- a/gtk/src/toolbutton.hg
+++ b/gtk/src/toolbutton.hg
@@ -17,22 +17,25 @@
*/
#include <gtkmm/toolitem.h>
+#include <gtkmm/actionable.h>
+
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/toolitem_p.h)
namespace Gtk
{
-//TODO: Derive from (and implement) Actionable when we can break ABI.
-
/** A Gtk::ToolItem subclass that displays buttons.
*
- * A ToolButton is are Gtk::ToolItem containing a button.
+ * A ToolButton is a Gtk::ToolItem containing a button.
* @ingroup Widgets
*/
-class ToolButton : public ToolItem
+class ToolButton
+: public ToolItem,
+ public Actionable
{
_CLASS_GTKOBJECT(ToolButton, GtkToolButton, GTK_TOOL_BUTTON, Gtk::ToolItem, GtkToolItem)
+ _IMPLEMENTS_INTERFACE(Actionable)
public:
/** Creates a new ToolButton.
@@ -69,7 +72,6 @@ public:
_WRAP_METHOD(Widget* get_label_widget(), gtk_tool_button_get_label_widget)
_WRAP_METHOD(const Widget* get_label_widget() const, gtk_tool_button_get_label_widget, constversion)
- //TODO: We use this in toolbar.ccg. Check if it should really be deprecated.
_WRAP_SIGNAL(void clicked(), "clicked")
_WRAP_PROPERTY("label", Glib::ustring)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]