Commit c3d42c4c by Ruben Rodriguez

Fixed indicator applet menu scrolling

parent 07676c0d
......@@ -3,7 +3,7 @@
diff --git indicator-applet/src/applet-main.c indicator-applet/src/applet-main.c
--- indicator-applet/src/applet-main.c
+++ indicator-applet/src/applet-main.c
@@ -362,6 +362,21 @@ accessible_desc_update (IndicatorObject
@@ -362,6 +362,24 @@ accessible_desc_update (IndicatorObject
return;
}
......@@ -11,25 +11,32 @@ diff --git indicator-applet/src/applet-main.c indicator-applet/src/applet-main.c
+do_menu_reposition(gpointer menu)
+{
+ gtk_widget_set_size_request(menu, -1, -1);
+ gtk_menu_reposition(menu);
+ g_timeout_add(20, (GSourceFunc) gtk_menu_reposition, (gpointer) menu);
+ g_timeout_add(20, (GSourceFunc) gtk_menu_reposition, (gpointer) menu);
+ return 0;
+}
+
+static void
+on_menuitem_show (GtkMenuItem *menuitem, gpointer menu)
+{
+{
+ gtk_widget_set_size_request(menu, -1, 500);
+ gtk_menu_reposition(menu);
+ g_idle_add((GSourceFunc) do_menu_reposition, (gpointer) menu);
+}
+
static void
entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menubar)
{
@@ -435,6 +450,7 @@ entry_added (IndicatorObject * io, Indic
@@ -435,6 +450,11 @@ entry_added (IndicatorObject * io, Indic
if (entry->menu != NULL) {
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu));
+ g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(on_menuitem_show), entry->menu);
+ gtk_menu_set_reserve_toggle_size(entry->menu, TRUE);
+ gtk_widget_set_size_request(entry->menu, -1, -1);
+ gtk_widget_set_size_request(entry->menu, -1, 500);
+ gtk_menu_reposition(entry->menu);
}
place_in_menu(menubar, menuitem, io, entry);
......@@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
VERSION=1
VERSION=2
. ./config
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment