mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
Everywhere: Move the Ladybird folder to UI
This commit is contained in:
parent
93712b24bf
commit
db47cc41f8
Notes:
github-actions[bot]
2024-11-10 11:51:45 +00:00
Author: https://github.com/trflynn89
Commit: db47cc41f8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
203 changed files with 266 additions and 244 deletions
67
UI/Qt/TabBar.h
Normal file
67
UI/Qt/TabBar.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
|
||||
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
* Copyright (c) 2024, Sam Atkins <sam@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QProxyStyle>
|
||||
#include <QPushButton>
|
||||
#include <QTabBar>
|
||||
#include <QTabWidget>
|
||||
|
||||
class QContextMenuEvent;
|
||||
class QEvent;
|
||||
class QIcon;
|
||||
class QWidget;
|
||||
|
||||
namespace Ladybird {
|
||||
|
||||
class TabBar : public QTabBar {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TabBar(QWidget* parent = nullptr);
|
||||
|
||||
virtual QSize tabSizeHint(int index) const override;
|
||||
virtual void contextMenuEvent(QContextMenuEvent* event) override;
|
||||
|
||||
private:
|
||||
void mousePressEvent(QMouseEvent*) override;
|
||||
void mouseMoveEvent(QMouseEvent*) override;
|
||||
|
||||
int m_x_position_in_selected_tab_while_dragging;
|
||||
};
|
||||
|
||||
class TabWidget : public QTabWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TabWidget(QWidget* parent = nullptr);
|
||||
|
||||
virtual void paintEvent(QPaintEvent*) override;
|
||||
};
|
||||
|
||||
class TabBarButton : public QPushButton {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TabBarButton(QIcon const& icon, QWidget* parent = nullptr);
|
||||
|
||||
protected:
|
||||
virtual bool event(QEvent* event) override;
|
||||
};
|
||||
|
||||
class TabStyle : public QProxyStyle {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TabStyle(QObject* parent = nullptr);
|
||||
|
||||
virtual QRect subElementRect(QStyle::SubElement, QStyleOption const*, QWidget const*) const override;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue