ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #01150
[Branch ~indicator-applet-developers/indicator-me/trunk] Rev 86: merging auto-select-entry branch from bratsche
Merge authors:
Cody Russell (bratsche)
Related merge proposals:
https://code.launchpad.net/~bratsche/indicator-me/auto-select-entry/+merge/21177
proposed by: Cody Russell (bratsche)
review: Approve - David Barth (dbarth)
review: Approve - Ted Gould (ted)
------------------------------------------------------------
revno: 86 [merge]
fixes bug(s): https://launchpad.net/bugs/528302
committer: David Barth <david.barth@xxxxxxxxxxxxx>
branch nick: indicator-me
timestamp: Fri 2010-03-12 21:00:41 +0100
message:
merging auto-select-entry branch from bratsche
modified:
src/indicator-me.c
--
lp:indicator-me
https://code.launchpad.net/~indicator-applet-developers/indicator-me/trunk
Your team ayatana-commits is subscribed to branch lp:indicator-me.
To unsubscribe from this branch go to https://code.launchpad.net/~indicator-applet-developers/indicator-me/trunk/+edit-subscription.
=== modified file 'src/indicator-me.c'
--- src/indicator-me.c 2010-03-11 17:10:36 +0000
+++ src/indicator-me.c 2010-03-12 20:00:41 +0000
@@ -7,17 +7,18 @@
Authors:
Ted Gould <ted@xxxxxxxxxxxxx>
+ Cody Russell <cody.russell@xxxxxxxxxxxxx>
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 3, as published
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 3, as published
by the Free Software Foundation.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranties of
- MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranties of
+ MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -253,9 +254,32 @@
}
static gboolean
+menu_visibility_changed (GtkWidget *widget,
+ IdoEntryMenuItem *menuitem)
+{
+ gtk_menu_shell_select_item (GTK_MENU_SHELL (widget), GTK_WIDGET (menuitem));
+
+ return FALSE;
+}
+
+static void
+entry_parent_changed (GtkWidget *widget,
+ gpointer user_data)
+{
+ GtkWidget *parent = gtk_widget_get_parent (widget);
+
+ if (parent && GTK_IS_MENU_SHELL (parent))
+ {
+ g_signal_connect (parent,
+ "map", G_CALLBACK (menu_visibility_changed),
+ widget);
+ }
+}
+
+static gboolean
new_entry_item (DbusmenuMenuitem * newitem,
DbusmenuMenuitem * parent,
- DbusmenuClient * client)
+ DbusmenuClient * client)
{
g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE);
g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE);
@@ -267,6 +291,10 @@
gtk_entry_set_text(entry, dbusmenu_menuitem_property_get(newitem, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT));
gtk_entry_set_width_chars (entry, 23); /* set some nice aspect ratio for the menu */
+ g_signal_connect (ido,
+ "notify::parent", G_CALLBACK (entry_parent_changed),
+ NULL);
+
dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, GTK_MENU_ITEM(ido), parent);
/* disconnect the activate signal that newitem_base connected with the wrong
widget, ie menuitem, and re-connect it with the /entry/ instead */