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/site.h"
|
||||||
#include "doc/sprite.h"
|
#include "doc/sprite.h"
|
||||||
#include "gfx/rect_io.h"
|
#include "gfx/rect_io.h"
|
||||||
#include "ui/size_hint_event.h"
|
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
|
||||||
namespace app {
|
namespace app {
|
||||||
@ -292,6 +291,7 @@ void ColorButton::openPopup(const bool forcePinned)
|
|||||||
|
|
||||||
if (m_window == NULL) {
|
if (m_window == NULL) {
|
||||||
m_window = new ColorPopup(m_options);
|
m_window = new ColorPopup(m_options);
|
||||||
|
m_window->Close.connect(&ColorButton::onWindowClose, this);
|
||||||
m_window->ColorChange.connect(&ColorButton::onWindowColorChange, this);
|
m_window->ColorChange.connect(&ColorButton::onWindowColorChange, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,10 +336,13 @@ void ColorButton::openPopup(const bool forcePinned)
|
|||||||
|
|
||||||
void ColorButton::closePopup()
|
void ColorButton::closePopup()
|
||||||
{
|
{
|
||||||
if (m_window) {
|
if (m_window)
|
||||||
m_hiddenPopupBounds = m_window->bounds();
|
|
||||||
m_window->closeWindow(nullptr);
|
m_window->closeWindow(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ColorButton::onWindowClose(ui::CloseEvent& ev)
|
||||||
|
{
|
||||||
|
m_hiddenPopupBounds = m_window->bounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorButton::onWindowColorChange(const app::Color& color)
|
void ColorButton::onWindowColorChange(const app::Color& color)
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "ui/button.h"
|
#include "ui/button.h"
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
class CloseEvent;
|
||||||
class InitThemeEvent;
|
class InitThemeEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,6 +61,7 @@ namespace app {
|
|||||||
void onSaveLayout(ui::SaveLayoutEvent& ev) override;
|
void onSaveLayout(ui::SaveLayoutEvent& ev) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void onWindowClose(ui::CloseEvent& ev);
|
||||||
void onWindowColorChange(const app::Color& color);
|
void onWindowColorChange(const app::Color& color);
|
||||||
void onActiveSiteChange(const Site& site) override;
|
void onActiveSiteChange(const Site& site) override;
|
||||||
bool canPin() const { return m_options.canPinSelector; }
|
bool canPin() const { return m_options.canPinSelector; }
|
||||||
|
Loading…
Reference in New Issue
Block a user