#pragma once
#include <QColor>
#include <QWidget>

class RangeSlider : public QWidget
{
	Q_OBJECT

	int minRange = 0, maxRange = 100, minSliderValue = 25, maxSliderValue = 75;
	QColor rangeColor, sliderRangeColor;
public:
	RangeSlider(QWidget *parent);
	~RangeSlider();
	void setMinSliderValue(int value);
	void setMaxSliderValue(int value);
	void setRange(int min, int max);
	void setMinRange(int value);
	void setMaxRange(int value);

	//Visual Settings:
	void setRangeColor(QColor color);
	void setSliderRangeColor(QColor color);
private:
	void paintEvent(QPaintEvent* event) override;
	void mouseMoveEvent(QMouseEvent* event) override;
	void mousePressEvent(QMouseEvent* event) override;
	void updateSliderPosition(QMouseEvent* event);

	int maxPos();
	int minPos();


signals:
	void maxChanged(int max);
	void minChanged(int min);
};
