Cleanups II.
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTableView>
|
||||
#include <QSlider>
|
||||
#include <QPainter>
|
||||
#include <QProxyStyle>
|
||||
|
||||
#include <bcvalue.h>
|
||||
#include <ui_bcvalueslider.h>
|
||||
@@ -25,6 +29,9 @@ public:
|
||||
// helper functions
|
||||
static QRect updateEditorRect( const QRect& rect);
|
||||
|
||||
static void paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio );
|
||||
static void paintSliderIndicator2(QPainter* painter, const QRect& rect, double ratio );
|
||||
|
||||
signals:
|
||||
|
||||
void valueChanged(int value);
|
||||
@@ -32,6 +39,22 @@ signals:
|
||||
|
||||
protected:
|
||||
|
||||
// Fluent Design Slider Style
|
||||
class BCValueSliderStyle : public QProxyStyle
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
BCValueSliderStyle();
|
||||
|
||||
int pixelMetric(PixelMetric metric, const QStyleOption* option = nullptr, const QWidget* widget = nullptr) const override;
|
||||
|
||||
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex* opt, SubControl sc, const QWidget* widget) const override;
|
||||
void drawComplexControl(ComplexControl control, const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget) const override;
|
||||
void drawHorizontalFluentSlider(QPainter* painter, const QStyleOptionSlider* slider, const QColor& activeColor, const QColor& bgColor) const;
|
||||
|
||||
};
|
||||
|
||||
static constexpr int cTextBlockOffset = 130;
|
||||
static constexpr int cPaddingRight = 8;
|
||||
static constexpr int cSliderWidth = 117;
|
||||
|
||||
Reference in New Issue
Block a user