Merge branch '1029' into 'dbus-interface'
add drownlabel.pri See merge request kylin-desktop/kylin-nm!403
This commit is contained in:
commit
d11e35067a
|
@ -0,0 +1,9 @@
|
|||
#LIBINTERFACE_NAME = $$qtLibraryTarget(drownlabel)
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/DrownLabel/drownlabel.cpp \
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/DrownLabel/drownlabel.h \
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
#include <QTimer>
|
||||
#include <QDebug>
|
||||
#include "../component/SwitchButton/switchbutton.h"
|
||||
#include "drownlabel.h"
|
||||
#include "../component/DrownLabel/drownlabel.h"
|
||||
|
||||
class DeviceFrame : public QFrame
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ CONFIG += plugin
|
|||
|
||||
include(../component/switchbutton.pri)
|
||||
include(../component/infobutton.pri)
|
||||
include(../component/drownlabel.pri)
|
||||
|
||||
TARGET = $$qtLibraryTarget(netconnect)
|
||||
DESTDIR = ../..
|
||||
|
@ -29,7 +30,7 @@ PKGCONFIG += gsettings-qt \
|
|||
SOURCES += \
|
||||
addnetbtn.cpp \
|
||||
deviceframe.cpp \
|
||||
drownlabel.cpp \
|
||||
# drownlabel.cpp \
|
||||
itemframe.cpp \
|
||||
lanitem.cpp \
|
||||
netconnect.cpp
|
||||
|
@ -37,7 +38,7 @@ SOURCES += \
|
|||
HEADERS += \
|
||||
addnetbtn.h \
|
||||
deviceframe.h \
|
||||
drownlabel.h \
|
||||
# drownlabel.h \
|
||||
itemframe.h \
|
||||
lanitem.h \
|
||||
netconnect.h
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QDebug>
|
||||
#include "drownlabel.h"
|
||||
#include "../component/DrownLabel/drownlabel.h"
|
||||
|
||||
class DeviceFrame : public QFrame
|
||||
{
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
#include "drownlabel.h"
|
||||
#include "deviceframe.h"
|
||||
|
||||
#define ICONSIZE 12,12
|
||||
DrownLabel::DrownLabel(QString devName, QWidget * parent) : QLabel(parent)
|
||||
{
|
||||
m_devName = devName;
|
||||
setFixedSize(36,36);
|
||||
// setFlat(true);
|
||||
loadPixmap(isChecked);
|
||||
}
|
||||
|
||||
DrownLabel::~DrownLabel()
|
||||
{
|
||||
|
||||
}
|
||||
void DrownLabel::setDropDownStatus(bool status)
|
||||
{
|
||||
isChecked = status;
|
||||
loadPixmap(isChecked);
|
||||
}
|
||||
|
||||
void DrownLabel::loadPixmap(bool isChecked)
|
||||
{
|
||||
if (isChecked) {
|
||||
if (QIcon::fromTheme("ukui-up-symbolic").isNull()) {
|
||||
qDebug() << "ukui-up-symbolic is missing";
|
||||
}
|
||||
setPixmap(QIcon::fromTheme("ukui-up-symbolic").pixmap(ICONSIZE));
|
||||
} else {
|
||||
if (QIcon::fromTheme("ukui-down-symbolic").isNull()) {
|
||||
qDebug() << "ukui-down-symbolic is missing";
|
||||
}
|
||||
setPixmap(QIcon::fromTheme("ukui-down-symbolic").pixmap(ICONSIZE));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DrownLabel::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
emit labelClicked();
|
||||
QWidget::mouseReleaseEvent(event);
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
#ifndef DROWNLABEL_H
|
||||
#define DROWNLABEL_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
#include <QMouseEvent>
|
||||
#include <QPushButton>
|
||||
|
||||
class DrownLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DrownLabel(QString devName, QWidget * parent = nullptr);
|
||||
~DrownLabel();
|
||||
void setDropDownStatus(bool status);
|
||||
QString m_devName;
|
||||
bool isChecked = true;
|
||||
|
||||
private:
|
||||
void loadPixmap(bool isChecked);
|
||||
|
||||
protected:
|
||||
virtual void mouseReleaseEvent(QMouseEvent * event);
|
||||
|
||||
Q_SIGNALS:
|
||||
void labelClicked();
|
||||
};
|
||||
|
||||
#endif // DROWNLABEL_H
|
|
@ -4,6 +4,7 @@ CONFIG += plugin
|
|||
|
||||
include(../component/switchbutton.pri)
|
||||
include(../component/infobutton.pri)
|
||||
include(../component/drownlabel.pri)
|
||||
|
||||
TARGET = $$qtLibraryTarget(wlanconnect)
|
||||
DESTDIR = ../..
|
||||
|
@ -28,14 +29,14 @@ PKGCONFIG += gsettings-qt \
|
|||
|
||||
SOURCES += \
|
||||
deviceframe.cpp \
|
||||
drownlabel.cpp \
|
||||
# drownlabel.cpp \
|
||||
itemframe.cpp \
|
||||
wlanconnect.cpp \
|
||||
wlanitem.cpp
|
||||
|
||||
HEADERS += \
|
||||
deviceframe.h \
|
||||
drownlabel.h \
|
||||
# drownlabel.h \
|
||||
itemframe.h \
|
||||
wlanconnect.h \
|
||||
wlanitem.h
|
||||
|
|
Loading…
Reference in New Issue