Use a hot region equal to the whole manager area for UserDataPopup

This commit is contained in:
David Capello 2015-12-11 13:45:02 -03:00
parent e78e9eeb2c
commit eb6b57c5fb

View File

@ -19,13 +19,31 @@ namespace app {
using namespace ui;
namespace {
class UserDataPopup : public app::gen::UserData {
public:
UserDataPopup() {
makeFixed();
setClickBehavior(ClickBehavior::CloseOnClickInOtherWindow);
setEnterBehavior(EnterBehavior::CloseOnEnter);
setCloseOnKeyDown(false);
// The whole manager as hot region
setHotRegion(gfx::Region(manager()->bounds()));
}
};
} // anonymous namespace
bool show_user_data_popup(const gfx::Rect& bounds,
doc::UserData& userData)
{
app::gen::UserData window;
UserDataPopup window;
window.text()->setText(userData.text());
window.setCloseOnKeyDown(false);
window.pointAt(TOP, bounds);
window.openWindowInForeground();
if (userData.text() != window.text()->text()) {