diff --git a/BiometricAuth/CMakeLists.txt b/BiometricAuth/CMakeLists.txt index 7461d00..e1b52a5 100644 --- a/BiometricAuth/CMakeLists.txt +++ b/BiometricAuth/CMakeLists.txt @@ -18,6 +18,7 @@ include_directories( ${Qt5Widgets_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} + ${GIOUNIX2_INCLUDE_DIRS} ) diff --git a/BiometricAuth/giodbus.cpp b/BiometricAuth/giodbus.cpp index 399aa0e..02a362b 100644 --- a/BiometricAuth/giodbus.cpp +++ b/BiometricAuth/giodbus.cpp @@ -17,7 +17,7 @@ **/ #include "giodbus.h" #include -#include +#include #include int get_server_gvariant_stdout (int drvid) diff --git a/data/screensaver-startup.sh b/data/screensaver-startup.sh index c110d2e..822388a 100755 --- a/data/screensaver-startup.sh +++ b/data/screensaver-startup.sh @@ -1,5 +1,4 @@ #!/bin/bash -/usr/lib/ukui-screensaver/set4kScale >/dev/null 2>&1 ukui-screensaver-dialog --lock-startup & >/dev/null 2>&1 /usr/lib/ukui-screensaver/screensaver-focus-helper & >/dev/null 2>&1 diff --git a/screensaver/screensaver.cpp b/screensaver/screensaver.cpp index b519a57..dfb1b31 100644 --- a/screensaver/screensaver.cpp +++ b/screensaver/screensaver.cpp @@ -989,7 +989,7 @@ void Screensaver::setDatelayout() if(dateType == "cn") this->dateOfDay->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("周","星期")); else - this->dateOfDay->setText(QDate::currentDate().toString("yyyy-MM-dd ddd")); + this->dateOfDay->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("周","星期")); this->dateOfDay->setObjectName("dateOfDay"); this->dateOfDay->setAlignment(Qt::AlignCenter); this->dateOfDay->adjustSize(); @@ -1105,7 +1105,7 @@ void Screensaver::updateTime() if(dateType == "cn") this->dateOfDay->setText(curDateTime.date().toString("yyyy/MM/dd ddd").replace("周","星期")); else - this->dateOfDay->setText(curDateTime.date().toString("yyyy-MM-dd ddd")); + this->dateOfDay->setText(curDateTime.date().toString("yyyy-MM-dd ddd").replace("周","星期")); m_lastDateTime = curDateTime; } diff --git a/src/authdialog.cpp b/src/authdialog.cpp index 6bf170b..e179b46 100644 --- a/src/authdialog.cpp +++ b/src/authdialog.cpp @@ -123,7 +123,7 @@ void AuthDialog::initUI() m_userWidget->setObjectName(QStringLiteral("userWidget")); /* 头像 */ - const QString SheetStyle = QString("border-radius: %1px; border:0px solid white;").arg(77*scale); + const QString SheetStyle = QString("border-radius: %1px; border:0px solid white;").arg((int)(77*scale)); m_labelHeadImg = new QLabel(m_userWidget); m_labelHeadImg->setObjectName(QStringLiteral("faceLabel")); m_labelHeadImg->setFocusPolicy(Qt::NoFocus); @@ -451,17 +451,17 @@ void AuthDialog::setChildrenGeometry() width(), 376*scale); m_labelLoginTypeTip->setGeometry(0,0,m_userWidget->width(), 30); m_labelLoginTypeTip->setAlignment(Qt::AlignCenter); - m_labelHeadImg->setStyleSheet(QString("border-radius: %1px; border:0px solid white;").arg(77*scale)); + m_labelHeadImg->setStyleSheet(QString("border-radius: %1px; border:0px solid white;").arg((int)(77*scale))); m_labelHeadImg->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale); QPixmap facePixmap = makeRoundLogo(user.icon, 154*scale, 154*scale, 77*scale); m_labelHeadImg->setPixmap(facePixmap); - m_labelQRCode->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,100%);").arg(6*scale)); + m_labelQRCode->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,100%);").arg((int)(6*scale))); m_labelQRCode->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale); setQRCode(m_imgQRCode); - m_labelFace->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,10%);").arg(77*scale)); + m_labelFace->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,10%);").arg((int)(77*scale))); m_labelFace->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale); QImage faceImg; setFaceImg(faceImg); @@ -1074,6 +1074,12 @@ void AuthDialog::performBiometricAuth() { qWarning() << "No available devices"; skipBiometricAuth(); + if (m_deviceInfo) { + if (!m_widgetLoginOpts || !m_widgetLoginOpts->findDeviceById(m_deviceInfo->id) + || m_widgetLoginOpts->isDeviceDisable(m_deviceInfo->id)) { + m_deviceInfo = DeviceInfoPtr(); + } + } return; } @@ -1386,7 +1392,7 @@ void AuthDialog::setFaceImg(QImage& imgFace, int nStatus) break; case 2: faceImage = m_widgetLoginOpts->loadSvg(":/image/assets/ukui-loginopt-smile.svg", "gray", 48); - m_labelFace->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,20%);").arg(77*scale)); + m_labelFace->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,10%);").arg((int)(77*scale))); break; default: faceImage = QPixmap(":/image/assets/ukui-loginopt-smile.svg"); @@ -1467,6 +1473,9 @@ void AuthDialog::onLoginOptsCount(unsigned uCount, bool is_bioBtn) if(m_widgetLoginOpts->getLoginOptCount() < 1) { qWarning() << "No available devices"; + if (m_deviceInfo) { + m_deviceInfo = DeviceInfoPtr(); + } return; } @@ -1592,6 +1601,12 @@ void AuthDialog::onBiometricDbusChanged(bool bActive) if(m_widgetLoginOpts->getLoginOptCount() < 1) { qWarning() << "No available devices"; + if (m_deviceInfo) { + if (!m_widgetLoginOpts || !m_widgetLoginOpts->findDeviceById(m_deviceInfo->id) + || m_widgetLoginOpts->isDeviceDisable(m_deviceInfo->id)) { + m_deviceInfo = DeviceInfoPtr(); + } + } return; } diff --git a/src/lockwidget.cpp b/src/lockwidget.cpp index 5461ace..daef32c 100644 --- a/src/lockwidget.cpp +++ b/src/lockwidget.cpp @@ -61,8 +61,8 @@ #define TIME_TYPE_SCHEMA "org.ukui.control-center.panel.plugins" #define CONFIG_FILE "/etc/lightdm/ukui-greeter.conf" #define ON_TAB_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: 2px solid #2C73C8;}" -#define ON_NORMAL_SHEET "QPushButton{text-align:center;color: rgb(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \ - QPushButton::hover{background-color: rgb(255,255,255,15%);} \ +#define ON_NORMAL_SHEET "QPushButton{text-align:center;color: rgba(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \ + QPushButton::hover{background-color: rgba(255,255,255,15%);} \ QPushButton::pressed {background-color: rgba(255,255,255,40%);}\ QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}" float scale; @@ -709,7 +709,7 @@ void LockWidget::initUI() if(dateType == "cn") ui->lblDate->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("周","星期")); else - ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd")); + ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("周","星期")); }); if(timeType == 12) @@ -728,7 +728,7 @@ void LockWidget::initUI() if(dateType == "cn") ui->lblDate->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("周","星期")); else - ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd")); + ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("周","星期")); ui->lblDate->setFontSize(18); ui->lblDate->setAlignment(Qt::AlignCenter); @@ -801,8 +801,8 @@ void LockWidget::initUI() // }); btnNetworkManager = new KyNetworkIcon(this); - btnNetworkManager->setStyleSheet("QPushButton{text-align:center;color: rgb(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \ - QPushButton::hover{background-color: rgb(255,255,255,15%);} \ + btnNetworkManager->setStyleSheet("QPushButton{text-align:center;color: rgba(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \ + QPushButton::hover{background-color: rgba(255,255,255,15%);} \ QPushButton::pressed {background-color: rgba(255,255,255,40%);}\ QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}"); btnNetworkManager->setCheckable(true); diff --git a/src/loginoptionswidget.cpp b/src/loginoptionswidget.cpp index 66a3837..f2f1b95 100644 --- a/src/loginoptionswidget.cpp +++ b/src/loginoptionswidget.cpp @@ -42,7 +42,7 @@ #define ON_TAB_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: 2px solid #2C73C8;}" #define ON_NORMAL_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: none;}\ - QPushButton::hover{ background-color: rgb(255,255,255,40%);}\ + QPushButton::hover{ background-color: rgba(255,255,255,40%);}\ QPushButton::pressed {background-color: rgba(255,255,255,40%);}\ QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}" diff --git a/src/rootWindowBackground.cpp b/src/rootWindowBackground.cpp index ee37349..eb3d534 100644 --- a/src/rootWindowBackground.cpp +++ b/src/rootWindowBackground.cpp @@ -30,7 +30,8 @@ #include "rootWindowBackground.h" -Pixmap pix; +static const XID INVAL_ID = ~0UL; +Pixmap pix = INVAL_ID; Display *dpy = NULL; Window root = 0; Screen *scn = NULL; @@ -189,6 +190,10 @@ void setRootWindowBackground(bool type,unsigned int color,char *filename, int nO if(!root) root = DefaultRootWindow(dpy); + if (pix != INVAL_ID) { + XFreePixmap(dpy, pix); + pix = INVAL_ID; + } pix = XCreatePixmap(dpy, root, width, height, DefaultDepthOfScreen(scn)); @@ -385,7 +390,8 @@ void drawBackground(bool isDraw) return ; } if (isDraw) { - XSetWindowBackgroundPixmap(dpy, root, pix); + if (pix != INVAL_ID) + XSetWindowBackgroundPixmap(dpy, root, pix); XClearWindow(dpy, root); } @@ -393,7 +399,10 @@ void drawBackground(bool isDraw) XEvent ev; XNextEvent(dpy, &ev); } - XFreePixmap(dpy, pix); + if (pix != INVAL_ID) { + XFreePixmap(dpy, pix); + pix = INVAL_ID; + } XCloseDisplay(dpy); dpy = NULL; }