mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
44
Libraries/LibGUI/GTabWidget.h
Normal file
44
Libraries/LibGUI/GTabWidget.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GWidget.h>
|
||||
|
||||
class GTabWidget : public GWidget {
|
||||
public:
|
||||
explicit GTabWidget(GWidget* parent);
|
||||
virtual ~GTabWidget() override;
|
||||
|
||||
GWidget* active_widget() const { return m_active_widget; }
|
||||
void set_active_widget(GWidget*);
|
||||
|
||||
int bar_height() const { return 21; }
|
||||
int container_padding() const { return 2; }
|
||||
|
||||
void add_widget(const StringView&, GWidget*);
|
||||
|
||||
virtual const char* class_name() const override { return "GTabWidget"; }
|
||||
|
||||
protected:
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void child_event(CChildEvent&) override;
|
||||
virtual void resize_event(GResizeEvent&) override;
|
||||
virtual void mousedown_event(GMouseEvent&) override;
|
||||
virtual void mousemove_event(GMouseEvent&) override;
|
||||
virtual void leave_event(CEvent&) override;
|
||||
|
||||
private:
|
||||
Rect child_rect_for_size(const Size&) const;
|
||||
Rect button_rect(int index) const;
|
||||
Rect bar_rect() const;
|
||||
void update_bar();
|
||||
|
||||
GWidget* m_active_widget { nullptr };
|
||||
|
||||
struct TabData {
|
||||
Rect rect(const Font&) const;
|
||||
int width(const Font&) const;
|
||||
String title;
|
||||
GWidget* widget { nullptr };
|
||||
};
|
||||
Vector<TabData> m_tabs;
|
||||
int m_hovered_tab_index { -1 };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue