mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
39 lines
819 B
C++
39 lines
819 B
C++
// Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
|
|
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
|
//
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
#ifndef VOLUMESLIDER_H
|
|
#define VOLUMESLIDER_H
|
|
|
|
#include <DSlider>
|
|
#include <QTimer>
|
|
|
|
class VolumeSlider : public DTK_WIDGET_NAMESPACE::DSlider
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit VolumeSlider(QWidget *parent = 0);
|
|
|
|
void setValue(const int value);
|
|
|
|
signals:
|
|
void requestPlaySoundEffect() const;
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent *e) override;
|
|
void mouseMoveEvent(QMouseEvent *e) override;
|
|
void mouseReleaseEvent(QMouseEvent *e) override;
|
|
void wheelEvent(QWheelEvent *e) override;
|
|
|
|
private slots:
|
|
void onTimeout();
|
|
|
|
private:
|
|
bool m_pressed;
|
|
QTimer *m_timer;
|
|
};
|
|
|
|
#endif // VOLUMESLIDER_H
|