chore: 格式化ElaWidgetTools代码

This commit is contained in:
sleepwithoutbz
2025-09-20 01:39:00 +08:00
parent d2fded145d
commit 4ab391f8a1
394 changed files with 10913 additions and 15860 deletions

View File

@@ -11,8 +11,7 @@ class ElaAppBar;
class ElaIconButton;
class ElaToolButton;
class QMenu;
class ElaAppBarPrivate : public QObject
{
class ElaAppBarPrivate : public QObject {
Q_OBJECT
Q_D_CREATE(ElaAppBar)
Q_PROPERTY_CREATE_D(bool, IsStayTop)
@@ -20,11 +19,11 @@ class ElaAppBarPrivate : public QObject
Q_PROPERTY_CREATE_D(bool, IsDefaultClosed)
Q_PROPERTY_CREATE_D(bool, IsOnlyAllowMinAndClose)
Q_PROPERTY_CREATE_D(int, AppBarHeight)
Q_PRIVATE_CREATE_D(QWidget*, CustomWidget)
Q_PRIVATE_CREATE_D(QWidget *, CustomWidget)
Q_PROPERTY_CREATE_D(int, CustomWidgetMaximumWidth)
Q_PRIVATE_CREATE_D(QMenu*, CustomMenu)
Q_PRIVATE_CREATE_D(QMenu *, CustomMenu)
public:
explicit ElaAppBarPrivate(QObject* parent = nullptr);
explicit ElaAppBarPrivate(QObject *parent = nullptr);
~ElaAppBarPrivate() override;
Q_SLOT void onMinButtonClicked();
Q_SLOT void onMaxButtonClicked();
@@ -32,35 +31,35 @@ public:
Q_SLOT void onStayTopButtonClicked();
private:
ElaThemeType::ThemeMode _themeMode;
QHBoxLayout* _mainLayout{nullptr};
QVBoxLayout* _iconLabelLayout{nullptr};
QVBoxLayout* _titleLabelLayout{nullptr};
ElaThemeType::ThemeMode _themeMode;
QHBoxLayout *_mainLayout{nullptr};
QVBoxLayout *_iconLabelLayout{nullptr};
QVBoxLayout *_titleLabelLayout{nullptr};
ElaAppBarType::ButtonFlags _buttonFlags;
ElaToolButton* _routeBackButton{nullptr};
ElaToolButton* _navigationButton{nullptr};
ElaToolButton* _themeChangeButton{nullptr};
ElaToolButton* _stayTopButton{nullptr};
ElaToolButton* _minButton{nullptr};
ElaToolButton* _maxButton{nullptr};
ElaIconButton* _closeButton{nullptr};
QScreen* _lastScreen{nullptr};
ElaText* _titleLabel{nullptr};
QLabel* _iconLabel{nullptr};
qint64 _currentWinID{0};
int _lastMinTrackWidth{0};
quint64 _clickTimer{0};
int _edges{0};
int _margins{8};
bool _isHoverMaxButton{false};
int _win7Margins{0};
void _changeMaxButtonAwesome(bool isMaximized);
void _showAppBarMenu(QPoint point);
void _updateCursor(int edges);
bool _containsCursorToItem(QWidget* item);
void _onThemeModeChange(ElaThemeType::ThemeMode themeMode);
int _calculateMinimumWidth();
QVBoxLayout* _createVLayout(QWidget* widget);
ElaToolButton *_routeBackButton{nullptr};
ElaToolButton *_navigationButton{nullptr};
ElaToolButton *_themeChangeButton{nullptr};
ElaToolButton *_stayTopButton{nullptr};
ElaToolButton *_minButton{nullptr};
ElaToolButton *_maxButton{nullptr};
ElaIconButton *_closeButton{nullptr};
QScreen *_lastScreen{nullptr};
ElaText *_titleLabel{nullptr};
QLabel *_iconLabel{nullptr};
qint64 _currentWinID{0};
int _lastMinTrackWidth{0};
quint64 _clickTimer{0};
int _edges{0};
int _margins{8};
bool _isHoverMaxButton{false};
int _win7Margins{0};
void _changeMaxButtonAwesome(bool isMaximized);
void _showAppBarMenu(QPoint point);
void _updateCursor(int edges);
bool _containsCursorToItem(QWidget *item);
void _onThemeModeChange(ElaThemeType::ThemeMode themeMode);
int _calculateMinimumWidth();
QVBoxLayout *_createVLayout(QWidget *widget);
};
#endif // ELAAPPBARPRIVATE_H