[aseprite] 119/308: Add show_popup_menu() internal function in brush_popup.cpp
Tobias Hansen
thansen at moszumanska.debian.org
Tue Mar 8 02:44:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 0f35102a4bd68b61f0ab96ee270813f567c28bc9
Author: David Capello <davidcapello at gmail.com>
Date: Wed Dec 16 10:49:15 2015 -0300
Add show_popup_menu() internal function in brush_popup.cpp
---
src/app/ui/brush_popup.cpp | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/src/app/ui/brush_popup.cpp b/src/app/ui/brush_popup.cpp
index bcd2fa2..3336751 100644
--- a/src/app/ui/brush_popup.cpp
+++ b/src/app/ui/brush_popup.cpp
@@ -48,6 +48,25 @@ using namespace ui;
namespace {
+void show_popup_menu(PopupWindow* popupWindow, Menu* popupMenu,
+ const gfx::Point& pt)
+{
+ // Here we make the popup window temporaly floating, so it's
+ // not closed by the popup menu.
+ popupWindow->makeFloating();
+
+ popupMenu->showPopup(pt);
+
+ // Add the menu popup region to the window popup hot region so it's
+ // not closed after we close the menu.
+ popupWindow->makeFixed();
+
+ gfx::Region rgn;
+ rgn.createUnion(gfx::Region(popupWindow->bounds()),
+ gfx::Region(popupMenu->bounds()));
+ popupWindow->setHotRegion(rgn);
+}
+
class SelectBrushItem : public ButtonSet::Item {
public:
SelectBrushItem(BrushPopupDelegate* delegate, const BrushRef& brush, int slot = -1)
@@ -135,20 +154,8 @@ private:
menu.addChild(new MenuSeparator);
menu.addChild(&deleteAllItem);
- // Here we make the popup window temporaly floating, so it's
- // not closed by the popup menu.
- m_popup->makeFloating();
-
- menu.showPopup(gfx::Point(origin().x, origin().y+bounds().h));
-
- // Add the menu popup region to the hot region so the BrushPopup (m_popup)
- // isn't closed after we click the menu popup.
- m_popup->makeFixed();
-
- gfx::Region rgn;
- rgn.createUnion(gfx::Region(m_popup->bounds()),
- gfx::Region(menu.bounds()));
- m_popup->setHotRegion(rgn);
+ show_popup_menu(m_popup, &menu,
+ gfx::Point(origin().x, origin().y+bounds().h));
}
private:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list