mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 08:06:09 +00:00
I'm going with a global top-of-the-screen menu instead of per-window menus. The basic idea is that menus will live in the WindowServer and clients can create menus via WindowServer requests.
25 lines
434 B
C++
25 lines
434 B
C++
#pragma once
|
|
|
|
#include "WSMenu.h"
|
|
#include <AK/Vector.h>
|
|
|
|
class WSMenuBar {
|
|
public:
|
|
WSMenuBar();
|
|
~WSMenuBar();
|
|
|
|
void add_menu(OwnPtr<WSMenu>&& menu) { m_menus.append(move(menu)); }
|
|
|
|
template<typename Callback>
|
|
void for_each_menu(Callback callback)
|
|
{
|
|
for (auto& menu : m_menus) {
|
|
if (!callback(*menu))
|
|
return;
|
|
}
|
|
}
|
|
|
|
private:
|
|
Vector<OwnPtr<WSMenu>> m_menus;
|
|
};
|