Disable hover effect on "display-only" actions in KIO plugin
This commit is contained in:
parent
77daa58f4e
commit
c11d527a54
|
@ -19,6 +19,8 @@
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
@ -89,6 +91,27 @@ void SyncthingMenuAction::updateStatus(SyncthingStatus status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SyncthingInfoAction::SyncthingInfoAction(QObject *parent) :
|
||||||
|
QWidgetAction(parent)
|
||||||
|
{}
|
||||||
|
|
||||||
|
QWidget *SyncthingInfoAction::createWidget(QWidget *parent)
|
||||||
|
{
|
||||||
|
auto *container = new QWidget(parent);
|
||||||
|
auto *layout = new QHBoxLayout(parent);
|
||||||
|
layout->setMargin(4);
|
||||||
|
layout->setSpacing(5);
|
||||||
|
auto *iconLabel = new QLabel(parent);
|
||||||
|
iconLabel->setPixmap(icon().pixmap(16));
|
||||||
|
iconLabel->setFixedWidth(16);
|
||||||
|
iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
|
||||||
|
layout->addWidget(iconLabel);
|
||||||
|
auto *textLabel = new QLabel(text(), parent);
|
||||||
|
layout->addWidget(textLabel);
|
||||||
|
container->setLayout(layout);
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
SyncthingDirActions::SyncthingDirActions(const SyncthingDir &dir, QObject *parent) :
|
SyncthingDirActions::SyncthingDirActions(const SyncthingDir &dir, QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_dirId(dir.id)
|
m_dirId(dir.id)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <KAbstractFileItemActionPlugin>
|
#include <KAbstractFileItemActionPlugin>
|
||||||
#include <KFileItemListProperties>
|
#include <KFileItemListProperties>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QWidgetAction>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QWidget)
|
QT_FORWARD_DECLARE_CLASS(QWidget)
|
||||||
|
|
||||||
|
@ -26,6 +26,17 @@ private:
|
||||||
KFileItemListProperties m_properties;
|
KFileItemListProperties m_properties;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class SyncthingInfoAction : public QWidgetAction
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
SyncthingInfoAction(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QWidget *createWidget(QWidget *parent);
|
||||||
|
};
|
||||||
|
|
||||||
class SyncthingDirActions : public QObject
|
class SyncthingDirActions : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -41,9 +52,9 @@ public Q_SLOTS:
|
||||||
private:
|
private:
|
||||||
QString m_dirId;
|
QString m_dirId;
|
||||||
QAction m_infoAction;
|
QAction m_infoAction;
|
||||||
QAction m_statusAction;
|
SyncthingInfoAction m_statusAction;
|
||||||
QAction m_lastScanAction;
|
SyncthingInfoAction m_lastScanAction;
|
||||||
QAction m_rescanIntervalAction;
|
SyncthingInfoAction m_rescanIntervalAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
QList<QAction *> &operator <<(QList<QAction *> &actions, SyncthingDirActions &dirActions);
|
QList<QAction *> &operator <<(QList<QAction *> &actions, SyncthingDirActions &dirActions);
|
||||||
|
|
Loading…
Reference in New Issue