Disable the easy close disabled cache.
So code refactoring fails with this cache enabled and it works well without. If changes to the easy close status happen at runtime some oddities might occur, but I consider if that happens there has been a design failure in the dialog.
This commit is contained in:
parent
7581d8faf4
commit
2f2d2326ae
2 changed files with 6 additions and 12 deletions
|
@ -234,7 +234,6 @@ twindow::twindow(CVideo& video,
|
|||
, w_(w)
|
||||
, h_(h)
|
||||
, easy_close_(false)
|
||||
, easy_close_disabled_(false)
|
||||
, enter_disabled_(false)
|
||||
, escape_disabled_(false)
|
||||
, linked_size_()
|
||||
|
@ -383,7 +382,6 @@ int twindow::show(const bool restore, const unsigned auto_close_timeout)
|
|||
* reinvalidate the window to avoid those glitches.
|
||||
*/
|
||||
invalidate_layout();
|
||||
easy_close_disabled_ = easy_close_ && disable_easy_close();
|
||||
suspend_drawing_ = false;
|
||||
|
||||
if(auto_close_timeout) {
|
||||
|
|
|
@ -254,10 +254,15 @@ public:
|
|||
/**
|
||||
* Does the window close easily?
|
||||
*
|
||||
* The behaviour can change at run-time, but that might cause oddities
|
||||
* with the easy close button (when one is needed).
|
||||
*
|
||||
* @returns Whether or not the window closes easily.
|
||||
*/
|
||||
bool does_easy_close() const
|
||||
{ return easy_close_ && !easy_close_disabled_; }
|
||||
{
|
||||
return easy_close_ && !disable_easy_close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the enter key.
|
||||
|
@ -450,15 +455,6 @@ private:
|
|||
*/
|
||||
bool easy_close_;
|
||||
|
||||
/**
|
||||
* Hold the state of the easy close disable state.
|
||||
*
|
||||
* This value is set on showing and remains valid for the entire time
|
||||
* shown. This means the easy close can't be changed on run-time, which
|
||||
* is good since an extra close button might be needed.
|
||||
*/
|
||||
bool easy_close_disabled_;
|
||||
|
||||
/** Disable the enter key see our setter for more info. */
|
||||
bool enter_disabled_;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue