summaryrefslogtreecommitdiff
path: root/Services/Taskbar/WindowList.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-07-15 17:44:42 -0600
committerAndreas Kling <kling@serenityos.org>2020-07-16 16:10:21 +0200
commita269e3e573004ebf3a9f29523d2fcc29187dc3d0 (patch)
treeb87d03e67431bf7a33a5cc9a33ab73a49ecf2248 /Services/Taskbar/WindowList.h
parentbbdf0665fc34c0fee7ec367c5e9af0df2407f141 (diff)
downloadserenity-a269e3e573004ebf3a9f29523d2fcc29187dc3d0.zip
Taskbar: Don't create buttons for modal windows
Since the user can't really do much with windows that are blocked by a modal window, there is no point in showing multiple buttons.
Diffstat (limited to 'Services/Taskbar/WindowList.h')
-rw-r--r--Services/Taskbar/WindowList.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/Services/Taskbar/WindowList.h b/Services/Taskbar/WindowList.h
index 7938057d79..975917cf2d 100644
--- a/Services/Taskbar/WindowList.h
+++ b/Services/Taskbar/WindowList.h
@@ -45,7 +45,10 @@ public:
m_button->remove_from_parent();
}
- WindowIdentifier identifier() const { return m_identifier; }
+ const WindowIdentifier& identifier() const { return m_identifier; }
+
+ void set_parent_identifier(const WindowIdentifier& parent_identifier) { m_parent_identifier = parent_identifier; }
+ const WindowIdentifier& parent_identifier() const { return m_parent_identifier; }
String title() const { return m_title; }
void set_title(const String& title) { m_title = title; }
@@ -62,12 +65,16 @@ public:
void set_minimized(bool minimized) { m_minimized = minimized; }
bool is_minimized() const { return m_minimized; }
+ void set_modal(bool modal) { m_modal = modal; }
+ bool is_modal() const { return m_modal; }
+
void set_progress(int progress)
{
if (m_progress == progress)
return;
m_progress = progress;
- m_button->update();
+ if (m_button)
+ m_button->update();
}
int progress() const { return m_progress; }
@@ -76,12 +83,14 @@ public:
private:
WindowIdentifier m_identifier;
+ WindowIdentifier m_parent_identifier;
String m_title;
Gfx::IntRect m_rect;
RefPtr<GUI::Button> m_button;
RefPtr<Gfx::Bitmap> m_icon;
bool m_active { false };
bool m_minimized { false };
+ bool m_modal { false };
int m_progress { -1 };
};
@@ -96,12 +105,11 @@ public:
callback(*it.value);
}
+ Window* find_parent(const Window&);
Window* window(const WindowIdentifier&);
Window& ensure_window(const WindowIdentifier&);
void remove_window(const WindowIdentifier&);
- Function<NonnullRefPtr<GUI::Button>(const WindowIdentifier&)> aid_create_button;
-
private:
HashMap<WindowIdentifier, NonnullOwnPtr<Window>> m_windows;
};