mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix(cppcheck): cppcheck检查
静态代码检查,按照提示修改了所有合理的警告内容,部分内容为cppcheck误报,不处理 Log: 按照静态代码检查工具给出的结果进行修改
This commit is contained in:
parent
5b2ef91059
commit
ee83bb1cba
@ -45,12 +45,12 @@ public:
|
||||
explicit DockPluginsController(QObject *parent = 0);
|
||||
|
||||
// implements PluginProxyInterface
|
||||
void itemAdded(PluginsItemInterface * const itemInter, const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void itemUpdate(PluginsItemInterface * const itemInter, const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void itemRemoved(PluginsItemInterface * const itemInter, const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void requestWindowAutoHide(PluginsItemInterface * const itemInter, const QString &itemKey, const bool autoHide) Q_DECL_OVERRIDE;
|
||||
void requestRefreshWindowVisible(PluginsItemInterface * const itemInter, const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void requestSetAppletVisible(PluginsItemInterface * const itemInter, const QString &itemKey, const bool visible) Q_DECL_OVERRIDE;
|
||||
void itemAdded(PluginsItemInterface * const itemInter, const QString &itemKey) override;
|
||||
void itemUpdate(PluginsItemInterface * const itemInter, const QString &itemKey) override;
|
||||
void itemRemoved(PluginsItemInterface * const itemInter, const QString &itemKey) override;
|
||||
void requestWindowAutoHide(PluginsItemInterface * const itemInter, const QString &itemKey, const bool autoHide) override;
|
||||
void requestRefreshWindowVisible(PluginsItemInterface * const itemInter, const QString &itemKey) override;
|
||||
void requestSetAppletVisible(PluginsItemInterface * const itemInter, const QString &itemKey, const bool visible) override;
|
||||
|
||||
void startLoader();
|
||||
|
||||
|
@ -44,7 +44,7 @@ class AppItem : public DockItem
|
||||
|
||||
public:
|
||||
explicit AppItem(const QDBusObjectPath &entry, QWidget *parent = nullptr);
|
||||
~AppItem();
|
||||
~AppItem() override;
|
||||
|
||||
const QString appId() const;
|
||||
bool isValid() const;
|
||||
@ -53,9 +53,9 @@ public:
|
||||
QWidget *appDragWidget();
|
||||
void setDockInfo(Dock::Position dockPosition, const QRect &dockGeometry);
|
||||
|
||||
inline ItemType itemType() const Q_DECL_OVERRIDE { return App; }
|
||||
inline ItemType itemType() const override { return App; }
|
||||
QPixmap appIcon(){ return m_appIcon; }
|
||||
virtual QString accessibleName();
|
||||
virtual QString accessibleName() override;
|
||||
|
||||
signals:
|
||||
void requestActivateWindow(const WId wid) const;
|
||||
@ -77,10 +77,10 @@ private:
|
||||
void leaveEvent(QEvent *e) override;
|
||||
void showEvent(QShowEvent *e) override;
|
||||
|
||||
void showHoverTips() Q_DECL_OVERRIDE;
|
||||
void invokedMenuItem(const QString &itemId, const bool checked) Q_DECL_OVERRIDE;
|
||||
const QString contextMenu() const Q_DECL_OVERRIDE;
|
||||
QWidget *popupTips() Q_DECL_OVERRIDE;
|
||||
void showHoverTips() override;
|
||||
void invokedMenuItem(const QString &itemId, const bool checked) override;
|
||||
const QString contextMenu() const override;
|
||||
QWidget *popupTips() override;
|
||||
void startDrag();
|
||||
bool hasAttention() const;
|
||||
|
||||
@ -88,7 +88,7 @@ private:
|
||||
|
||||
private slots:
|
||||
void updateWindowInfos(const WindowInfoMap &info);
|
||||
void refershIcon() Q_DECL_OVERRIDE;
|
||||
void refershIcon() override;
|
||||
void activeChanged();
|
||||
void showPreview();
|
||||
void playSwingEffect();
|
||||
|
@ -21,10 +21,11 @@
|
||||
|
||||
#include "appdrag.h"
|
||||
|
||||
AppDrag::AppDrag(QObject *dragSource) : QDrag(dragSource)
|
||||
AppDrag::AppDrag(QObject *dragSource)
|
||||
: QDrag(dragSource)
|
||||
, m_appDragWidget(new AppDragWidget)
|
||||
{
|
||||
// delete by itself
|
||||
m_appDragWidget = new AppDragWidget;
|
||||
m_appDragWidget->setVisible(false);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
class AppDrag : public QDrag
|
||||
{
|
||||
public:
|
||||
AppDrag(QObject *dragSource);
|
||||
explicit AppDrag(QObject *dragSource);
|
||||
virtual ~AppDrag();
|
||||
|
||||
void setPixmap(const QPixmap &);
|
||||
|
@ -26,8 +26,8 @@
|
||||
class AppGraphicsObject : public QGraphicsObject
|
||||
{
|
||||
public:
|
||||
AppGraphicsObject(QGraphicsItem *parent = Q_NULLPTR) : QGraphicsObject(parent) {}
|
||||
~AppGraphicsObject() { }
|
||||
explicit AppGraphicsObject(QGraphicsItem *parent = Q_NULLPTR) : QGraphicsObject(parent) {}
|
||||
~AppGraphicsObject() override { }
|
||||
|
||||
void setAppPixmap(QPixmap pix)
|
||||
{
|
||||
@ -44,13 +44,12 @@ public:
|
||||
update();
|
||||
}
|
||||
|
||||
QRectF boundingRect() const Q_DECL_OVERRIDE
|
||||
QRectF boundingRect() const override
|
||||
{
|
||||
return m_appPixmap.rect();
|
||||
}
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE
|
||||
{
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) override {
|
||||
Q_ASSERT(!m_appPixmap.isNull());
|
||||
|
||||
painter->drawPixmap(QPoint(0, 0), m_appPixmap);
|
||||
@ -89,13 +88,14 @@ AppDragWidget::AppDragWidget(QWidget *parent) :
|
||||
m_followMouseTimer->setSingleShot(false);
|
||||
m_followMouseTimer->setInterval(1);
|
||||
connect(m_followMouseTimer, &QTimer::timeout, [this] {
|
||||
QPoint destPos = QCursor::pos();
|
||||
move(destPos.x() - width() / 2, destPos.y() - height() / 2);
|
||||
});
|
||||
QPoint destPos = QCursor::pos();
|
||||
move(destPos.x() - width() / 2, destPos.y() - height() / 2);
|
||||
});
|
||||
m_followMouseTimer->start();
|
||||
}
|
||||
|
||||
AppDragWidget::~AppDragWidget() {
|
||||
AppDragWidget::~AppDragWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void AppDragWidget::mouseMoveEvent(QMouseEvent *event)
|
||||
@ -203,7 +203,7 @@ void AppDragWidget::showGoBackAnimation()
|
||||
}
|
||||
|
||||
void AppDragWidget::onRemoveAnimationStateChanged(QAbstractAnimation::State newState,
|
||||
QAbstractAnimation::State oldState)
|
||||
QAbstractAnimation::State oldState)
|
||||
{
|
||||
if (newState == QAbstractAnimation::Stopped) {
|
||||
hide();
|
||||
@ -213,28 +213,28 @@ bool AppDragWidget::isRemoveAble()
|
||||
{
|
||||
const QPoint &p = QCursor::pos();
|
||||
switch (m_dockPosition) {
|
||||
case Dock::Position::Left:
|
||||
if ((p.x() - m_dockGeometry.topRight().x()) > (m_dockGeometry.width() * 3)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Dock::Position::Top:
|
||||
if ((p.y() - m_dockGeometry.bottomLeft().y()) > (m_dockGeometry.height() * 3)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Dock::Position::Right:
|
||||
if ((m_dockGeometry.topLeft().x() - p.x()) > (m_dockGeometry.width() * 3)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Dock::Position::Bottom:
|
||||
if ((m_dockGeometry.topLeft().y() - p.y()) > (m_dockGeometry.height() * 3)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case Dock::Position::Left:
|
||||
if ((p.x() - m_dockGeometry.topRight().x()) > (m_dockGeometry.width() * 3)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Dock::Position::Top:
|
||||
if ((p.y() - m_dockGeometry.bottomLeft().y()) > (m_dockGeometry.height() * 3)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Dock::Position::Right:
|
||||
if ((m_dockGeometry.topLeft().x() - p.x()) > (m_dockGeometry.width() * 3)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Dock::Position::Bottom:
|
||||
if ((m_dockGeometry.topLeft().y() - p.y()) > (m_dockGeometry.height() * 3)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ class AppGraphicsObject;
|
||||
class AppDragWidget : public QGraphicsView
|
||||
{
|
||||
public:
|
||||
AppDragWidget(QWidget *parent = Q_NULLPTR);
|
||||
virtual ~AppDragWidget();
|
||||
explicit AppDragWidget(QWidget *parent = Q_NULLPTR);
|
||||
virtual ~AppDragWidget() override;
|
||||
|
||||
void setAppPixmap(const QPixmap &pix);
|
||||
void setDockInfo(Dock::Position dockPosition, const QRect &dockGeometry);
|
||||
@ -47,11 +47,11 @@ public:
|
||||
bool isRemoveAble();
|
||||
|
||||
protected:
|
||||
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
|
||||
void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
|
||||
void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
|
||||
void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dragMoveEvent(QDragMoveEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
void hideEvent(QHideEvent *event) override;
|
||||
|
||||
private:
|
||||
void initAnimations();
|
||||
|
@ -138,7 +138,6 @@ void AppSnapshot::fetchSnapshot()
|
||||
SHMInfo *info = nullptr;
|
||||
uchar *image_data = nullptr;
|
||||
XImage *ximage = nullptr;
|
||||
unsigned char *prop_to_return_gtk = nullptr;
|
||||
|
||||
do {
|
||||
// get window image from shm(only for deepin app)
|
||||
@ -172,7 +171,7 @@ void AppSnapshot::fetchSnapshot()
|
||||
Q_ASSERT(!qimage.isNull());
|
||||
|
||||
// remove shadow frame
|
||||
m_snapshotSrcRect = rectRemovedShadow(qimage, prop_to_return_gtk);
|
||||
m_snapshotSrcRect = rectRemovedShadow(qimage, nullptr);
|
||||
m_snapshot = qimage;
|
||||
} while (false);
|
||||
|
||||
@ -191,7 +190,6 @@ void AppSnapshot::fetchSnapshot()
|
||||
if (image_data) shmdt(image_data);
|
||||
if (ximage) XDestroyImage(ximage);
|
||||
if (info) XFree(info);
|
||||
if (prop_to_return_gtk) XFree(prop_to_return_gtk);
|
||||
|
||||
update();
|
||||
}
|
||||
|
@ -69,13 +69,13 @@ public slots:
|
||||
void setWindowInfo(const WindowInfo &info);
|
||||
|
||||
private:
|
||||
void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
|
||||
void enterEvent(QEvent *e) Q_DECL_OVERRIDE;
|
||||
void leaveEvent(QEvent *e) Q_DECL_OVERRIDE;
|
||||
void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
|
||||
void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
|
||||
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
bool eventFilter(QObject *watched, QEvent *e) Q_DECL_OVERRIDE;
|
||||
void dragEnterEvent(QDragEnterEvent *e) override;
|
||||
void enterEvent(QEvent *e) override;
|
||||
void leaveEvent(QEvent *e) override;
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
void resizeEvent(QResizeEvent *e) override;
|
||||
void mousePressEvent(QMouseEvent *e) override;
|
||||
bool eventFilter(QObject *watched, QEvent *e) override;
|
||||
SHMInfo *getImageDSHM();
|
||||
XImage *getImageXlib();
|
||||
QRect rectRemovedShadow(const QImage &qimage, unsigned char *prop_to_return_gtk);
|
||||
|
@ -31,7 +31,7 @@ class PlaceholderItem : public DockItem
|
||||
public:
|
||||
explicit PlaceholderItem(QWidget *parent = 0);
|
||||
|
||||
inline ItemType itemType() const { return Placeholder; }
|
||||
inline ItemType itemType() const override { return Placeholder; }
|
||||
};
|
||||
|
||||
#endif // PLACEHOLDERITEM_H
|
||||
|
@ -60,9 +60,9 @@ protected:
|
||||
void mousePressEvent(QMouseEvent *e) override;
|
||||
void mouseMoveEvent(QMouseEvent *e) override;
|
||||
void mouseReleaseEvent(QMouseEvent *e) override;
|
||||
void enterEvent(QEvent *event) Q_DECL_OVERRIDE;
|
||||
void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
|
||||
bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
|
||||
void enterEvent(QEvent *event) override;
|
||||
void leaveEvent(QEvent *event) override;
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
void invokedMenuItem(const QString &itemId, const bool checked) override;
|
||||
|
@ -29,9 +29,9 @@ class TrayPluginItem : public PluginsItem
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TrayPluginItem(PluginsItemInterface* const pluginInter, const QString &itemKey, QWidget *parent = 0);
|
||||
TrayPluginItem(PluginsItemInterface* const pluginInter, const QString &itemKey, QWidget *parent = nullptr);
|
||||
|
||||
inline ItemType itemType() const Q_DECL_OVERRIDE {return ItemType::TrayPlugin;}
|
||||
inline ItemType itemType() const override {return ItemType::TrayPlugin;}
|
||||
|
||||
void setSuggestIconSize(QSize size);
|
||||
void setRightSplitVisible(const bool visible);
|
||||
@ -41,7 +41,7 @@ Q_SIGNALS:
|
||||
void trayVisableCountChanged(const int &count) const;
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *watched, QEvent *e) Q_DECL_OVERRIDE;
|
||||
bool eventFilter(QObject *watched, QEvent *e) override;
|
||||
|
||||
private:
|
||||
int m_trayVisableItemCount = 0;
|
||||
|
@ -935,7 +935,7 @@ void MainPanelControl::resizeDockIcon()
|
||||
iconCount -= pluginCount;
|
||||
|
||||
// 余数
|
||||
int yu = (totalLength % iconCount);
|
||||
yu = (totalLength % iconCount);
|
||||
// icon宽度 = (总宽度-余数)/icon个数
|
||||
iconSize = (totalLength - yu) / iconCount;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class DesktopWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DesktopWidget(QWidget *parent) : QWidget(parent){
|
||||
explicit DesktopWidget(QWidget *parent) : QWidget(parent){
|
||||
}
|
||||
};
|
||||
|
||||
@ -55,8 +55,8 @@ class MainPanelControl : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MainPanelControl(QWidget *parent = 0);
|
||||
~MainPanelControl();
|
||||
explicit MainPanelControl(QWidget *parent = nullptr);
|
||||
~MainPanelControl() override;
|
||||
|
||||
void addFixedAreaItem(int index, QWidget *wdg);
|
||||
void addAppAreaItem(int index, QWidget *wdg);
|
||||
|
@ -43,8 +43,8 @@ public:
|
||||
explicit AbstractPluginsController(QObject *parent = 0);
|
||||
|
||||
// implements PluginProxyInterface
|
||||
void saveValue(PluginsItemInterface *const itemInter, const QString &key, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
const QVariant getValue(PluginsItemInterface *const itemInter, const QString &key, const QVariant& fallback = QVariant()) Q_DECL_OVERRIDE;
|
||||
void saveValue(PluginsItemInterface *const itemInter, const QString &key, const QVariant &value) override;
|
||||
const QVariant getValue(PluginsItemInterface *const itemInter, const QString &key, const QVariant& fallback = QVariant()) override;
|
||||
void removeValue(PluginsItemInterface * const itemInter, const QStringList &keyList) override;
|
||||
|
||||
protected:
|
||||
@ -64,7 +64,7 @@ private slots:
|
||||
void refreshPluginSettings();
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
|
||||
bool eventFilter(QObject *o, QEvent *e) override;
|
||||
|
||||
private:
|
||||
QDBusConnectionInterface *m_dbusDaemonInterface;
|
||||
|
@ -251,10 +251,10 @@ const int DockSettings::dockMargin() const
|
||||
return 10;
|
||||
}
|
||||
|
||||
const QSize DockSettings::panelSize() const
|
||||
{
|
||||
return m_mainWindowSize;
|
||||
}
|
||||
//const QSize DockSettings::panelSize() const
|
||||
//{
|
||||
// return m_mainWindowSize;
|
||||
//}
|
||||
|
||||
const QRect DockSettings::windowRect(const Position position, const bool hide)
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ public:
|
||||
inline const quint8 Opacity() const { return m_opacity * 255; }
|
||||
const int dockMargin() const;
|
||||
|
||||
const QSize panelSize() const;
|
||||
// const QSize panelSize() const;
|
||||
const QRect windowRect(const Position position, const bool hide = false);
|
||||
qreal dockRatio() const;
|
||||
|
||||
@ -115,7 +115,7 @@ private slots:
|
||||
void onMonitorListChanged(const QList<QDBusObjectPath> &mons);
|
||||
|
||||
private:
|
||||
DockSettings(QWidget *parent = nullptr);
|
||||
explicit DockSettings(QWidget *parent = nullptr);
|
||||
DockSettings(DockSettings const &) = delete;
|
||||
DockSettings operator =(DockSettings const &) = delete;
|
||||
|
||||
|
@ -29,8 +29,16 @@ const double DoubleZero = 0.000001;
|
||||
|
||||
Monitor::Monitor(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_x(0)
|
||||
, m_y(0)
|
||||
, m_w(0)
|
||||
, m_h(0)
|
||||
, m_mmWidth(0)
|
||||
, m_mmHeight(0)
|
||||
, m_scale(-1.0)
|
||||
, m_brightness(1.0)
|
||||
, m_rotate(0)
|
||||
// , m_brightness(1.0)
|
||||
, m_enable(false)
|
||||
{
|
||||
|
||||
}
|
||||
@ -114,15 +122,15 @@ void Monitor::setRotate(const quint16 rotate)
|
||||
Q_EMIT rotateChanged(m_rotate);
|
||||
}
|
||||
|
||||
void Monitor::setBrightness(const double brightness)
|
||||
{
|
||||
if (fabs(m_brightness - brightness) < DoubleZero)
|
||||
return;
|
||||
//void Monitor::setBrightness(const double brightness)
|
||||
//{
|
||||
// if (fabs(m_brightness - brightness) < DoubleZero)
|
||||
// return;
|
||||
|
||||
m_brightness = brightness;
|
||||
// m_brightness = brightness;
|
||||
|
||||
Q_EMIT brightnessChanged(m_brightness);
|
||||
}
|
||||
// Q_EMIT brightnessChanged(m_brightness);
|
||||
//}
|
||||
|
||||
void Monitor::setName(const QString &name)
|
||||
{
|
||||
@ -190,37 +198,36 @@ void Monitor::setMonitorEnable(bool enable)
|
||||
Q_EMIT enableChanged(enable);
|
||||
}
|
||||
|
||||
//bool Monitor::isSameResolution(const Resolution &r1, const Resolution &r2)
|
||||
//{
|
||||
// return r1.width() == r2.width() && r1.height() == r2.height();
|
||||
//}
|
||||
|
||||
bool Monitor::isSameResolution(const Resolution &r1, const Resolution &r2)
|
||||
{
|
||||
return r1.width() == r2.width() && r1.height() == r2.height();
|
||||
}
|
||||
//bool Monitor::isSameRatefresh(const Resolution &r1, const Resolution &r2)
|
||||
//{
|
||||
// return fabs(r1.rate() - r2.rate()) < 0.000001;
|
||||
//}
|
||||
|
||||
bool Monitor::isSameRatefresh(const Resolution &r1, const Resolution &r2)
|
||||
{
|
||||
return fabs(r1.rate() - r2.rate()) < 0.000001;
|
||||
}
|
||||
//bool Monitor::hasResolution(const Resolution &r)
|
||||
//{
|
||||
// for (auto m : m_modeList) {
|
||||
// if (isSameResolution(m, r)) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
|
||||
bool Monitor::hasResolution(const Resolution &r)
|
||||
{
|
||||
for (auto m : m_modeList) {
|
||||
if (isSameResolution(m, r)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// return false;
|
||||
//}
|
||||
|
||||
return false;
|
||||
}
|
||||
//bool Monitor::hasResolutionAndRate(const Resolution &r)
|
||||
//{
|
||||
// for (auto m : m_modeList) {
|
||||
// if (fabs(m.rate() - r.rate()) < 0.000001 &&
|
||||
// m.width() == r.width() &&
|
||||
// m.height() == r.height()) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
|
||||
bool Monitor::hasResolutionAndRate(const Resolution &r)
|
||||
{
|
||||
for (auto m : m_modeList) {
|
||||
if (fabs(m.rate() - r.rate()) < 0.000001 &&
|
||||
m.width() == r.width() &&
|
||||
m.height() == r.height()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
// return false;
|
||||
//}
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
inline double scale() const { return m_scale; }
|
||||
inline bool isPrimary() const { return m_primary == m_name; }
|
||||
inline quint16 rotate() const { return m_rotate; }
|
||||
inline double brightness() const { return m_brightness; }
|
||||
// inline double brightness() const { return m_brightness; }
|
||||
inline const QRect rect() const { return QRect(m_x, m_y, m_w, m_h); }
|
||||
inline const QString name() const { Q_ASSERT(!m_name.isEmpty()); return m_name; }
|
||||
inline const QString path() const { return m_path; }
|
||||
@ -89,16 +89,16 @@ Q_SIGNALS:
|
||||
void hChanged(const int h) const;
|
||||
void scaleChanged(const double scale) const;
|
||||
void rotateChanged(const quint16 rotate) const;
|
||||
void brightnessChanged(const double brightness) const;
|
||||
// void brightnessChanged(const double brightness) const;
|
||||
void currentModeChanged(const Resolution &resolution) const;
|
||||
void modelListChanged(const QList<Resolution> &resolution) const;
|
||||
void enableChanged(bool enable) const;
|
||||
|
||||
public:
|
||||
static bool isSameResolution(const Resolution &r1,const Resolution &r2);
|
||||
static bool isSameRatefresh(const Resolution &r1,const Resolution &r2);
|
||||
bool hasResolution(const Resolution &r);
|
||||
bool hasResolutionAndRate(const Resolution &r);
|
||||
//public:
|
||||
// static bool isSameResolution(const Resolution &r1,const Resolution &r2);
|
||||
// static bool isSameRatefresh(const Resolution &r1,const Resolution &r2);
|
||||
// bool hasResolution(const Resolution &r);
|
||||
// bool hasResolutionAndRate(const Resolution &r);
|
||||
|
||||
public Q_SLOTS:
|
||||
void setX(const int x);
|
||||
@ -110,7 +110,7 @@ public Q_SLOTS:
|
||||
void setScale(const double scale);
|
||||
void setPrimary(const QString &primaryName);
|
||||
void setRotate(const quint16 rotate);
|
||||
void setBrightness(const double brightness);
|
||||
// void setBrightness(const double brightness);
|
||||
void setName(const QString &name);
|
||||
void setPath(const QString &path);
|
||||
void setRotateList(const QList<quint16> &rotateList);
|
||||
@ -127,7 +127,8 @@ private:
|
||||
uint m_mmHeight;
|
||||
double m_scale;
|
||||
quint16 m_rotate;
|
||||
double m_brightness;
|
||||
// double m_brightness;
|
||||
|
||||
QString m_name;
|
||||
QString m_path;
|
||||
QString m_primary;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
StateButton::StateButton(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_type(Check)
|
||||
{
|
||||
setAttribute(Qt::WA_TranslucentBackground, true);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ inline QString getAccessibleName(QWidget *w, QAccessible::Role r, const QString
|
||||
}
|
||||
|
||||
// 公共的功能
|
||||
#define FUNC_CREATE(classname,accessibletype,accessdescription) Accessible##classname(classname *w) \
|
||||
#define FUNC_CREATE(classname,accessibletype,accessdescription) explicit Accessible##classname(classname *w) \
|
||||
: QAccessibleWidget(w,accessibletype,#classname)\
|
||||
, m_w(w)\
|
||||
, m_description(accessdescription)\
|
||||
|
@ -58,7 +58,7 @@ private:
|
||||
QPoint m_resizePoint;
|
||||
|
||||
public:
|
||||
DragWidget(QWidget *parent) : QWidget(parent)
|
||||
explicit DragWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
setObjectName("DragWidget");
|
||||
m_dragStatus = false;
|
||||
@ -505,36 +505,36 @@ void MainWindow::initConnections()
|
||||
connect(m_eventInter, &XEventMonitor::CursorMove, this, &MainWindow::onRegionMonitorChanged);
|
||||
}
|
||||
|
||||
const QPoint MainWindow::x11GetWindowPos()
|
||||
{
|
||||
const auto disp = QX11Info::display();
|
||||
//const QPoint MainWindow::x11GetWindowPos()
|
||||
//{
|
||||
// const auto disp = QX11Info::display();
|
||||
|
||||
unsigned int unused;
|
||||
int x;
|
||||
int y;
|
||||
Window unused_window;
|
||||
// unsigned int unused;
|
||||
// int x;
|
||||
// int y;
|
||||
// Window unused_window;
|
||||
|
||||
XGetGeometry(disp, winId(), &unused_window, &x, &y, &unused, &unused, &unused, &unused);
|
||||
XFlush(disp);
|
||||
// XGetGeometry(disp, winId(), &unused_window, &x, &y, &unused, &unused, &unused, &unused);
|
||||
// XFlush(disp);
|
||||
|
||||
return QPoint(x, y);
|
||||
}
|
||||
// return QPoint(x, y);
|
||||
//}
|
||||
|
||||
void MainWindow::x11MoveWindow(const int x, const int y)
|
||||
{
|
||||
const auto disp = QX11Info::display();
|
||||
//void MainWindow::x11MoveWindow(const int x, const int y)
|
||||
//{
|
||||
// const auto disp = QX11Info::display();
|
||||
|
||||
XMoveWindow(disp, winId(), x, y);
|
||||
XFlush(disp);
|
||||
}
|
||||
// XMoveWindow(disp, winId(), x, y);
|
||||
// XFlush(disp);
|
||||
//}
|
||||
|
||||
void MainWindow::x11MoveResizeWindow(const int x, const int y, const int w, const int h)
|
||||
{
|
||||
const auto disp = QX11Info::display();
|
||||
//void MainWindow::x11MoveResizeWindow(const int x, const int y, const int w, const int h)
|
||||
//{
|
||||
// const auto disp = QX11Info::display();
|
||||
|
||||
XMoveResizeWindow(disp, winId(), x, y, w, h);
|
||||
XFlush(disp);
|
||||
}
|
||||
// XMoveResizeWindow(disp, winId(), x, y, w, h);
|
||||
// XFlush(disp);
|
||||
//}
|
||||
|
||||
void MainWindow::positionChanged()
|
||||
{
|
||||
@ -713,18 +713,9 @@ void MainWindow::expand()
|
||||
resetPanelEnvironment();
|
||||
if (showAniState != QPropertyAnimation::Running && pos() != m_panelShowAni->currentValue()) {
|
||||
const QRect windowRect = m_settings->windowRect(m_dockPosition);
|
||||
switch (m_dockPosition) {
|
||||
case Top:
|
||||
case Bottom:
|
||||
startValue = height();
|
||||
endValue = windowRect.height();
|
||||
break;
|
||||
case Left:
|
||||
case Right:
|
||||
startValue = width();
|
||||
endValue = windowRect.width();
|
||||
break;
|
||||
}
|
||||
|
||||
startValue = (m_dockPosition == Top || m_dockPosition == Bottom) ? height() : width();
|
||||
endValue = (m_dockPosition == Top || m_dockPosition == Bottom) ? windowRect.height() : windowRect.width();
|
||||
|
||||
if (startValue > DOCK_MAX_SIZE || endValue > DOCK_MAX_SIZE) {
|
||||
return;
|
||||
@ -742,25 +733,11 @@ void MainWindow::expand()
|
||||
|
||||
void MainWindow::narrow()
|
||||
{
|
||||
int startValue = 0;
|
||||
int endValue = 0;
|
||||
|
||||
switch (m_dockPosition) {
|
||||
case Top:
|
||||
case Bottom:
|
||||
startValue = height();
|
||||
endValue = 0;
|
||||
break;
|
||||
case Left:
|
||||
case Right:
|
||||
startValue = width();
|
||||
endValue = 0;
|
||||
break;
|
||||
}
|
||||
int startValue = ( m_dockPosition == Top || m_dockPosition == Bottom ) ? height() : width();
|
||||
|
||||
m_panelShowAni->stop();
|
||||
m_panelHideAni->setStartValue(startValue);
|
||||
m_panelHideAni->setEndValue(endValue);
|
||||
m_panelHideAni->setEndValue(0);
|
||||
m_panelHideAni->start();
|
||||
}
|
||||
|
||||
|
@ -69,14 +69,14 @@ public slots:
|
||||
|
||||
private:
|
||||
using QWidget::show;
|
||||
bool event(QEvent *e);
|
||||
void showEvent(QShowEvent *e);
|
||||
void mousePressEvent(QMouseEvent *e);
|
||||
void keyPressEvent(QKeyEvent *e);
|
||||
void enterEvent(QEvent *e);
|
||||
void leaveEvent(QEvent *e);
|
||||
void dragEnterEvent(QDragEnterEvent *e);
|
||||
void mouseMoveEvent(QMouseEvent *e);
|
||||
bool event(QEvent *e) override;
|
||||
void showEvent(QShowEvent *e) override;
|
||||
void mousePressEvent(QMouseEvent *e) override;
|
||||
void keyPressEvent(QKeyEvent *e) override;
|
||||
void enterEvent(QEvent *e) override;
|
||||
void leaveEvent(QEvent *e) override;
|
||||
void dragEnterEvent(QDragEnterEvent *e) override;
|
||||
void mouseMoveEvent(QMouseEvent *e) override;
|
||||
|
||||
void initSNIHost();
|
||||
void initComponents();
|
||||
@ -84,10 +84,10 @@ private:
|
||||
void resizeMainWindow();
|
||||
void resizeMainPanelWindow();
|
||||
|
||||
const QPoint x11GetWindowPos();
|
||||
void x11MoveWindow(const int x, const int y);
|
||||
void x11MoveResizeWindow(const int x, const int y, const int w, const int h);
|
||||
bool appIsOnDock(const QString &appDesktop);
|
||||
// const QPoint x11GetWindowPos();
|
||||
// void x11MoveWindow(const int x, const int y);
|
||||
// void x11MoveResizeWindow(const int x, const int y, const int w, const int h);
|
||||
bool appIsOnDock(const QString &appDesktop) override;
|
||||
void onRegionMonitorChanged(int x, int y, const QString &key);
|
||||
void updateRegionMonitorWatch();
|
||||
void getTrayVisableItemCount();
|
||||
|
@ -35,21 +35,21 @@ class BluetoothPlugin : public QObject, PluginsItemInterface
|
||||
public:
|
||||
explicit BluetoothPlugin(QObject *parent = nullptr);
|
||||
|
||||
const QString pluginName() const Q_DECL_OVERRIDE;
|
||||
const QString pluginDisplayName() const Q_DECL_OVERRIDE;
|
||||
void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
|
||||
void pluginStateSwitched() Q_DECL_OVERRIDE;
|
||||
bool pluginIsAllowDisable() Q_DECL_OVERRIDE { return true; }
|
||||
bool pluginIsDisable() Q_DECL_OVERRIDE;
|
||||
QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
const QString itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
void refreshIcon(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void pluginSettingsChanged() Q_DECL_OVERRIDE;
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
void init(PluginProxyInterface *proxyInter) override;
|
||||
void pluginStateSwitched() override;
|
||||
bool pluginIsAllowDisable() override { return true; }
|
||||
bool pluginIsDisable() override;
|
||||
QWidget *itemWidget(const QString &itemKey) override;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) override;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) override;
|
||||
const QString itemContextMenu(const QString &itemKey) override;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
void pluginSettingsChanged() override;
|
||||
|
||||
private:
|
||||
void refreshPluginItemsVisible();
|
||||
|
@ -106,29 +106,29 @@ void Adapter::updateDevice(const QJsonObject &dviceJson)
|
||||
}
|
||||
}
|
||||
|
||||
void Adapter::removeAllDevices()
|
||||
{
|
||||
QMapIterator<QString, const Device *> iterator(m_devices);
|
||||
while (iterator.hasNext()) {
|
||||
iterator.next();
|
||||
auto device = const_cast<Device *>(iterator.value());
|
||||
if (device) {
|
||||
m_devices.remove(device->id());
|
||||
m_paredDev.remove(device->id());
|
||||
delete device;
|
||||
}
|
||||
}
|
||||
}
|
||||
//void Adapter::removeAllDevices()
|
||||
//{
|
||||
// QMapIterator<QString, const Device *> iterator(m_devices);
|
||||
// while (iterator.hasNext()) {
|
||||
// iterator.next();
|
||||
// auto device = const_cast<Device *>(iterator.value());
|
||||
// if (device) {
|
||||
// m_devices.remove(device->id());
|
||||
// m_paredDev.remove(device->id());
|
||||
// delete device;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
const QMap<QString, const Device *> &Adapter::paredDevices() const
|
||||
{
|
||||
return m_paredDev;
|
||||
}
|
||||
|
||||
int Adapter::paredDevicesCount() const
|
||||
{
|
||||
return m_paredDev.size();
|
||||
}
|
||||
//int Adapter::paredDevicesCount() const
|
||||
//{
|
||||
// return m_paredDev.size();
|
||||
//}
|
||||
|
||||
void Adapter::divideDevice(const Device *device)
|
||||
{
|
||||
|
@ -55,9 +55,9 @@ public:
|
||||
void addDevice(const QJsonObject &deviceObj);
|
||||
void removeDevice(const QString &deviceId);
|
||||
void updateDevice(const QJsonObject &dviceJson);
|
||||
void removeAllDevices();
|
||||
// void removeAllDevices();
|
||||
const QMap<QString, const Device *> &paredDevices() const;
|
||||
int paredDevicesCount() const;
|
||||
// int paredDevicesCount() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void nameChanged(const QString &name) const;
|
||||
|
@ -82,15 +82,15 @@ AdaptersManager::AdaptersManager(QObject *parent)
|
||||
}
|
||||
}
|
||||
|
||||
QMap<QString, const Adapter *> AdaptersManager::adapters() const
|
||||
{
|
||||
return m_adapters;
|
||||
}
|
||||
//QMap<QString, const Adapter *> AdaptersManager::adapters() const
|
||||
//{
|
||||
// return m_adapters;
|
||||
//}
|
||||
|
||||
const Adapter *AdaptersManager::adapterById(const QString &id)
|
||||
{
|
||||
return m_adapters.keys().contains(id) ? m_adapters[id] : nullptr;
|
||||
}
|
||||
//const Adapter *AdaptersManager::adapterById(const QString &id)
|
||||
//{
|
||||
// return m_adapters.keys().contains(id) ? m_adapters[id] : nullptr;
|
||||
//}
|
||||
|
||||
void AdaptersManager::setAdapterPowered(const Adapter *adapter, const bool &powered)
|
||||
{
|
||||
@ -114,17 +114,17 @@ void AdaptersManager::setAdapterPowered(const Adapter *adapter, const bool &powe
|
||||
}
|
||||
}
|
||||
|
||||
void AdaptersManager::connectAllPairedDevice(const Adapter *adapter)
|
||||
{
|
||||
for (const Device *d : adapter->paredDevices()) {
|
||||
Device *vd = const_cast<Device *>(d);
|
||||
if (vd) {
|
||||
QDBusObjectPath path(vd->id());
|
||||
m_bluetoothInter->ConnectDevice(path);
|
||||
qDebug() << "connect to device: " << vd->name();
|
||||
}
|
||||
}
|
||||
}
|
||||
//void AdaptersManager::connectAllPairedDevice(const Adapter *adapter)
|
||||
//{
|
||||
// for (const Device *d : adapter->paredDevices()) {
|
||||
// Device *vd = const_cast<Device *>(d);
|
||||
// if (vd) {
|
||||
// QDBusObjectPath path(vd->id());
|
||||
// m_bluetoothInter->ConnectDevice(path);
|
||||
// qDebug() << "connect to device: " << vd->name();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
void AdaptersManager::connectDevice(Device *device)
|
||||
{
|
||||
|
@ -34,11 +34,11 @@ class AdaptersManager : public QObject
|
||||
public:
|
||||
explicit AdaptersManager(QObject *parent = nullptr);
|
||||
|
||||
QMap<QString, const Adapter *> adapters() const;
|
||||
const Adapter *adapterById(const QString &id);
|
||||
// QMap<QString, const Adapter *> adapters() const;
|
||||
// const Adapter *adapterById(const QString &id);
|
||||
|
||||
void setAdapterPowered(const Adapter *adapter, const bool &powered);
|
||||
void connectAllPairedDevice(const Adapter *adapter);
|
||||
// void connectAllPairedDevice(const Adapter *adapter);
|
||||
void connectDevice(Device *deviceId);
|
||||
bool defaultAdapterInitPowerState();
|
||||
int adaptersCount();
|
||||
|
@ -51,7 +51,7 @@ signals:
|
||||
void refresh();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj,QEvent *event) Q_DECL_OVERRIDE;
|
||||
bool eventFilter(QObject *obj,QEvent *event) override;
|
||||
|
||||
private:
|
||||
QLabel *m_title;
|
||||
|
@ -38,7 +38,7 @@ class DatetimePlugin : public QObject, PluginsItemInterface
|
||||
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "datetime.json")
|
||||
|
||||
public:
|
||||
explicit DatetimePlugin(QObject *parent = 0);
|
||||
explicit DatetimePlugin(QObject *parent = nullptr);
|
||||
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
@ -48,8 +48,8 @@ public:
|
||||
bool pluginIsAllowDisable() override { return true; }
|
||||
bool pluginIsDisable() override;
|
||||
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
|
||||
QWidget *itemWidget(const QString &itemKey) override;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) override;
|
||||
|
@ -38,6 +38,8 @@ DWIDGET_USE_NAMESPACE
|
||||
|
||||
DatetimeWidget::DatetimeWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_24HourFormat(false)
|
||||
, m_timeOffset(false)
|
||||
{
|
||||
setMinimumSize(PLUGIN_BACKGROUND_MIN_SIZE, PLUGIN_BACKGROUND_MIN_SIZE);
|
||||
}
|
||||
|
@ -23,15 +23,15 @@
|
||||
#include "pluginsiteminterface.h"
|
||||
#include "dbusadaptors.h"
|
||||
|
||||
class KeyboardPlugin : public QObject , PluginsItemInterface
|
||||
class KeyboardPlugin : public QObject, PluginsItemInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginsItemInterface)
|
||||
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "keyboard.json")
|
||||
|
||||
public:
|
||||
KeyboardPlugin(QObject *parent = nullptr);
|
||||
~KeyboardPlugin();
|
||||
explicit KeyboardPlugin(QObject *parent = nullptr);
|
||||
~KeyboardPlugin() override;
|
||||
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
|
@ -35,7 +35,7 @@ class MultitaskingPlugin : public QObject, PluginsItemInterface
|
||||
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "multitasking.json")
|
||||
|
||||
public:
|
||||
explicit MultitaskingPlugin(QObject *parent = 0);
|
||||
explicit MultitaskingPlugin(QObject *parent = nullptr);
|
||||
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
@ -48,9 +48,9 @@ public:
|
||||
const QString itemCommand(const QString &itemKey) override;
|
||||
const QString itemContextMenu(const QString &itemKey) override;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
void refreshIcon(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
void pluginSettingsChanged() override;
|
||||
PluginType type() override;
|
||||
|
||||
|
@ -28,8 +28,9 @@
|
||||
|
||||
MultitaskingWidget::MultitaskingWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_icon(QIcon::fromTheme(":/icons/deepin-multitasking-view.svg"))
|
||||
{
|
||||
m_icon = QIcon::fromTheme(":/icons/deepin-multitasking-view.svg");
|
||||
|
||||
}
|
||||
|
||||
void MultitaskingWidget::refreshIcon()
|
||||
|
@ -32,7 +32,7 @@ class MultitaskingWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MultitaskingWidget(QWidget *parent = 0);
|
||||
explicit MultitaskingWidget(QWidget *parent = nullptr);
|
||||
void refreshIcon();
|
||||
|
||||
signals:
|
||||
|
@ -35,8 +35,8 @@ class SsidButton : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SsidButton(QWidget *parent = nullptr) : QLabel(parent) {}
|
||||
virtual ~SsidButton() {}
|
||||
explicit SsidButton(QWidget *parent = nullptr) : QLabel(parent) {}
|
||||
virtual ~SsidButton() override {}
|
||||
|
||||
signals:
|
||||
void clicked();
|
||||
|
@ -46,7 +46,7 @@ signals:
|
||||
void requestRefresh() const;
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
void refreshIcon();
|
||||
|
||||
private slots:
|
||||
|
@ -54,9 +54,9 @@ public:
|
||||
|
||||
public:
|
||||
explicit WirelessItem(dde::network::WirelessDevice *device);
|
||||
~WirelessItem();
|
||||
~WirelessItem() override;
|
||||
|
||||
QWidget *itemApplet();
|
||||
QWidget *itemApplet() override;
|
||||
int APcount();
|
||||
bool deviceEanbled();
|
||||
void setDeviceEnabled(bool enable);
|
||||
|
@ -66,9 +66,9 @@ public slots:
|
||||
void refreshIcon();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
|
||||
void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
|
||||
bool eventFilter(QObject *obj,QEvent *event) Q_DECL_OVERRIDE;
|
||||
void resizeEvent(QResizeEvent *e) override;
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
bool eventFilter(QObject *obj,QEvent *event) override;
|
||||
|
||||
private slots:
|
||||
void wiredsEnable(bool enable);
|
||||
|
@ -156,10 +156,10 @@ void NetworkPlugin::pluginSettingsChanged()
|
||||
refreshPluginItemsVisible();
|
||||
}
|
||||
|
||||
bool NetworkPlugin::isConnectivity()
|
||||
{
|
||||
return NetworkModel::connectivity() == Connectivity::Full;
|
||||
}
|
||||
//bool NetworkPlugin::isConnectivity()
|
||||
//{
|
||||
// return NetworkModel::connectivity() == Connectivity::Full;
|
||||
//}
|
||||
|
||||
void NetworkPlugin::onDeviceListChanged(const QList<NetworkDevice *> devices)
|
||||
{
|
||||
|
@ -40,26 +40,26 @@ class NetworkPlugin : public QObject, PluginsItemInterface
|
||||
public:
|
||||
explicit NetworkPlugin(QObject *parent = nullptr);
|
||||
|
||||
const QString pluginName() const Q_DECL_OVERRIDE;
|
||||
const QString pluginDisplayName() const Q_DECL_OVERRIDE;
|
||||
void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) Q_DECL_OVERRIDE;
|
||||
void refreshIcon(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void pluginStateSwitched() Q_DECL_OVERRIDE;
|
||||
bool pluginIsAllowDisable() Q_DECL_OVERRIDE { return true; }
|
||||
bool pluginIsDisable() Q_DECL_OVERRIDE;
|
||||
const QString itemCommand(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
const QString itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
void init(PluginProxyInterface *proxyInter) override;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
void pluginStateSwitched() override;
|
||||
bool pluginIsAllowDisable() override { return true; }
|
||||
bool pluginIsDisable() override;
|
||||
const QString itemCommand(const QString &itemKey) override;
|
||||
const QString itemContextMenu(const QString &itemKey) override;
|
||||
QWidget *itemWidget(const QString &itemKey) override;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) override;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) override;
|
||||
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
|
||||
void pluginSettingsChanged() override;
|
||||
|
||||
static bool isConnectivity();
|
||||
// static bool isConnectivity();
|
||||
|
||||
private slots:
|
||||
void onDeviceListChanged(const QList<dde::network::NetworkDevice *> devices);
|
||||
|
@ -40,7 +40,7 @@ class OnboardPlugin : public QObject, PluginsItemInterface
|
||||
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "onboard.json")
|
||||
|
||||
public:
|
||||
explicit OnboardPlugin(QObject *parent = 0);
|
||||
explicit OnboardPlugin(QObject *parent = nullptr);
|
||||
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
@ -57,8 +57,8 @@ public:
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
void displayModeChanged(const Dock::DisplayMode displayMode) override;
|
||||
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
|
||||
void pluginSettingsChanged() override;
|
||||
|
||||
|
@ -42,7 +42,7 @@ class OverlayWarningPlugin : public QObject, PluginsItemInterface
|
||||
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "overlay-warning.json")
|
||||
|
||||
public:
|
||||
explicit OverlayWarningPlugin(QObject *parent = 0);
|
||||
explicit OverlayWarningPlugin(QObject *parent = nullptr);
|
||||
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
@ -57,8 +57,8 @@ public:
|
||||
const QString itemCommand(const QString &itemKey) override;
|
||||
void displayModeChanged(const Dock::DisplayMode displayMode) override;
|
||||
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
|
||||
private:
|
||||
void loadPlugin();
|
||||
|
@ -129,7 +129,7 @@ void HomeMonitorPlugin::invokedMenuItem(const QString &itemKey, const QString &m
|
||||
// 根据上面接口设置的 id 执行不同的操作
|
||||
if (menuId == "refresh") {
|
||||
m_pluginWidget->storageInfo()->refresh();
|
||||
} else if ("open") {
|
||||
} else if (menuId == "open") {
|
||||
QProcess::startDetached("gparted");
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ class PowerPlugin : public QObject, PluginsItemInterface
|
||||
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "power.json")
|
||||
|
||||
public:
|
||||
explicit PowerPlugin(QObject *parent = 0);
|
||||
explicit PowerPlugin(QObject *parent = nullptr);
|
||||
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
@ -62,9 +62,9 @@ public:
|
||||
const QString itemCommand(const QString &itemKey) override;
|
||||
const QString itemContextMenu(const QString &itemKey) override;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
void refreshIcon(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
void pluginSettingsChanged() override;
|
||||
|
||||
private:
|
||||
|
@ -67,7 +67,6 @@ QPixmap PowerStatusWidget::getBatteryIcon()
|
||||
const BatteryPercentageMap data = m_powerInter->batteryPercentage();
|
||||
const uint value = uint(qMin(100.0, qMax(0.0, data.value("Display"))));
|
||||
const int percentage = int(std::round(value));
|
||||
// const int batteryState = m_powerInter->batteryState()["Display"];
|
||||
const bool plugged = !m_powerInter->onBattery();
|
||||
|
||||
/*根据新需求,电池电量显示分别是*/
|
||||
|
@ -35,7 +35,7 @@ class ShowDesktopPlugin : public QObject, PluginsItemInterface
|
||||
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "show-desktop.json")
|
||||
|
||||
public:
|
||||
explicit ShowDesktopPlugin(QObject *parent = 0);
|
||||
explicit ShowDesktopPlugin(QObject *parent = nullptr);
|
||||
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
@ -48,9 +48,9 @@ public:
|
||||
const QString itemCommand(const QString &itemKey) override;
|
||||
const QString itemContextMenu(const QString &itemKey) override;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
void refreshIcon(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
void pluginSettingsChanged() override;
|
||||
PluginType type() override;
|
||||
|
||||
|
@ -36,7 +36,7 @@ class ShutdownPlugin : public QObject, PluginsItemInterface
|
||||
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "shutdown.json")
|
||||
|
||||
public:
|
||||
explicit ShutdownPlugin(QObject *parent = 0);
|
||||
explicit ShutdownPlugin(QObject *parent = nullptr);
|
||||
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
@ -53,8 +53,8 @@ public:
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
void displayModeChanged(const Dock::DisplayMode displayMode) override;
|
||||
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
|
||||
void pluginSettingsChanged() override;
|
||||
|
||||
|
@ -38,10 +38,10 @@ signals:
|
||||
void requestPlaySoundEffect() const;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
|
||||
void mousePressEvent(QMouseEvent *e) override;
|
||||
void mouseMoveEvent(QMouseEvent *e) override;
|
||||
void mouseReleaseEvent(QMouseEvent *e) override;
|
||||
void wheelEvent(QWheelEvent *e) override;
|
||||
|
||||
private slots:
|
||||
void onTimeout();
|
||||
|
@ -34,20 +34,20 @@ class SoundPlugin : public QObject, PluginsItemInterface
|
||||
public:
|
||||
explicit SoundPlugin(QObject *parent = 0);
|
||||
|
||||
const QString pluginName() const Q_DECL_OVERRIDE;
|
||||
const QString pluginDisplayName() const Q_DECL_OVERRIDE;
|
||||
void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
|
||||
void pluginStateSwitched() Q_DECL_OVERRIDE;
|
||||
bool pluginIsAllowDisable() Q_DECL_OVERRIDE { return true; }
|
||||
bool pluginIsDisable() Q_DECL_OVERRIDE;
|
||||
QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
const QString itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
void refreshIcon(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
void init(PluginProxyInterface *proxyInter) override;
|
||||
void pluginStateSwitched() override;
|
||||
bool pluginIsAllowDisable() override { return true; }
|
||||
bool pluginIsDisable() override;
|
||||
QWidget *itemWidget(const QString &itemKey) override;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) override;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) override;
|
||||
const QString itemContextMenu(const QString &itemKey) override;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
void pluginSettingsChanged() override;
|
||||
|
||||
private:
|
||||
|
@ -73,10 +73,10 @@ QSize PopupControlWidget::sizeHint() const
|
||||
return QSize(width(), m_empty ? 30 : 60);
|
||||
}
|
||||
|
||||
const QString PopupControlWidget::trashDir()
|
||||
{
|
||||
return TrashDir;
|
||||
}
|
||||
//const QString PopupControlWidget::trashDir()
|
||||
//{
|
||||
// return TrashDir;
|
||||
//}
|
||||
|
||||
void PopupControlWidget::openTrashFloder()
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
bool empty() const;
|
||||
int trashItems() const;
|
||||
QSize sizeHint() const;
|
||||
static const QString trashDir();
|
||||
// static const QString trashDir();
|
||||
|
||||
public slots:
|
||||
void openTrashFloder();
|
||||
|
@ -43,23 +43,23 @@ class TrashPlugin : public QObject, PluginsItemInterface
|
||||
public:
|
||||
explicit TrashPlugin(QObject *parent = 0);
|
||||
|
||||
const QString pluginName() const Q_DECL_OVERRIDE;
|
||||
const QString pluginName() const override;
|
||||
const QString pluginDisplayName() const override;
|
||||
void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
|
||||
void init(PluginProxyInterface *proxyInter) override;
|
||||
|
||||
QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
const QString itemCommand(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
const QString itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void refreshIcon(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) Q_DECL_OVERRIDE;
|
||||
QWidget *itemWidget(const QString &itemKey) override;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) override;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) override;
|
||||
const QString itemCommand(const QString &itemKey) override;
|
||||
const QString itemContextMenu(const QString &itemKey) override;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
bool pluginIsAllowDisable() override { return true; }
|
||||
bool pluginIsDisable() override;
|
||||
void pluginStateSwitched() override;
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
void displayModeChanged(const Dock::DisplayMode displayMode) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
void displayModeChanged(const Dock::DisplayMode displayMode) override;
|
||||
void pluginSettingsChanged() override;
|
||||
|
||||
private:
|
||||
|
@ -54,10 +54,10 @@ signals:
|
||||
void requestContextMenu() const;
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
|
||||
void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
|
||||
void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
|
||||
void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
|
||||
void dragEnterEvent(QDragEnterEvent *e) override;
|
||||
void dragMoveEvent(QDragMoveEvent *e) override;
|
||||
void dropEvent(QDropEvent *e) override;
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
|
||||
private slots:
|
||||
void removeApp(const QString &appKey);
|
||||
|
@ -54,8 +54,8 @@ Q_SIGNALS:
|
||||
void requestRefershWindowVisible();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *e) override;
|
||||
|
||||
void handleMouseRelease();
|
||||
const QRect perfectIconRect() const;
|
||||
|
@ -23,13 +23,13 @@
|
||||
#include "../fashiontrayconstants.h"
|
||||
|
||||
AbstractContainer::AbstractContainer(TrayPlugin *trayPlugin, QWidget *parent)
|
||||
: QWidget(parent),
|
||||
m_trayPlugin(trayPlugin),
|
||||
m_wrapperLayout(new QBoxLayout(QBoxLayout::LeftToRight, this)),
|
||||
m_currentDraggingWrapper(nullptr),
|
||||
m_expand(true),
|
||||
m_dockPosition(Dock::Position::Bottom),
|
||||
m_wrapperSize(QSize(PLUGIN_BACKGROUND_MAX_SIZE, PLUGIN_BACKGROUND_MAX_SIZE))
|
||||
: QWidget(parent)
|
||||
, m_trayPlugin(trayPlugin)
|
||||
, m_wrapperLayout(new QBoxLayout(QBoxLayout::LeftToRight, this))
|
||||
, m_currentDraggingWrapper(nullptr)
|
||||
, m_expand(true)
|
||||
, m_dockPosition(Dock::Position::Bottom)
|
||||
// , m_wrapperSize(QSize(PLUGIN_BACKGROUND_MAX_SIZE, PLUGIN_BACKGROUND_MAX_SIZE))
|
||||
{
|
||||
setAcceptDrops(true);
|
||||
|
||||
@ -342,10 +342,10 @@ Dock::Position AbstractContainer::dockPosition() const
|
||||
return m_dockPosition;
|
||||
}
|
||||
|
||||
QSize AbstractContainer::wrapperSize() const
|
||||
{
|
||||
return m_wrapperSize;
|
||||
}
|
||||
//QSize AbstractContainer::wrapperSize() const
|
||||
//{
|
||||
// return m_wrapperSize;
|
||||
//}
|
||||
|
||||
void AbstractContainer::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
|
@ -72,10 +72,10 @@ protected:
|
||||
void setWrapperLayout(QBoxLayout *layout);
|
||||
bool expand() const;
|
||||
Dock::Position dockPosition() const;
|
||||
QSize wrapperSize() const;
|
||||
// QSize wrapperSize() const;
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
@ -94,7 +94,7 @@ private:
|
||||
bool m_expand;
|
||||
Dock::Position m_dockPosition;
|
||||
|
||||
QSize m_wrapperSize;
|
||||
// QSize m_wrapperSize;
|
||||
int m_itemSize = 40;
|
||||
};
|
||||
|
||||
|
@ -13,9 +13,9 @@ public:
|
||||
|
||||
// AbstractContainer interface
|
||||
public:
|
||||
bool acceptWrapper(FashionTrayWidgetWrapper *wrapper) Q_DECL_OVERRIDE;
|
||||
void refreshVisible() Q_DECL_OVERRIDE;
|
||||
void addWrapper(FashionTrayWidgetWrapper *wrapper) Q_DECL_OVERRIDE;
|
||||
bool acceptWrapper(FashionTrayWidgetWrapper *wrapper) override;
|
||||
void refreshVisible() override;
|
||||
void addWrapper(FashionTrayWidgetWrapper *wrapper) override;
|
||||
};
|
||||
|
||||
#endif // ATTENTIONCONTAINER_H
|
||||
|
@ -10,11 +10,11 @@ public:
|
||||
explicit HoldContainer(TrayPlugin *trayPlugin, QWidget *parent = nullptr);
|
||||
|
||||
public:
|
||||
bool acceptWrapper(FashionTrayWidgetWrapper *wrapper) Q_DECL_OVERRIDE;
|
||||
void addWrapper(FashionTrayWidgetWrapper *wrapper) Q_DECL_OVERRIDE;
|
||||
void refreshVisible() Q_DECL_OVERRIDE;
|
||||
void setDockPosition(const Dock::Position pos) Q_DECL_OVERRIDE;
|
||||
// QSize totalSize() const Q_DECL_OVERRIDE;
|
||||
bool acceptWrapper(FashionTrayWidgetWrapper *wrapper) override;
|
||||
void addWrapper(FashionTrayWidgetWrapper *wrapper) override;
|
||||
void refreshVisible() override;
|
||||
void setDockPosition(const Dock::Position pos) override;
|
||||
// QSize totalSize() const override;
|
||||
|
||||
private:
|
||||
QBoxLayout *m_mainBoxLayout;
|
||||
|
@ -11,16 +11,16 @@ public:
|
||||
|
||||
// AbstractContainer interface
|
||||
public:
|
||||
bool acceptWrapper(FashionTrayWidgetWrapper *wrapper) Q_DECL_OVERRIDE;
|
||||
void addWrapper(FashionTrayWidgetWrapper *wrapper) Q_DECL_OVERRIDE;
|
||||
void refreshVisible() Q_DECL_OVERRIDE;
|
||||
void setExpand(const bool expand) Q_DECL_OVERRIDE;
|
||||
bool acceptWrapper(FashionTrayWidgetWrapper *wrapper) override;
|
||||
void addWrapper(FashionTrayWidgetWrapper *wrapper) override;
|
||||
void refreshVisible() override;
|
||||
void setExpand(const bool expand) override;
|
||||
int itemCount() override;
|
||||
QSize sizeHint() const override;
|
||||
void updateSize();
|
||||
|
||||
protected:
|
||||
int whereToInsert(FashionTrayWidgetWrapper *wrapper) Q_DECL_OVERRIDE;
|
||||
int whereToInsert(FashionTrayWidgetWrapper *wrapper) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
|
@ -28,36 +28,36 @@ void SpliterAnimated::setEndValue(const QVariant &value)
|
||||
m_sizeAnimation->setEndValue(value);
|
||||
}
|
||||
|
||||
void SpliterAnimated::startAnimation()
|
||||
{
|
||||
if (!isVisible()) {
|
||||
return;
|
||||
}
|
||||
//void SpliterAnimated::startAnimation()
|
||||
//{
|
||||
// if (!isVisible()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
m_currentOpacity = OpacityMini;
|
||||
// m_currentOpacity = OpacityMini;
|
||||
|
||||
if (m_dockPosition == Dock::Position::Top || m_dockPosition == Dock::Position::Bottom) {
|
||||
m_opacityChangeStep = (OpacityMax - OpacityMini) /
|
||||
(m_sizeAnimation->endValue().toSizeF().height() -
|
||||
m_sizeAnimation->startValue().toSizeF().height());
|
||||
} else {
|
||||
m_opacityChangeStep = (OpacityMax - OpacityMini) /
|
||||
(m_sizeAnimation->endValue().toSizeF().width() -
|
||||
m_sizeAnimation->startValue().toSizeF().width());
|
||||
}
|
||||
// if (m_dockPosition == Dock::Position::Top || m_dockPosition == Dock::Position::Bottom) {
|
||||
// m_opacityChangeStep = (OpacityMax - OpacityMini) /
|
||||
// (m_sizeAnimation->endValue().toSizeF().height() -
|
||||
// m_sizeAnimation->startValue().toSizeF().height());
|
||||
// } else {
|
||||
// m_opacityChangeStep = (OpacityMax - OpacityMini) /
|
||||
// (m_sizeAnimation->endValue().toSizeF().width() -
|
||||
// m_sizeAnimation->startValue().toSizeF().width());
|
||||
// }
|
||||
|
||||
m_sizeAnimation->start();
|
||||
// m_sizeAnimation->start();
|
||||
|
||||
update();
|
||||
}
|
||||
// update();
|
||||
//}
|
||||
|
||||
void SpliterAnimated::stopAnimation()
|
||||
{
|
||||
m_sizeAnimation->stop();
|
||||
m_currentOpacity = OpacityMini;
|
||||
//void SpliterAnimated::stopAnimation()
|
||||
//{
|
||||
// m_sizeAnimation->stop();
|
||||
// m_currentOpacity = OpacityMini;
|
||||
|
||||
update();
|
||||
}
|
||||
// update();
|
||||
//}
|
||||
|
||||
void SpliterAnimated::setDockPosition(const Dock::Position position)
|
||||
{
|
||||
|
@ -14,12 +14,12 @@ public:
|
||||
|
||||
void setStartValue(const QVariant &value);
|
||||
void setEndValue(const QVariant &value);
|
||||
void startAnimation();
|
||||
void stopAnimation();
|
||||
// void startAnimation();
|
||||
// void stopAnimation();
|
||||
void setDockPosition(const Dock::Position position);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void onSizeAnimationValueChanged(const QVariant &value);
|
||||
|
@ -42,11 +42,11 @@ Q_SIGNALS:
|
||||
void expandChanged(const bool expanded);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void enterEvent(QEvent *event) Q_DECL_OVERRIDE;
|
||||
void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void enterEvent(QEvent *event) override;
|
||||
void leaveEvent(QEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
|
@ -62,10 +62,10 @@ public slots:
|
||||
void onPluginSettingsChanged();
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
|
||||
void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
|
||||
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
|
||||
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void hideEvent(QHideEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
|
@ -51,13 +51,13 @@ Q_SIGNALS:
|
||||
void requestSwapWithDragging();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
|
||||
void enterEvent(QEvent *event) Q_DECL_OVERRIDE;
|
||||
void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void enterEvent(QEvent *event) override;
|
||||
void leaveEvent(QEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
|
@ -16,7 +16,7 @@
|
||||
class IndicatorTrayPrivate
|
||||
{
|
||||
public:
|
||||
IndicatorTrayPrivate(IndicatorTray *parent) : q_ptr(parent) {}
|
||||
explicit IndicatorTrayPrivate(IndicatorTray *parent) : q_ptr(parent) {}
|
||||
|
||||
void init();
|
||||
|
||||
|
@ -34,10 +34,10 @@ public:
|
||||
~IndicatorTrayWidget();
|
||||
|
||||
QString itemKeyForConfig() override;
|
||||
void setActive(const bool active) Q_DECL_OVERRIDE;
|
||||
void updateIcon() Q_DECL_OVERRIDE;
|
||||
const QImage trayImage() Q_DECL_OVERRIDE;
|
||||
void sendClick(uint8_t, int, int) Q_DECL_OVERRIDE;
|
||||
void setActive(const bool active) override;
|
||||
void updateIcon() override;
|
||||
const QImage trayImage() override;
|
||||
void sendClick(uint8_t, int, int) override;
|
||||
static QString toIndicatorKey(const QString &indicatorName) { return QString("indicator:%1").arg(indicatorName); }
|
||||
static bool isIndicatorKey(const QString &itemKey) { return itemKey.startsWith("indicator:"); }
|
||||
|
||||
|
@ -49,15 +49,15 @@ public:
|
||||
|
||||
public:
|
||||
SNITrayWidget(const QString &sniServicePath, QWidget *parent = Q_NULLPTR);
|
||||
virtual ~SNITrayWidget();
|
||||
virtual ~SNITrayWidget() override;
|
||||
|
||||
QString itemKeyForConfig() override;
|
||||
void setActive(const bool active) Q_DECL_OVERRIDE;
|
||||
void updateIcon() Q_DECL_OVERRIDE;
|
||||
void sendClick(uint8_t mouseButton, int x, int y) Q_DECL_OVERRIDE;
|
||||
const QImage trayImage() Q_DECL_OVERRIDE;
|
||||
void setActive(const bool active) override;
|
||||
void updateIcon() override;
|
||||
void sendClick(uint8_t mouseButton, int x, int y) override;
|
||||
const QImage trayImage() override;
|
||||
|
||||
bool isValid();
|
||||
bool isValid() override;
|
||||
SNITrayWidget::ItemStatus status();
|
||||
SNITrayWidget::ItemCategory category();
|
||||
|
||||
@ -102,7 +102,7 @@ private Q_SLOTS:
|
||||
void leaveEvent(QEvent *event) override;
|
||||
|
||||
private:
|
||||
void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
QPixmap newIconPixmap(IconType iconType);
|
||||
|
||||
private:
|
||||
|
@ -41,11 +41,11 @@ public:
|
||||
|
||||
public:
|
||||
QString itemKeyForConfig() override;
|
||||
void setActive(const bool active) Q_DECL_OVERRIDE;
|
||||
void updateIcon() Q_DECL_OVERRIDE;
|
||||
const QImage trayImage() Q_DECL_OVERRIDE;
|
||||
void sendClick(uint8_t mouseButton, int x, int y) Q_DECL_OVERRIDE;
|
||||
inline TrayType trayTyep() const Q_DECL_OVERRIDE { return TrayType::SystemTray; }
|
||||
void setActive(const bool active) override;
|
||||
void updateIcon() override;
|
||||
const QImage trayImage() override;
|
||||
void sendClick(uint8_t mouseButton, int x, int y) override;
|
||||
inline TrayType trayTyep() const override { return TrayType::SystemTray; }
|
||||
|
||||
QWidget *trayTipsWidget();
|
||||
QWidget *trayPopupApplet();
|
||||
@ -66,11 +66,11 @@ signals:
|
||||
void itemVisibleChanged(bool visible);
|
||||
|
||||
protected:
|
||||
bool event(QEvent *event) Q_DECL_OVERRIDE;
|
||||
void enterEvent(QEvent *event) Q_DECL_OVERRIDE;
|
||||
void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
|
||||
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
bool event(QEvent *event) override;
|
||||
void enterEvent(QEvent *event) override;
|
||||
void leaveEvent(QEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
void showEvent(QShowEvent* event) override;
|
||||
|
||||
protected:
|
||||
|
@ -42,12 +42,12 @@ public:
|
||||
explicit SystemTraysController(QObject *parent = nullptr);
|
||||
|
||||
// implements PluginProxyInterface
|
||||
void itemAdded(PluginsItemInterface * const itemInter, const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void itemUpdate(PluginsItemInterface * const itemInter, const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void itemRemoved(PluginsItemInterface * const itemInter, const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void requestWindowAutoHide(PluginsItemInterface * const itemInter, const QString &itemKey, const bool autoHide) Q_DECL_OVERRIDE;
|
||||
void requestRefreshWindowVisible(PluginsItemInterface * const itemInter, const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void requestSetAppletVisible(PluginsItemInterface * const itemInter, const QString &itemKey, const bool visible) Q_DECL_OVERRIDE;
|
||||
void itemAdded(PluginsItemInterface * const itemInter, const QString &itemKey) override;
|
||||
void itemUpdate(PluginsItemInterface * const itemInter, const QString &itemKey) override;
|
||||
void itemRemoved(PluginsItemInterface * const itemInter, const QString &itemKey) override;
|
||||
void requestWindowAutoHide(PluginsItemInterface * const itemInter, const QString &itemKey, const bool autoHide) override;
|
||||
void requestRefreshWindowVisible(PluginsItemInterface * const itemInter, const QString &itemKey) override;
|
||||
void requestSetAppletVisible(PluginsItemInterface * const itemInter, const QString &itemKey, const bool visible) override;
|
||||
|
||||
int systemTrayItemSortKey(const QString &itemKey);
|
||||
void setSystemTrayItemSortKey(const QString &itemKey, const int order);
|
||||
|
@ -169,7 +169,7 @@ int TrayPlugin::itemSortKey(const QString &itemKey)
|
||||
return m_systemTraysController->systemTrayItemSortKey(itemKey);
|
||||
}
|
||||
|
||||
const int defaultSort = displayMode() == Dock::DisplayMode::Fashion ? 0 : 0;
|
||||
const int defaultSort = 0;
|
||||
|
||||
AbstractTrayWidget *const trayWidget = m_trayMap.value(itemKey, nullptr);
|
||||
if (trayWidget == nullptr) {
|
||||
|
@ -46,17 +46,17 @@ class TrayPlugin : public QObject, PluginsItemInterface
|
||||
public:
|
||||
explicit TrayPlugin(QObject *parent = 0);
|
||||
|
||||
const QString pluginName() const Q_DECL_OVERRIDE;
|
||||
void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
|
||||
const QString pluginName() const override;
|
||||
void init(PluginProxyInterface *proxyInter) override;
|
||||
bool pluginIsDisable() override;
|
||||
void displayModeChanged(const Dock::DisplayMode mode) Q_DECL_OVERRIDE;
|
||||
void positionChanged(const Dock::Position position) Q_DECL_OVERRIDE;
|
||||
QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE;
|
||||
void refreshIcon(const QString &itemKey) Q_DECL_OVERRIDE;
|
||||
void displayModeChanged(const Dock::DisplayMode mode) override;
|
||||
void positionChanged(const Dock::Position position) override;
|
||||
QWidget *itemWidget(const QString &itemKey) override;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) override;
|
||||
QWidget *itemPopupApplet(const QString &itemKey) override;
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
void pluginSettingsChanged() override;
|
||||
|
||||
Dock::Position dockPosition() const;
|
||||
|
@ -440,44 +440,44 @@ QString XEmbedTrayWidget::getAppNameForWindow(quint32 winId)
|
||||
return appName;
|
||||
}
|
||||
|
||||
int XEmbedTrayWidget::getTrayWidgetKeySuffix(const QString &appName, quint32 winId)
|
||||
{
|
||||
int suffix = AppWinidSuffixMap.value(appName).value(winId, 0);
|
||||
//int XEmbedTrayWidget::getTrayWidgetKeySuffix(const QString &appName, quint32 winId)
|
||||
//{
|
||||
// int suffix = AppWinidSuffixMap.value(appName).value(winId, 0);
|
||||
|
||||
// return the exist suffix
|
||||
if (suffix != 0) {
|
||||
return suffix;
|
||||
}
|
||||
// // return the exist suffix
|
||||
// if (suffix != 0) {
|
||||
// return suffix;
|
||||
// }
|
||||
|
||||
// it is the first window for this application
|
||||
if (!AppWinidSuffixMap.contains(appName)) {
|
||||
QMap<quint32, int> winIdSuffixMap;
|
||||
winIdSuffixMap.insert(winId, 1);
|
||||
AppWinidSuffixMap.insert(appName, winIdSuffixMap);
|
||||
return 1;
|
||||
}
|
||||
// // it is the first window for this application
|
||||
// if (!AppWinidSuffixMap.contains(appName)) {
|
||||
// QMap<quint32, int> winIdSuffixMap;
|
||||
// winIdSuffixMap.insert(winId, 1);
|
||||
// AppWinidSuffixMap.insert(appName, winIdSuffixMap);
|
||||
// return 1;
|
||||
// }
|
||||
|
||||
QMap<quint32, int> subMap = AppWinidSuffixMap.value(appName);
|
||||
QList<int> suffixList = subMap.values();
|
||||
// QMap<quint32, int> subMap = AppWinidSuffixMap.value(appName);
|
||||
// QList<int> suffixList = subMap.values();
|
||||
|
||||
// suffix will never be 0
|
||||
suffixList.removeAll(0);
|
||||
std::sort(suffixList.begin(), suffixList.end());
|
||||
// // suffix will never be 0
|
||||
// suffixList.removeAll(0);
|
||||
// std::sort(suffixList.begin(), suffixList.end());
|
||||
|
||||
// get the minimum of useable suffix
|
||||
int index = 0;
|
||||
for (; index < suffixList.size(); ++index) {
|
||||
if (suffixList.at(index) != index + 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
suffix = index + 1;
|
||||
// // get the minimum of useable suffix
|
||||
// int index = 0;
|
||||
// for (; index < suffixList.size(); ++index) {
|
||||
// if (suffixList.at(index) != index + 1) {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// suffix = index + 1;
|
||||
|
||||
subMap.insert(winId, suffix);
|
||||
AppWinidSuffixMap.insert(appName, subMap);
|
||||
// subMap.insert(winId, suffix);
|
||||
// AppWinidSuffixMap.insert(appName, subMap);
|
||||
|
||||
return suffix;
|
||||
}
|
||||
// return suffix;
|
||||
//}
|
||||
|
||||
void XEmbedTrayWidget::setX11PassMouseEvent(const bool pass)
|
||||
{
|
||||
|
@ -36,10 +36,10 @@ public:
|
||||
~XEmbedTrayWidget();
|
||||
|
||||
QString itemKeyForConfig() override;
|
||||
void updateIcon() Q_DECL_OVERRIDE;
|
||||
void setActive(const bool active) Q_DECL_OVERRIDE;
|
||||
const QImage trayImage() Q_DECL_OVERRIDE;
|
||||
void sendClick(uint8_t mouseButton, int x, int y) Q_DECL_OVERRIDE;
|
||||
void updateIcon() override;
|
||||
void setActive(const bool active) override;
|
||||
const QImage trayImage() override;
|
||||
void sendClick(uint8_t mouseButton, int x, int y) override;
|
||||
|
||||
static QString getWindowProperty(quint32 winId, QString propName);
|
||||
static QString toXEmbedKey(quint32 winId);
|
||||
@ -47,9 +47,9 @@ public:
|
||||
virtual bool isValid() override {return m_valid;}
|
||||
|
||||
private:
|
||||
void showEvent(QShowEvent *e) Q_DECL_OVERRIDE;
|
||||
void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void showEvent(QShowEvent *e) override;
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
void mouseMoveEvent(QMouseEvent *e) override;
|
||||
void configContainerPosition();
|
||||
|
||||
void wrapWindow();
|
||||
@ -57,7 +57,7 @@ private:
|
||||
void refershIconImage();
|
||||
|
||||
static QString getAppNameForWindow(quint32 winId);
|
||||
static int getTrayWidgetKeySuffix(const QString &appName, quint32 winId);
|
||||
// static int getTrayWidgetKeySuffix(const QString &appName, quint32 winId);
|
||||
|
||||
private slots:
|
||||
void setX11PassMouseEvent(const bool pass);
|
||||
|
@ -4,7 +4,10 @@
|
||||
#include <QAccessible>
|
||||
#include <QTextDocument>
|
||||
|
||||
TipsWidget::TipsWidget(QWidget *parent) : QFrame(parent)
|
||||
TipsWidget::TipsWidget(QWidget *parent)
|
||||
: QFrame(parent)
|
||||
, m_width(0)
|
||||
, m_type(SingleLine)
|
||||
{
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user