[gnote] * BUG: Fix the position of the menu in case of popping upward.
- From: Hubert Figuiere <hub src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnote] * BUG: Fix the position of the menu in case of popping upward.
- Date: Wed, 15 Apr 2009 19:53:00 -0400 (EDT)
commit de3a904e26d59c5a9ea699e273c4488e30aef5b6
Author: Hubert Figuiere <hub figuiere net>
Date: Wed Apr 15 18:44:23 2009 -0400
* BUG: Fix the position of the menu in case of popping upward.
(Close #578958)
---
NEWS | 4 +++-
src/tray.cpp | 11 +++++++----
src/tray.hpp | 2 +-
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index 9b1fe2d..cd3c45f 100644
--- a/NEWS
+++ b/NEWS
@@ -7,7 +7,9 @@
* BUG: Fixed typos in man page.
* BUG: Remove the use of gettext calls that are only in glib 2.18
* BUG: Fix Note search that didn't work. (Close #578956) (Wade Berrier)
- * NEW: Imported the manual (Closes: #578982)
+ * BUG: Fix the position of the menu in case of popping upward.
+ (Close #578958)
+ * NEW: Imported the manual (Close #578982)
* NEW: Addin preferences. (TO FINISH)
* Clarified some (c) notices.
diff --git a/src/tray.cpp b/src/tray.cpp
index 45f8a5a..d0fd59e 100644
--- a/src/tray.cpp
+++ b/src/tray.cpp
@@ -429,7 +429,9 @@ namespace gnote {
if(select_first_item) {
m_tray->tray_menu()->select_first(false);
}
- utils::popup_menu(*m_tray->tray_menu(), NULL, sigc::mem_fun(*this, &TrayIcon::get_tray_menu_pos));
+ utils::popup_menu(*m_tray->tray_menu(), NULL,
+ sigc::bind(sigc::mem_fun(*this, &TrayIcon::get_tray_menu_pos),
+ m_tray->tray_menu()));
}
TrayIcon::~TrayIcon()
@@ -449,12 +451,13 @@ namespace gnote {
DBG_OUT("popup");
if(button == 3) {
Gtk::Menu *menu = get_right_click_menu();
- utils::popup_menu(*menu, NULL, sigc::mem_fun(*this, &TrayIcon::get_tray_menu_pos));
+ utils::popup_menu(*menu, NULL,
+ sigc::bind(sigc::mem_fun(*this, &TrayIcon::get_tray_menu_pos), menu));
}
}
- void TrayIcon::get_tray_menu_pos(int & x, int &y, bool & push_in)
+ void TrayIcon::get_tray_menu_pos(int & x, int &y, bool & push_in, Gtk::Menu * menu)
{
push_in = true;
x = 0;
@@ -471,7 +474,7 @@ namespace gnote {
y = area.get_y();
Gtk::Requisition menu_req;
- get_right_click_menu()->size_request (menu_req);
+ menu->size_request (menu_req);
if (y + menu_req.height >= gdk_screen_get_height(cscreen)/*screen->get_height()*/) {
y -= menu_req.height;
}
diff --git a/src/tray.hpp b/src/tray.hpp
index 419f49c..6c958bc 100644
--- a/src/tray.hpp
+++ b/src/tray.hpp
@@ -106,7 +106,7 @@ public:
void show_menu(bool select_first_item);
- void get_tray_menu_pos(int & x, int &y, bool & push_in);
+ void get_tray_menu_pos(int & x, int &y, bool & push_in, Gtk::Menu *);
Gtk::Menu * get_right_click_menu();
void on_activate();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]