mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
24 lines
490 B
C++
24 lines
490 B
C++
#pragma once
|
|
|
|
#include "Widget.h"
|
|
|
|
class ListBox final : public Widget {
|
|
public:
|
|
explicit ListBox(Widget* parent);
|
|
virtual ~ListBox() override;
|
|
|
|
void addItem(String&&);
|
|
int selectedIndex() const { return m_selectedIndex; }
|
|
|
|
private:
|
|
virtual void paintEvent(PaintEvent&) override;
|
|
virtual void mouseDownEvent(MouseEvent&) override;
|
|
|
|
unsigned itemHeight() const;
|
|
|
|
unsigned m_scrollOffset { 0 };
|
|
int m_selectedIndex { -1 };
|
|
|
|
Vector<String> m_items;
|
|
};
|
|
|