feat: 添加ElaWidgetTool库

This commit is contained in:
sleepwithoutbz
2025-09-19 22:40:52 +08:00
parent 5f93e8caf6
commit 4eef5c7fd5
407 changed files with 36325 additions and 7 deletions

View File

@@ -0,0 +1,28 @@
#ifndef ELASCROLLBARSTYLE_H
#define ELASCROLLBARSTYLE_H
#include <QProxyStyle>
#include "ElaDef.h"
class ElaScrollBar;
class ElaScrollBarStyle : public QProxyStyle
{
Q_OBJECT
Q_PRIVATE_CREATE(bool, IsExpand)
Q_PROPERTY_CREATE(qreal, Opacity)
Q_PROPERTY_CREATE(qreal, SliderExtent)
Q_PRIVATE_CREATE(ElaScrollBar*, ScrollBar)
public:
explicit ElaScrollBarStyle(QStyle* style = nullptr);
~ElaScrollBarStyle();
void drawComplexControl(ComplexControl control, const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget = nullptr) const override;
int pixelMetric(PixelMetric metric, const QStyleOption* option = nullptr, const QWidget* widget = nullptr) const override;
int styleHint(StyleHint hint, const QStyleOption* option = nullptr, const QWidget* widget = nullptr, QStyleHintReturn* returnData = nullptr) const override;
void startExpandAnimation(bool isExpand);
private:
ElaThemeType::ThemeMode _themeMode;
qreal _sliderMargin{2.5};
int _scrollBarExtent{10};
};
#endif // ELASCROLLBARSTYLE_H