1
0
mirror of https://github.com/aseprite/aseprite.git synced 2025-03-25 10:43:46 +00:00

Don't show the notification flag on Advanced Mode

This commit is contained in:
David Capello 2020-06-17 12:40:11 -03:00
parent 89a896d627
commit f0c9db7041
4 changed files with 13 additions and 8 deletions

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2018-2019 Igara Studio S.A.
// Copyright (C) 2018-2020 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
@ -533,6 +533,7 @@ void MainWindow::configureWorkspaceLayout()
}
m_menuBar->setVisible(normal);
m_notifications->setVisible(normal && m_notifications->hasNotifications());
m_tabsBar->setVisible(normal);
colorBarPlaceholder()->setVisible(normal && isDoc);
m_toolBar->setVisible(normal && isDoc);

@ -1,4 +1,5 @@
// Aseprite
// Copyright (C) 2020 Igara Studio S.A.
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
@ -41,14 +42,14 @@ private:
Notifications::Notifications()
: Button("")
, m_flagStyle(skin::SkinTheme::instance()->styles.flag())
, m_withNotifications(false)
, m_red(false)
{
}
void Notifications::addLink(INotificationDelegate* del)
{
m_popup.addChild(new NotificationItem(del));
m_withNotifications = true;
m_red = true;
}
void Notifications::onSizeHint(SizeHintEvent& ev)
@ -62,7 +63,7 @@ void Notifications::onPaint(PaintEvent& ev)
PaintWidgetPartInfo info;
if (hasMouseOver()) info.styleFlags |= ui::Style::Layer::kMouse;
if (m_withNotifications) info.styleFlags |= ui::Style::Layer::kFocus;
if (m_red) info.styleFlags |= ui::Style::Layer::kFocus;
if (isSelected()) info.styleFlags |= ui::Style::Layer::kSelected;
theme()->paintWidgetPart(
@ -71,7 +72,7 @@ void Notifications::onPaint(PaintEvent& ev)
void Notifications::onClick(ui::Event& ev)
{
m_withNotifications = false;
m_red = false;
invalidate();
gfx::Rect bounds = this->bounds();

@ -1,4 +1,5 @@
// Aseprite
// Copyright (C) 2020 Igara Studio S.A.
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
@ -23,6 +24,7 @@ namespace app {
Notifications();
void addLink(INotificationDelegate* del);
bool hasNotifications() const { return m_popup.hasChildren(); }
protected:
void onSizeHint(ui::SizeHintEvent& ev) override;
@ -31,7 +33,7 @@ namespace app {
private:
ui::Style* m_flagStyle;
bool m_withNotifications;
bool m_red;
ui::Menu m_popup;
};

@ -167,16 +167,17 @@ namespace ui {
// Returns a list of children.
const WidgetsList& children() const { return m_children; }
bool hasChildren() const { return !m_children.empty(); }
Widget* at(int index) { return m_children[index]; }
int getChildIndex(Widget* child);
// Returns the first/last child or nullptr if it doesn't exist.
Widget* firstChild() {
return (!m_children.empty() ? m_children.front(): nullptr);
return (hasChildren() ? m_children.front(): nullptr);
}
Widget* lastChild() {
return (!m_children.empty() ? m_children.back(): nullptr);
return (hasChildren() ? m_children.back(): nullptr);
}
// Returns the next or previous siblings.