summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-23 15:57:11 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-02-24 16:26:12 +0000
commita0c700b1493c7b51540d1e77b44d1edd9bf920f0 (patch)
tree82f6dda078f70f27e40666e6e68d0ea4d3c9c40f /vcl/inc
parentadea1c3dd147eab9308bfecf9439f693981be9c1 (diff)
gtk3: implement native context menus
This reuses lots of the unity machinery which is similar to the mac concept of a single toplevel menubar. So to drive popup menus, part of this is a rework that does away with the idea that the "menubar" is the controller of the hierarchy, and instead the top element becomes the controller Change-Id: I4336391718844bc73cfc47c1043f99f0e3b812d8
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/unx/gtk/gloactiongroup.h3
-rw-r--r--vcl/inc/unx/gtk/gtksalmenu.hxx9
2 files changed, 9 insertions, 3 deletions
diff --git a/vcl/inc/unx/gtk/gloactiongroup.h b/vcl/inc/unx/gtk/gloactiongroup.h
index 080b679d38f6..ec6bd396698c 100644
--- a/vcl/inc/unx/gtk/gloactiongroup.h
+++ b/vcl/inc/unx/gtk/gloactiongroup.h
@@ -46,6 +46,9 @@ GType g_lo_action_group_get_type (void) G_GNUC_CONST;
GLOActionGroup * g_lo_action_group_new (gpointer frame);
+void g_lo_action_group_set_top_menu (GLOActionGroup *group,
+ gpointer top_menu);
+
void g_lo_action_group_insert (GLOActionGroup *group,
const gchar *action_name,
gint item_id,
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index c323301ded2c..1697d0b95240 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -44,16 +44,17 @@ private:
std::vector< GtkSalMenuItem* > maItems;
bool mbMenuBar;
+ bool mbMenuVisibility;
Menu* mpVCLMenu;
GtkSalMenu* mpParentSalMenu;
- const GtkSalFrame* mpFrame;
+ GtkSalFrame* mpFrame;
// GMenuModel and GActionGroup attributes
GMenuModel* mpMenuModel;
GActionGroup* mpActionGroup;
GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, gboolean bGetSubmenu );
- void ImplUpdate( gboolean bRecurse );
+ void ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries);
void ActivateAllSubmenus(Menu* pMenuBar);
public:
@@ -78,7 +79,7 @@ public:
void SetMenu( Menu* pMenu ) { mpVCLMenu = pMenu; }
Menu* GetMenu() { return mpVCLMenu; }
- void SetMenuModel( GMenuModel* pMenuModel ) { mpMenuModel = pMenuModel; }
+ void SetMenuModel(GMenuModel* pMenuModel);
unsigned GetItemCount() { return maItems.size(); }
GtkSalMenuItem* GetItemAtPos( unsigned nPos ) { return maItems[ nPos ]; }
void SetActionGroup( GActionGroup* pActionGroup ) { mpActionGroup = pActionGroup; }
@@ -103,6 +104,8 @@ public:
bool PrepUpdate();
virtual void Update() override; // Update this menu only.
void UpdateFull(); // Update full menu hierarchy from this menu.
+
+ virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, FloatWinPopupFlags nFlags) override;
};
class GtkSalMenuItem : public SalMenuItem