mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-03 21:46:20 +00:00
Update hidden ColorPopup bounds correctly if the window is closed with the close button
This commit is contained in:
parent
a519822a0e
commit
cce73c4a75
@ -25,7 +25,6 @@
|
||||
#include "doc/site.h"
|
||||
#include "doc/sprite.h"
|
||||
#include "gfx/rect_io.h"
|
||||
#include "ui/size_hint_event.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
namespace app {
|
||||
@ -292,6 +291,7 @@ void ColorButton::openPopup(const bool forcePinned)
|
||||
|
||||
if (m_window == NULL) {
|
||||
m_window = new ColorPopup(m_options);
|
||||
m_window->Close.connect(&ColorButton::onWindowClose, this);
|
||||
m_window->ColorChange.connect(&ColorButton::onWindowColorChange, this);
|
||||
}
|
||||
|
||||
@ -336,10 +336,13 @@ void ColorButton::openPopup(const bool forcePinned)
|
||||
|
||||
void ColorButton::closePopup()
|
||||
{
|
||||
if (m_window) {
|
||||
m_hiddenPopupBounds = m_window->bounds();
|
||||
if (m_window)
|
||||
m_window->closeWindow(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void ColorButton::onWindowClose(ui::CloseEvent& ev)
|
||||
{
|
||||
m_hiddenPopupBounds = m_window->bounds();
|
||||
}
|
||||
|
||||
void ColorButton::onWindowColorChange(const app::Color& color)
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "ui/button.h"
|
||||
|
||||
namespace ui {
|
||||
class CloseEvent;
|
||||
class InitThemeEvent;
|
||||
}
|
||||
|
||||
@ -60,6 +61,7 @@ namespace app {
|
||||
void onSaveLayout(ui::SaveLayoutEvent& ev) override;
|
||||
|
||||
private:
|
||||
void onWindowClose(ui::CloseEvent& ev);
|
||||
void onWindowColorChange(const app::Color& color);
|
||||
void onActiveSiteChange(const Site& site) override;
|
||||
bool canPin() const { return m_options.canPinSelector; }
|
||||
|
Loading…
Reference in New Issue
Block a user