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

@@ -7,42 +7,41 @@
class ElaNavigationNode;
class ElaNavigationView;
class QPropertyAnimation;
class ElaNavigationStyle : public QProxyStyle
{
class ElaNavigationStyle : public QProxyStyle {
Q_OBJECT
Q_PROPERTY_CREATE(qreal, Opacity)
Q_PROPERTY_CREATE(qreal, Rotate)
Q_PROPERTY_CREATE(int, ItemHeight)
Q_PRIVATE_CREATE(ElaNavigationView*, NavigationView)
Q_PRIVATE_CREATE(ElaNavigationView *, NavigationView)
Q_PROPERTY_CREATE(qreal, LastSelectMarkTop)
Q_PROPERTY_CREATE(qreal, LastSelectMarkBottom)
Q_PROPERTY_CREATE(qreal, SelectMarkTop)
Q_PROPERTY_CREATE(qreal, SelectMarkBottom)
Q_PRIVATE_CREATE(QModelIndex, PressIndex)
public:
explicit ElaNavigationStyle(QStyle* style = nullptr);
explicit ElaNavigationStyle(QStyle *style = nullptr);
~ElaNavigationStyle() override;
void drawPrimitive(PrimitiveElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget = nullptr) const override;
void drawControl(ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget = nullptr) const override;
QSize sizeFromContents(ContentsType type, const QStyleOption* option, const QSize& size, const QWidget* widget) const override;
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const override;
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const override;
QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const override;
void navigationNodeStateChange(QVariantMap data);
private:
ElaThemeType::ThemeMode _themeMode;
bool _isSelectMarkDisplay{true};
int _leftPadding{11};
int _iconAreaWidth{40};
int _textRightSpacing{3};
int _indicatorIconAreaWidth{34};
ElaNavigationNode* _opacityAnimationTargetNode{nullptr};
ElaNavigationNode* _expandAnimationTargetNode{nullptr};
ElaNavigationNode* _lastSelectedNode{nullptr};
QPropertyAnimation* _lastSelectMarkTopAnimation{nullptr};
QPropertyAnimation* _lastSelectMarkBottomAnimation{nullptr};
QPropertyAnimation* _selectMarkTopAnimation{nullptr};
QPropertyAnimation* _selectMarkBottomAnimation{nullptr};
bool _compareItemY(ElaNavigationNode* node1, ElaNavigationNode* node2);
bool _isSelectMarkDisplay{true};
int _leftPadding{11};
int _iconAreaWidth{40};
int _textRightSpacing{3};
int _indicatorIconAreaWidth{34};
ElaNavigationNode *_opacityAnimationTargetNode{nullptr};
ElaNavigationNode *_expandAnimationTargetNode{nullptr};
ElaNavigationNode *_lastSelectedNode{nullptr};
QPropertyAnimation *_lastSelectMarkTopAnimation{nullptr};
QPropertyAnimation *_lastSelectMarkBottomAnimation{nullptr};
QPropertyAnimation *_selectMarkTopAnimation{nullptr};
QPropertyAnimation *_selectMarkBottomAnimation{nullptr};
bool _compareItemY(ElaNavigationNode *node1, ElaNavigationNode *node2);
};
#endif // ELANAVIGATIONSTYLE_H