mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-29 00:23:48 +00:00
Use a hot region equal to the whole manager area for UserDataPopup
This commit is contained in:
parent
e78e9eeb2c
commit
eb6b57c5fb
@ -19,13 +19,31 @@ namespace app {
|
|||||||
|
|
||||||
using namespace ui;
|
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,
|
bool show_user_data_popup(const gfx::Rect& bounds,
|
||||||
doc::UserData& userData)
|
doc::UserData& userData)
|
||||||
{
|
{
|
||||||
app::gen::UserData window;
|
UserDataPopup window;
|
||||||
|
|
||||||
window.text()->setText(userData.text());
|
window.text()->setText(userData.text());
|
||||||
window.setCloseOnKeyDown(false);
|
|
||||||
window.pointAt(TOP, bounds);
|
window.pointAt(TOP, bounds);
|
||||||
|
|
||||||
window.openWindowInForeground();
|
window.openWindowInForeground();
|
||||||
|
|
||||||
if (userData.text() != window.text()->text()) {
|
if (userData.text() != window.text()->text()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user