mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-07 09:56:59 +00:00
Hide fg/bg color selector dialogs when we are not viewing a document
This commit is contained in:
parent
4119962ee6
commit
bd219ada10
@ -107,8 +107,10 @@ bool ColorButton::onProcessMessage(Message* msg)
|
||||
switch (msg->type()) {
|
||||
|
||||
case kOpenMessage:
|
||||
if (!m_windowDefaultBounds.isEmpty())
|
||||
if (!m_windowDefaultBounds.isEmpty() &&
|
||||
this->isVisible()) {
|
||||
openSelectorDialog();
|
||||
}
|
||||
break;
|
||||
|
||||
case kCloseMessage:
|
||||
@ -317,6 +319,24 @@ void ColorButton::onActiveSiteChange(const Site& site)
|
||||
{
|
||||
if (m_dependOnLayer)
|
||||
invalidate();
|
||||
|
||||
if (m_canPinSelector) {
|
||||
// Hide window
|
||||
if (!site.document()) {
|
||||
if (m_window)
|
||||
m_window->setVisible(false);
|
||||
}
|
||||
// Show window if it's pinned
|
||||
else {
|
||||
// Check if it's pinned from the preferences (m_windowDefaultBounds)
|
||||
if (!m_window && !m_windowDefaultBounds.isEmpty())
|
||||
openSelectorDialog();
|
||||
// Or check if the window was hidden but it's pinned, so we've
|
||||
// to show it again.
|
||||
else if (m_window && m_window->isPinned())
|
||||
m_window->setVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace app
|
||||
|
Loading…
Reference in New Issue
Block a user