From ea96647ca6d6537caf0ba6493cf7ededf96b1daa Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 4 Sep 2011 15:09:27 +0000 Subject: [PATCH] *ColorPopup: Fixed crashing in Linux git-svn-id: svn://ultimatepp.org/upp/trunk@3815 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/ColorPopup.cpp | 5 ++++- uppsrc/CtrlLib/DlgColor.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/uppsrc/CtrlLib/ColorPopup.cpp b/uppsrc/CtrlLib/ColorPopup.cpp index 46c3011e2..7d6a6904d 100644 --- a/uppsrc/CtrlLib/ColorPopup.cpp +++ b/uppsrc/CtrlLib/ColorPopup.cpp @@ -260,7 +260,7 @@ Color ColorPopUp::Get() const } void ColorPopUp::PopupDeactivate() { - if(popup && popup->IsOpen()) { + if(popup && popup->IsOpen() && !animating) { popup.Clear(); IgnoreMouseClick(); WhenCancel(); @@ -305,10 +305,12 @@ void ColorPopUp::PopUp(Ctrl *owner, Color c) colori = -1; if(GUI_PopUpEffect()) { + animating = true; popup->PopUp(owner, true, true, GUI_GlobalStyle() >= GUISTYLE_XP); SetFocus(); Ctrl::ProcessEvents(); Animate(*popup, rt, GUIEFFECT_SLIDE); + animating = false; } popup->SetRect(rt); @@ -328,6 +330,7 @@ ColorPopUp::ColorPopUp() norampwheel = false; notnull = false; scolors = false; + animating = false; SetFrame(MenuFrame()); Add(ramp); Add(wheel); diff --git a/uppsrc/CtrlLib/DlgColor.h b/uppsrc/CtrlLib/DlgColor.h index 3f1ef383e..b93791e0b 100644 --- a/uppsrc/CtrlLib/DlgColor.h +++ b/uppsrc/CtrlLib/DlgColor.h @@ -167,6 +167,7 @@ private: bool notnull; bool scolors; bool norampwheel; + bool animating; String nulltext; Color color;