feat(merge v101-tablet codes): merge v101-tablet codes

Description: 合并v101-tablet最新代码

Log: 无
This commit is contained in:
winnerym 2023-04-10 17:46:41 +08:00
parent 4df7a2d7ba
commit 7378b62a97
163 changed files with 8778 additions and 5040 deletions

View File

@ -1,8 +1,6 @@
qt5_wrap_cpp(BiometricAuth_SRC
biometricdeviceinfo.h
biometricproxy.h
biometricauthwidget.h
biometricdeviceswidget.h
biometricproxy.h
giodbus.h
uniauthservice.h
)
@ -10,9 +8,7 @@ qt5_wrap_cpp(BiometricAuth_SRC
set(BiometricAuth_SRC
${BiometricAuth_SRC}
biometricdeviceinfo.cpp
biometricproxy.cpp
biometricauthwidget.cpp
biometricdeviceswidget.cpp
biometricproxy.cpp
giodbus.cpp
uniauthservice.cpp
)
@ -20,11 +16,11 @@ set(BiometricAuth_SRC
include_directories(
${Qt5Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5DBus_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${Qt5DBus_INCLUDE_DIRS}
${GLIB2_INCLUDE_DIRS}
)
add_library(BiometricAuth STATIC ${BiometricAuth_SRC})
target_link_libraries(BiometricAuth Qt5::Core Qt5::DBus Qt5::Widgets ${OpenCV_LIBS} ${GIOUNIX2_LIBRARIES})
target_link_libraries(BiometricAuth Qt5::Core Qt5::DBus Qt5::Widgets
${GIOUNIX2_LIBRARIES})

View File

@ -67,6 +67,8 @@ QString DeviceType::getDeviceType_tr(int deviceType)
return tr("Face");
case VoicePrint:
return tr("VoicePrint");
case LOGINOPT_TYPE_GENERAL_UKEY:
return tr("ukey");
case REMOTE_QRCODE_TYPE:
return tr("QRCode");
default:
@ -126,10 +128,33 @@ const QDBusArgument &operator >>(const QDBusArgument &arg, DeviceInfo &deviceInf
return arg;
}
/* For the type FeatureInfo */
QDBusArgument &operator<<(QDBusArgument &argument, const FeatureInfo &featureInfo)
{
argument.beginStructure();
argument << featureInfo.uid << featureInfo.biotype
<< featureInfo.device_shortname << featureInfo.index
<< featureInfo.index_name;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, FeatureInfo &featureInfo)
{
argument.beginStructure();
argument >> featureInfo.uid >> featureInfo.biotype
>> featureInfo.device_shortname >> featureInfo.index
>> featureInfo.index_name;
argument.endStructure();
return argument;
}
void registerMetaType()
{
qRegisterMetaType<DeviceInfo>("DeviceInfo");
qDBusRegisterMetaType<DeviceInfo>();
qRegisterMetaType<FeatureInfo>("FeatureInfo");
qDBusRegisterMetaType<FeatureInfo>();
}

View File

@ -212,20 +212,35 @@ struct DeviceInfo
int OpsStatus;
};
struct FeatureInfo {
int uid;
int biotype;
QString device_shortname;
int index;
QString index_name;
};
class QDBusArgument;
QDBusArgument &operator <<(QDBusArgument &arg, const DeviceInfo &deviceInfo);
const QDBusArgument &operator >>(const QDBusArgument &arg, DeviceInfo &deviceInfo);
QDBusArgument &operator<<(QDBusArgument &argument, const FeatureInfo &featureInfo);
const QDBusArgument &operator>>(const QDBusArgument &argument, FeatureInfo &featureInfo);
void registerMetaType();
typedef std::shared_ptr<DeviceInfo> DeviceInfoPtr;
typedef QList<DeviceInfoPtr> DeviceList;
typedef QMap<int, DeviceList> DeviceMap;
typedef std::shared_ptr<FeatureInfo> FeatureInfoPtr;
typedef QList<FeatureInfoPtr> FeatureList;
typedef QMap<QString, FeatureList> FeatureMap;
QDebug operator <<(QDebug stream, const DeviceInfo &deviceInfo);
Q_DECLARE_METATYPE(DeviceInfo)
Q_DECLARE_METATYPE(FeatureInfo)
/**
* @brief
@ -266,6 +281,8 @@ enum LOGINOPT_TYPE {
LOGINOPT_TYPE_IRIS, // 虹膜
LOGINOPT_TYPE_VOICEPRINT, // 声纹
LOGINOPT_TYPE_FINGERVEIN, // 指静脉
LOGINOPT_TYPE_GENERAL_UKEY, // 普通的ukey
LOGINOPT_TYPE_ADVANCED_UKEY, // 高阶的ukey
LOGINOPT_TYPE_QRCODE, // 二维码
LOGINOPT_TYPE_OTHERS, // 其他
LOGINOPT_TYPE_COUNT

View File

@ -18,6 +18,7 @@
**/
#include "biometricproxy.h"
#include <QDebug>
#include <QDBusArgument>
BiometricProxy::BiometricProxy(QObject *parent)
: QDBusAbstractInterface(BIOMETRIC_DBUS_SERVICE,
@ -37,6 +38,41 @@ QDBusPendingCall BiometricProxy::Identify(int drvid, int uid, int indexStart, in
return asyncCallWithArgumentList(QStringLiteral("Identify"), argList);
}
QDBusPendingCall BiometricProxy::UkeyIdentify(int drvid, int type, int uid)
{
QList<QVariant> argList;
argList << drvid << type << uid;
return asyncCallWithArgumentList(QStringLiteral("UkeyIdentify"), argList);
}
bool BiometricProxy::GetHasUkeyFeature(int uid, int indexStart, int indexEnd)
{
QList<QDBusVariant> qlist;
FeatureInfo *featureInfo;
int listsize;
QDBusMessage result = call(QStringLiteral("GetAllFeatureList"),uid,indexStart,indexEnd);
if(result.type() == QDBusMessage::ErrorMessage)
{
qWarning() << "GetDevList error:" << result.errorMessage();
return false;
}
QList<QVariant> variantList = result.arguments();
listsize = variantList[0].value<int>();
variantList[1].value<QDBusArgument>() >> qlist;
for (int i = 0; i < listsize; i++) {
featureInfo = new FeatureInfo;
qlist[i].variant().value<QDBusArgument>() >> *featureInfo;
if(featureInfo->biotype == LOGINOPT_TYPE_GENERAL_UKEY){
delete featureInfo;
return true;
}
delete featureInfo;
}
return false;
}
int BiometricProxy::GetFeatureCount(int uid, int indexStart, int indexEnd)
{
QDBusMessage result = call(QStringLiteral("GetDevList"));
@ -68,6 +104,17 @@ int BiometricProxy::GetFeatureCount(int uid, int indexStart, int indexEnd)
return res;
}
int BiometricProxy::SetExtraInfo(QString info_type,QString extra_info)
{
QDBusReply<int> reply = call(QStringLiteral("SetExtraInfo"), info_type, extra_info);
if(!reply.isValid())
{
qWarning() << "SetExtraInfo error:" << reply.error();
return -1;
}
return reply.value();
}
int BiometricProxy::StopOps(int drvid, int waiting)
{
QDBusReply<int> reply = call(QStringLiteral("StopOps"), drvid, waiting);
@ -145,6 +192,28 @@ DeviceList BiometricProxy::GetDevList()
return deviceList;
}
FeatureMap BiometricProxy::GetUserFeatures(int uid)
{
FeatureMap featureMap;
QList<QDBusVariant> qlist;
int listsize;
QDBusMessage result = call(QStringLiteral("GetAllFeatureList"), uid, 0, -1);
if(result.type() == QDBusMessage::ErrorMessage)
{
qWarning() << "GetDevList error:" << result.errorMessage();
return featureMap;
}
QList<QVariant> variantList = result.arguments();
listsize = variantList[0].value<int>();
variantList[1].value<QDBusArgument>() >> qlist;
for (int i = 0; i < listsize; i++) {
FeatureInfoPtr pFeatureInfo = std::make_shared<FeatureInfo>();
qlist[i].variant().value<QDBusArgument>() >> *pFeatureInfo;
featureMap[pFeatureInfo->device_shortname].append(pFeatureInfo);
}
return featureMap;
}
int BiometricProxy::GetDevCount()
{
QDBusMessage result = call(QStringLiteral("GetDevList"));

View File

@ -65,6 +65,21 @@ public Q_SLOTS:
* @return <int result, int uid> id)
*/
QDBusPendingCall Identify(int drvid, int uid, int indexStart = 0, int indexEnd = -1);
/**
* @brief 使id的设备进行用户认证
* @param drvid id
* @param type ukey的认证类型2pin认证setExtraInfo设置pin码,3
* @param uid id
* @return <int result, int uid> id)
*/
QDBusPendingCall UkeyIdentify(int drvid, int type, int uid);
/**
* @brief
* @param info_type ukey pincode认证时传 "pincode"
* @param extra_info ukey pincode认证时传PIN码内容
* @return <int result> )
*/
int SetExtraInfo(QString info_type, QString extra_info);
/**
* @brief
* @param drvid id
@ -80,6 +95,14 @@ public Q_SLOTS:
* @return
*/
int GetFeatureCount(int uid, int indexStart = 0, int indexEnd = -1);
/**
* @brief
* @param uid id
* @param indexStart
* @param indexEnd
* @return ukey特征
*/
bool GetHasUkeyFeature(int uid, int indexStart = 0, int indexEnd = -1);
/**
* @brief
* @return
@ -117,7 +140,12 @@ public Q_SLOTS:
StatusReslut UpdateStatus(int drvid);
int GetUserDevCount(int uid);
int GetUserDevFeatureCount(int uid,int drvid);
/**
* @brief GetUserFeatures
* @param uid id
* @return
*/
FeatureMap GetUserFeatures(int uid);
Q_SIGNALS:
/**

View File

@ -5,10 +5,13 @@ find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras Xml Network Svg)
find_package(PkgConfig REQUIRED)
find_package(OpenCV REQUIRED)
find_package(PkgConfig)
find_package(KF5Screen REQUIRED)
find_package(KF5Wayland REQUIRED)
pkg_check_modules(GIOUNIX2 REQUIRED gio-unix-2.0)
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
pkg_check_modules(kylin-nm-base REQUIRED kylin-nm-base)
pkg_check_modules(KScreen REQUIRED kscreen2)
# intel
option (USE_INTEL "intel项目" OFF)

View File

@ -1,7 +1,10 @@
pkg_check_modules(GLIB REQUIRED glib-2.0)
qt5_wrap_cpp(Common_SRC
autoresize.h
checkbutton.h
commonfunc.h
glibinterface.h
)
set(Common_SRC
@ -9,14 +12,15 @@ set(Common_SRC
autoresize.cpp
checkbutton.cpp
commonfunc.cpp
glibinterface.cpp
)
include_directories(
${Qt5Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5DBus_INCLUDE_DIRS}
${GLIB2_INCLUDE_DIRS}
)
add_library(Common STATIC ${Common_SRC})
target_link_libraries(Common Qt5::Core Qt5::DBus Qt5::Widgets)
target_link_libraries(Common Qt5::Core Qt5::DBus Qt5::Widgets ${GIOUNIX2_LIBRARIES})

View File

@ -22,6 +22,7 @@
#include <QSettings>
#include <QMimeDatabase>
#include <QPainter>
#include <QPainterPath>
#include <QFileInfo>
#include <QFontMetrics>
#include "commonfunc.h"

View File

@ -25,6 +25,8 @@
#include <QFont>
#include <QPixmap>
#define G_FONT_SIZE (11.0)
bool ispicture(QString filepath);
QString getSystemVersion();
QString getSystemDistrib();

31
Common/glibinterface.cpp Normal file
View File

@ -0,0 +1,31 @@
#include "glibinterface.h"
#include <QString>
#include <gio/gio.h>
#define STYLE_TYPE_SCHEMA "org.ukui.style"
#define KEY_SYSTEM_FONT_SIZE "system-font-size"
#define DEFAULT_FONT_SIZE (10.0)
double getDefaultFontSize()
{
GSettingsSchemaSource *schema_source = NULL;
GSettingsSchema *schema = NULL;
schema_source = g_settings_schema_source_get_default();
if(schema_source){
schema = g_settings_schema_source_lookup (schema_source,KEY_SYSTEM_FONT_SIZE,TRUE);
if(schema){
GVariant *size;
unsigned long length;
GSettings *gs;
gs = g_settings_new(STYLE_TYPE_SCHEMA);
size = g_settings_get_default_value(gs, KEY_SYSTEM_FONT_SIZE);
QString fontsize(g_variant_get_string(size,&length));
g_object_unref(gs);
return fontsize.toDouble();
}
}
return DEFAULT_FONT_SIZE;
}

7
Common/glibinterface.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef GLIBINTERFACE_H
#define GLIBINTERFACE_H
double getDefaultFontSize();
#endif // LOCKWIDGET_H

View File

@ -2470,6 +2470,7 @@ void KylinNM::enWifiDone()
qDebug()<<"debug: already turn on the switch of wifi network";
syslog(LOG_DEBUG, "Already turn on the switch of wifi network");
QTimer::singleShot(200, this, &KylinNM::onConnectChanged);
}
void KylinNM::disWifiDone()
{

View File

@ -9,11 +9,16 @@ qt5_add_resources(VirtualKeyboard_SRC
set(VirtualKeyboard_SRC
${VirtualKeyboard_SRC}
src/cursormonitor.cpp
src/keyboardwidget.cpp
src/virtualkeyboard.cpp
src/x11keyboard.cpp
src/keyboard.qrc)
src/charsmorewidget.cpp
src/charswidget.cpp
src/dragwidget.cpp
src/kbbutton.cpp
src/kbtitle.cpp
src/letterswidget.cpp
src/numberswidget.cpp
src/virtualkeyboardwidget.cpp
src/x11keyboard.cpp
)
include_directories(
${Qt5Core_INCLUDE_DIRS}

View File

@ -1,18 +1,26 @@
SOURCES += \
$$PWD/src/keyboardwidget.cpp \
$$PWD/src/x11keyboard.cpp \
$$PWD/src/cursormonitor.cpp \
$$PWD/src/virtualkeyboard.cpp
$$PWD/src/charsmorewidget.cpp \
$$PWD/src/charswidget.cpp \
$$PWD/src/dragwidget.cpp \
$$PWD/src/kbbutton.cpp \
$$PWD/src/kbtitle.cpp \
$$PWD/src/letterswidget.cpp \
$$PWD/src/numberswidget.cpp \
$$PWD/src/virtualkeyboardwidget.cpp \
$$PWD/src/x11keyboard.cpp
HEADERS += \
$$PWD/src/keyboardwidget.h \
$$PWD/src/x11keyboard.h \
$$PWD/src/cursormonitor.h \
$$PWD/src/virtualkeyboard.h
FORMS += \
$$PWD/src/keyboardwidget.ui
$$PWD/src/charsmorewidget.h \
$$PWD/src/charswidget.h \
$$PWD/src/commondef.h \
$$PWD/src/dragwidget.h \
$$PWD/src/kbbutton.h \
$$PWD/src/kbtitle.h \
$$PWD/src/letterswidget.h \
$$PWD/src/numberswidget.h \
$$PWD/src/virtualkeyboardwidget.h \
$$PWD/src/x11keyboard.h
RESOURCES += \

View File

@ -0,0 +1,172 @@
#include "charsmorewidget.h"
#include "commondef.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QScrollArea>
#include <QScrollBar>
#include <QVariant>
#include <QDebug>
CharsMoreWidget::CharsMoreWidget(QWidget *parent/* = nullptr*/)
: QWidget(parent)
{
this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
setWindowFlags(Qt::FramelessWindowHint |
Qt::WindowStaysOnTopHint |
Qt::WindowDoesNotAcceptFocus);
initUI();
}
CharsMoreWidget::~CharsMoreWidget()
{
}
void CharsMoreWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
{
QMap<QWidget*, QRect>::iterator itGeometry = m_mapBtnGeometrys.begin();
for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) {
QWidget *widget = itGeometry.key();
if (widget) {
QRect oldGeometry = itGeometry.value();
QRect newGeometry = oldGeometry;
if (floatStatus) {
newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
} else {
newGeometry.setX(oldGeometry.x()*lfWidthScale);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
}
widget->setGeometry(newGeometry);
}
}
QChar chChars[] = {',', '.', '?', '!', '\'', ':', '~', '@', ';', '"',
'/', '(', ')', '_', '+', '=', '`', '^', '#', '*',
'%', '&', '\\', '[', ']', '<', '>', '{', '}', '|',
'$', '-'};
for (int n = 0; n < sizeof(chChars)/sizeof(QChar); n++) { //单独更新符号btn的高度
QString objName = QString("btn_%1").arg(QString(chChars[n]));
KBButton *btn = findChild<KBButton*>(objName);
btn->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NORMAL_CHARSMORE_BTN_HEIGHT *lfHeightScale);
}
//更新listfarame的高度
listFrame->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NORMAL_CHARSMORE_BTN_HEIGHT *m_vlayoutBtnList->count() *lfHeightScale);
}
void CharsMoreWidget::onBtnClicked(QChar charId)
{
QObject *obj = sender();
KBButton *btn = static_cast<KBButton*>(obj);
QString objName = btn->objectName();
int lastUnderline = objName.lastIndexOf('_');
int start = strlen("btn_");
int keyLength = lastUnderline - start;
QString keyName = objName.mid(start, keyLength);
if (keyName == BTN_RETURN) {
Q_EMIT specialBtnClicked(PAGE_CHAR);
} else if (charId != QChar::Null) {
Q_EMIT normalBtnClicked(charId);
} else {
Q_EMIT specialBtnClicked(keyName);
}
}
void CharsMoreWidget::initUI()
{
// all chars
m_vlayoutBtnList = new QVBoxLayout();
m_vlayoutBtnList->setContentsMargins(8,0,0,0);
m_vlayoutBtnList->setSpacing(1);
listFrame = new QFrame();
listFrame->setLayout(m_vlayoutBtnList);
listFrame->setStyleSheet("QFrame{border-radius: 8px}");
m_scrollFrame = new QScrollArea(this);
m_scrollFrame->setContentsMargins(0, 0, 0, 0);
m_scrollFrame->setFocusPolicy(Qt::NoFocus);
m_scrollFrame->setStyleSheet("QScrollArea {background-color: #C0FFFFFF; border-radius:8px;}");
m_scrollFrame->viewport()->setStyleSheet("background-color:transparent;");
m_scrollFrame->verticalScrollBar()->setProperty("drawScrollBarGroove", false);
m_scrollFrame->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_scrollFrame->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu);
m_scrollFrame->setWidgetResizable(true);
m_scrollFrame->setWidget(listFrame);
m_scrollFrame->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1, 0,
KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH, KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_HEIGHT);
listFrame->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1, 0,
KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH, KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_HEIGHT);
m_mapBtnGeometrys[m_scrollFrame] = m_scrollFrame->geometry();
m_mapBtnGeometrys[listFrame] = listFrame->geometry();
QChar chChars[] = {',', '.', '?', '!', '\'', ':', '~', '@', ';', '"',
'/', '(', ')', '_', '+', '=', '`', '^', '#', '*',
'%', '&', '\\', '[', ']', '<', '>', '{', '}', '|',
'$', '-', ' ', ' ', ' ', ' '};
QHBoxLayout *lastLayout = nullptr;
for (int n = 0; n < sizeof(chChars)/sizeof(QChar); n++) {
KBButton *charBtn = new KBButton(listFrame);
charBtn->setCharId(chChars[n]);
charBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_NORMAL,
KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_FONT_COLOR_PRESS,
KBButton::BORDER_RADIUS_NONE);
if ((n%KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_COLS) == 0) {
lastLayout = new QHBoxLayout();
lastLayout->setContentsMargins(0,0,0,0);
lastLayout->setSpacing(1);
m_vlayoutBtnList->addLayout(lastLayout);
}
if (chChars[n] == ' ') {
charBtn->setDisabled(true);
} else {
charBtn->setObjectName(QString("btn_%1").arg(QString(chChars[n])));
}
charBtn->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NORMAL_CHARSMORE_BTN_HEIGHT);
lastLayout->addWidget(charBtn);
m_mapSubWidgetListRects[charBtn] = charBtn->geometry();
connect(charBtn, &KBButton::clicked, this, &CharsMoreWidget::onBtnClicked);
}
// backspace
KBButton *backspaceBtn = new KBButton(this);
backspaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1+(KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH+KEYBOARD_FIXED_DEFAULT_CHARSMORE_HSPACING),
0,
KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_WIDTH,
KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT);
backspaceBtn->setObjectName("btn_backspace");
backspaceBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
backspaceBtn->setIcon(QIcon(":/images/images/delet.svg"));
m_mapBtnGeometrys[backspaceBtn] = backspaceBtn->geometry();
connect(backspaceBtn, &KBButton::clicked, this, &CharsMoreWidget::onBtnClicked);
// enter
KBButton *enterBtn = new KBButton(this);
enterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1+(KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH+KEYBOARD_FIXED_DEFAULT_CHARSMORE_HSPACING),
(KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT+KEYBOARD_FIXED_DEFAULT_CHARSMORE_VSPACING)*1,
KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_WIDTH,
KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT);
enterBtn->setObjectName("btn_enter");
enterBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
enterBtn->setIcon(QIcon(":/images/images/enter.svg"));
connect(enterBtn, &KBButton::clicked, this, &CharsMoreWidget::onBtnClicked);
m_mapBtnGeometrys[enterBtn] = enterBtn->geometry();
// return
KBButton *returnBtn = new KBButton(this);
returnBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1+(KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH+KEYBOARD_FIXED_DEFAULT_CHARSMORE_HSPACING),
(KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT+KEYBOARD_FIXED_DEFAULT_CHARSMORE_VSPACING)*2,
KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_WIDTH,
KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT);
returnBtn->setObjectName("btn_return");
returnBtn->setText(tr("&&?!"));
returnBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(returnBtn, &KBButton::clicked, this, &CharsMoreWidget::onBtnClicked);
m_mapBtnGeometrys[returnBtn] = returnBtn->geometry();
}

View File

@ -0,0 +1,39 @@
#ifndef CHARSMOREWIDGETS_H
#define CHARSMOREWIDGETS_H
#include <QWidget>
#include "kbbutton.h"
#include <QMap>
class QVBoxLayout;
class QHBoxLayout;
class QScrollArea;
class QFrame;
class CharsMoreWidget : public QWidget
{
Q_OBJECT
public:
explicit CharsMoreWidget(QWidget *parent = nullptr);
~CharsMoreWidget();
void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
public Q_SLOTS:
void onBtnClicked(QChar charId);
Q_SIGNALS:
void clicked(int nKeyId);
void specialBtnClicked(QString keyName);
void normalBtnClicked(QChar charId);
private:
void initUI();
private:
QMap<QWidget*, QRect> m_mapBtnGeometrys;
QMap<QWidget*, QRect> m_mapSubWidgetListRects;
QVBoxLayout *m_vlayoutBtnList = nullptr;
QScrollArea *m_scrollFrame = nullptr;
QFrame *listFrame = nullptr;
};
#endif // CHARSMOREWIDGETS_H

View File

@ -0,0 +1,238 @@
#include "charswidget.h"
#include "commondef.h"
#include <QDebug>
CharsWidget::CharsWidget(QWidget *parent/* = nullptr*/)
: QWidget(parent)
{
this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
initUI();
}
CharsWidget::~CharsWidget()
{
}
void CharsWidget::initUI()
{
// line 1
QChar chLine1[] = {'1','2','3','4','5','6','7','8','9','0'};
for (int n = 0; n < sizeof(chLine1)/sizeof(QChar); n++) {
KBButton *charBtn = new KBButton(this);
charBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L1+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*n,
KEYBOARD_FIXED_DEFAULT_TMARGIN,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
charBtn->setCharId(chLine1[n]);
charBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(charBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[charBtn] = charBtn->geometry();
}
// backspace
KBButton *backspaceBtn = new KBButton(this);
backspaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L1+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
KEYBOARD_FIXED_DEFAULT_TMARGIN,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
backspaceBtn->setObjectName("btn_backspace");
backspaceBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(backspaceBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
backspaceBtn->setIcon(QIcon(":/images/images/delet.svg"));
m_mapBtnGeometrys[backspaceBtn] = backspaceBtn->geometry();
// line 2
QChar chLine2[] = {'~','/',':',';','(',')','@','"','\''};
for (int n = 0; n < sizeof(chLine2)/sizeof(QChar); n++) {
KBButton *charBtn = new KBButton(this);
charBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L2+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*n,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING),
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
charBtn->setCharId(chLine2[n]);
charBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(charBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[charBtn] = charBtn->geometry();
}
// enter
KBButton *enterBtn = new KBButton(this);
enterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L2+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*9,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING),
KEYBOARD_FIXED_DEFAULT_ENTERBTN_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
enterBtn->setObjectName("btn_enter");
enterBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(enterBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
enterBtn->setIcon(QIcon(":/images/images/enter.svg"));
m_mapBtnGeometrys[enterBtn] = enterBtn->geometry();
// line 3
QChar chLine3[] = {'-','_','#','%','$','+','^',',','.','!'};
for (int n = 0; n < sizeof(chLine3)/sizeof(QChar); n++) {
KBButton *charBtn = new KBButton(this);
charBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
charBtn->setCharId(chLine3[n]);
charBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(charBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[charBtn] = charBtn->geometry();
}
// more
KBButton *moreBtn = new KBButton(this);
moreBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
moreBtn->setObjectName("btn_more");
moreBtn->setText(tr("More"));
moreBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(moreBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[moreBtn] = moreBtn->geometry();
// line 4
KBButton *returnBtn = new KBButton(this);
returnBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
returnBtn->setObjectName("btn_return");
returnBtn->setText(tr("ABC"));
returnBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(returnBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[returnBtn] = returnBtn->geometry();
KBButton *numBtn = new KBButton(this);
numBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING),
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
numBtn->setObjectName("btn_number");
numBtn->setText(tr("123"));
numBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(numBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[numBtn] = numBtn->geometry();
KBButton *threedBtn = new KBButton(this);
threedBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*2,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
threedBtn->setObjectName("btn_threed");
threedBtn->setCharId(('&'));
threedBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(threedBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[threedBtn] = threedBtn->geometry();
KBButton *spaceBtn = new KBButton(this);
spaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*3,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_SPACEBTN_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
spaceBtn->setObjectName("btn_space");
spaceBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
spaceBtn->setIcon(QIcon(":/images/images/space.svg"));
connect(spaceBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[spaceBtn] = spaceBtn->geometry();
KBButton *whBtn = new KBButton(this);
whBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*8,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
whBtn->setCharId('?');
whBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(whBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[whBtn] = whBtn->geometry();
KBButton *leftBtn = new KBButton(this);
leftBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*9,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
leftBtn->setObjectName("btn_left");
leftBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
leftBtn->setIcon(QIcon(":/images/images/left.svg"));
connect(leftBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[leftBtn] = leftBtn->geometry();
KBButton *rightBtn = new KBButton(this);
rightBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
rightBtn->setObjectName("btn_right");
rightBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
rightBtn->setIcon(QIcon(":/images/images/right.svg"));
connect(rightBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
m_mapBtnGeometrys[rightBtn] = rightBtn->geometry();
}
void CharsWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
{
QMap<KBButton*, QRect>::iterator itGeometry = m_mapBtnGeometrys.begin();
for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) {
KBButton *button = itGeometry.key();
if (button) {
QRect oldGeometry = itGeometry.value();
QRect newGeometry = oldGeometry;
if (floatStatus) {
newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
} else {
newGeometry.setX(oldGeometry.x()*lfWidthScale);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
}
button->setGeometry(newGeometry);
}
}
}
void CharsWidget::onBtnClicked(QChar charId)
{
QObject *obj = sender();
KBButton *btn = static_cast<KBButton*>(obj);
QString objName = btn->objectName();
int lastUnderline = objName.lastIndexOf('_');
int start = strlen("btn_");
int keyLength = lastUnderline - start;
QString keyName = objName.mid(start, keyLength);
if (keyName == BTN_RETURN) {
Q_EMIT specialBtnClicked(PAGE_LETTER);
} else if (keyName == "more") {
Q_EMIT specialBtnClicked(PAGE_CHARSMORE);
} else if (keyName == "number") {
Q_EMIT specialBtnClicked(PAGE_NUMBER);
} else if (charId != QChar::Null) {
Q_EMIT normalBtnClicked(charId);
} else {
Q_EMIT specialBtnClicked(keyName);
}
}

View File

@ -0,0 +1,33 @@
#ifndef CHARSWIDGET_H
#define CHARSWIDGET_H
#include <QWidget>
#include "kbbutton.h"
#include <QMap>
class CharsWidget : public QWidget
{
Q_OBJECT
public:
explicit CharsWidget(QWidget *parent = nullptr);
virtual ~CharsWidget();
void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
public Q_SLOTS:
void onBtnClicked(QChar charId);
Q_SIGNALS:
void clicked(int nKeyId);
void specialBtnClicked(QString keyName);
void normalBtnClicked(QChar c);
private:
void initUI();
private:
QMap<KBButton*, QRect> m_mapBtnGeometrys;
};
#endif // CHARSWIDGET_H

View File

@ -0,0 +1,104 @@
#ifndef COMMONDEF_H
#define COMMONDEF_H
#define KEYBOARD_PARENT_DEFAULT_WIDTH 1620
#define KEYBOARD_PARENT_DEFAULT_HEIGHT 1080
#define KEYBOARD_FIXED_DEFAULT_WIDTH 1620
#define KEYBOARD_DRAGSHOW_FIXED_DEFAULT_HEIGHT 428
#define KEYBOARD_DRAGSHOW_FIXED_DEFAULT_WIDTH 1458
#define KEYBOARD_DRAGHIDE_FIXED_DEFAULT_HEIGHT 404
#define KEYBOARD_TITLEBTN_DEFAULT_WIDTH 56
#define KEYBOARD_TITLEBTN_DEFAULT_HEIGHT 56
#define KEYBOARD_TITLE_DEFAULT_HEIGHT 68
#define KEYBOARD_DRAGBTN_DEFAULT_WIDTH 56
#define KEYBOARD_DRAGBTN_DEFAULT_HEIGHT 4
#define KEYBOARD_DRAG_DEFAULT_HEIGHT 26
#define KEYBOARD_FLOAT_PERCENTAGE 0.9
#define KEYBOARD_FIXED_DEFAULT_LMARGIN 22 // 左边距
#define KEYBOARD_FIXED_DEFAULT_RMARGIN 22 // 右边距
#define KEYBOARD_FIXED_DEFAULT_TMARGIN 8 // 上边距
#define KEYBOARD_FIXED_DEFAULT_BMARGIN 16 // 下边距
#define KEYBOAED_FIXED_DEFAULT_VSPACING 8 // 垂直间隔
#define KEYBOAED_FIXED_DEFAULT_HSPACING 8 // 水平间隔
// letters
#define KEYBOARD_FIXED_DEFAULT_LETTER_L1 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0) // 字符页面左起点
#define KEYBOARD_FIXED_DEFAULT_LETTER_L2 (KEYBOARD_FIXED_DEFAULT_LMARGIN+72) // 字符页面左起点
#define KEYBOARD_FIXED_DEFAULT_LETTER_L3 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0) // 字符页面左起点
#define KEYBOARD_FIXED_DEFAULT_LETTER_L4 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0) // 字符页面左起点
#define KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH 136 // 字符按钮宽度
#define KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT 72 // 字符按钮高度
#define KEYBOARD_FIXED_DEFAULT_LETTER_ENTWIDTH 208
#define KEYBOARD_FIXED_DEFAULT_LETTER_SPCWIDTH 712
#define KEYBOARD_FIXED_DEFAULT_TITLEBTN_WIDTH 56
#define KEYBOARD_FIXED_DEFAULT_TITLEBTN_HEIGHT 56
#define KEYBOARD_FIXED_DEFAULT_ENTERBTN_WIDTH 208
#define KEYBOARD_FIXED_DEFAULT_SPACEBTN_WIDTH 712
#define KEYBOARD_LETTER_COLOR_NORMAL "#FFFFFF"
#define KEYBOARD_LETTER_COLOR_PRESSED "#DDE0E4"
#define KEYBOARD_LETTER_COLOR_BORDER_NORMAL "#95A0AD"
#define KEYBOARD_LETTER_COLOR_BORDER_PRESSED "#95A0AD"
#define KEYBOARD_OTHER_COLOR_NORMAL "#CED3D9"
#define KEYBOARD_OTHER_COLOR_PRESSED "#3790FA"
#define KEYBOARD_OTHER_COLOR_BORDER_NORMAL "#95A0AD"
#define KEYBOARD_OTHER_COLOR_BORDER_PRESSED "#1174E5"
#define KEYBOARD_FONT_COLOR_PRESS "#262626"
#define KEYBOARD_OTHER_FONT_COLOR_PRESS "#FFFFFF"
//numbers
#define KEYBOARD_FIXED_DEFAULT_NUMBER_L1 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
#define KEYBOARD_FIXED_DEFAULT_NUMBER_L2 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
#define KEYBOARD_FIXED_DEFAULT_NUMBER_L3 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
#define KEYBOARD_FIXED_DEFAULT_NUMBER_L4 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
#define KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH 306 // 数字按钮宽度
#define KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT 72 // 数字按钮高度
#define KEYBOARD_FIXED_DEFAULT_NUMBER_CHARS_HEIGHT 230 // 数字字符按钮高度
// chars more
#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_HSPACING 16
#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_VSPACING 16
#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_COLS 6
#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH 1350 // 字符列表宽度
#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_HEIGHT 315 // 字符列表高度
#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_WIDTH 214 // 按钮宽度
#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT 94 // 功能按钮高度
#define KEYBOARD_FIXED_DEFAULT_NORMAL_CHARSMORE_BTN_HEIGHT 80 // 符号按钮高度
//iconsize
#define KEYBOARD_FIXED_DEFAULT_ICONSIZE QSize(25, 25)
//keyName
#define PAGE_CHAR "page_char"
#define PAGE_NUMBER "page_number"
#define PAGE_CHARSMORE "page_charmore"
#define PAGE_LETTER "page_letter"
#define BTN_FLOAT "float"
#define BTN_CLOSE "close"
#define BTN_RETURN "return"
#define BTN_BACK "backspace"
#define BTN_ENTER "enter"
#define BTN_SHIFT "shift"
#define BTN_CTRL "ctrl"
#define BTN_ALT "alt"
#define BTN_SPACE "space"
#define BTN_RIGHT "right"
#define BTN_LEFT "left"
#define BTN_CAPSLOCK "capslock"
#endif // COMMONDEF_H

View File

@ -0,0 +1,54 @@
#include "dragwidget.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QDebug>
#include "commondef.h"
DragWidget::DragWidget(QWidget *parent/* = nullptr*/)
: QWidget(parent)
{
setAttribute(Qt::WA_TranslucentBackground);//背景透明
initUI();
}
DragWidget::~DragWidget()
{
}
void DragWidget::initUI()
{
setFixedHeight(KEYBOARD_DRAG_DEFAULT_HEIGHT);
m_labelDrag = new QLabel(this);
m_labelDrag->setPixmap(QPixmap(":/images/images/drag.svg"));
m_labelDrag->setGeometry((KEYBOARD_PARENT_DEFAULT_WIDTH - KEYBOARD_TITLEBTN_DEFAULT_WIDTH)/2,
(this->height() - KEYBOARD_TITLEBTN_DEFAULT_HEIGHT)/2,
KEYBOARD_TITLEBTN_DEFAULT_WIDTH, KEYBOARD_TITLEBTN_DEFAULT_HEIGHT);
m_mapSubGeometrys[m_labelDrag] = m_labelDrag->geometry();
}
void DragWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
{
setFixedHeight(KEYBOARD_DRAG_DEFAULT_HEIGHT*lfHeightScale);
QMap<QLabel*, QRect>::iterator itGeometry = m_mapSubGeometrys.begin();
for (; itGeometry != m_mapSubGeometrys.end(); itGeometry ++) {
QLabel *label = itGeometry.key();
if (label) {
QRect oldGeometry = itGeometry.value();
QRect newGeometry = oldGeometry;
if (floatStatus) {
newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
} else {
newGeometry.setX(oldGeometry.x()*lfWidthScale);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
}
label->setGeometry(newGeometry);
}
}
}

View File

@ -0,0 +1,26 @@
#ifndef DRAGWIDGET_H
#define DRAGWIDGET_H
#include <QWidget>
#include <QLabel>
#include <QMap>
class DragWidget : public QWidget
{
Q_OBJECT
public:
DragWidget(QWidget *parent = nullptr);
virtual ~DragWidget();
public:
void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
private:
void initUI();
private:
QLabel *m_labelDrag = nullptr;
QMap<QLabel*, QRect> m_mapSubGeometrys;
};
#endif // DRAGWIDGET_H

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<g id="默认">
<path fill="#FFFFFF" d="M41.1,9c3.2,0,5.9,2.6,5.9,5.9v20.2c0,3.2-2.6,5.9-5.9,5.9H18.3L4,25L18.3,9H41.1 M41.1,6H16.9L0,25
l16.9,19h24.2c4.9,0,8.9-4,8.9-8.9V14.9C50,10,46,6,41.1,6z"/>
<line fill="none" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round" stroke-miterlimit="10" x1="40" y1="15" x2="20" y2="35"/>
<line fill="none" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round" stroke-miterlimit="10" x1="20" y1="15" x2="40" y2="35"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 837 B

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<g id="点击" opacity="0.6">
<path fill="#FFFFFF" d="M41.1,9c3.2,0,5.9,2.6,5.9,5.9v20.2c0,3.2-2.6,5.9-5.9,5.9H18.3L4,25L18.3,9H41.1 M41.1,6H16.9L0,25
l16.9,19h24.2c4.9,0,8.9-4,8.9-8.9V14.9C50,10,46,6,41.1,6z"/>
<line fill="none" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round" stroke-miterlimit="10" x1="40" y1="15" x2="20" y2="35"/>
<line fill="none" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round" stroke-miterlimit="10" x1="20" y1="15" x2="40" y2="35"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 851 B

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<path class="st0" d="M25,6.5L43.3,27H35v17H15V27H6.7L25,6.5 M22.8,4.5L3,26.7C1.8,28,2.7,30,4.5,30H12v15c0,1.1,0.9,2,2,2h22
c1.1,0,2-0.9,2-2V30h7.5c1.7,0,2.6-2,1.5-3.3L27.2,4.5C26,3.2,24,3.2,22.8,4.5z"/>
</svg>

Before

Width:  |  Height:  |  Size: 621 B

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<g id="点击" opacity="0.6">
<path fill="#FFFFFF" d="M25,6.5L43.3,27H35v17H15V27H6.7L25,6.5 M22.8,4.5L3,26.7C1.8,28,2.7,30,4.5,30H12v15c0,1.1,0.9,2,2,2h22
c1.1,0,2-0.9,2-2V30h7.5c1.7,0,2.6-2,1.5-3.3L27.2,4.5C26,3.2,24,3.2,22.8,4.5z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 599 B

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<path fill="#67B204" d="M25,6.5L43.3,27H35v17H15V27H6.7L25,6.5 M22.8,4.5L3,26.7C1.8,28,2.7,30,4.5,30H12v15c0,1.1,0.9,2,2,2h22
c1.1,0,2-0.9,2-2V30h7.5c1.7,0,2.6-2,1.5-3.3L27.2,4.5C26,3.2,24,3.2,22.8,4.5z"/>
</svg>

Before

Width:  |  Height:  |  Size: 560 B

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<path fill="#4A692A" d="M25,6.5L43.3,27H35v17H15V27H6.7L25,6.5 M22.8,4.5L3,26.7C1.8,28,2.7,30,4.5,30H12v15c0,1.1,0.9,2,2,2h22
c1.1,0,2-0.9,2-2V30h7.5c1.7,0,2.6-2,1.5-3.3L27.2,4.5C26,3.2,24,3.2,22.8,4.5z"/>
</svg>

Before

Width:  |  Height:  |  Size: 560 B

View File

@ -1,22 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<g id="键盘">
<g id="默认">
<path fill="#FFFFFF" d="M47,5v29H3V5H47 M50,2H0v35h50V2z"/>
<rect x="8" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="15" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="23" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="31" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="39" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="8" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="15" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="23" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="31" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="39" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="13" y="26" fill="#FFFFFF" width="24" height="3"/>
</g>
</g>
<polygon fill="#FFFFFF" points="29,41 25,45 21,41 18,41 25,48 32,41 "/>
</svg>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.6566 19.0719C18.0471 19.4624 18.6802 19.4624 19.0708 19.0719C19.4613 18.6814 19.4613 18.0482 19.0708 17.6577L6.34285 4.92976C5.95232 4.53923 5.31916 4.53923 4.92864 4.92976C4.53811 5.32028 4.53811 5.95345 4.92864 6.34397L17.6566 19.0719Z" fill="#262626"/>
<path d="M17.6566 4.92961C18.0471 4.53909 18.6803 4.53909 19.0708 4.92961C19.4613 5.32014 19.4613 5.9533 19.0708 6.34383L6.3429 19.0717C5.95238 19.4623 5.31921 19.4623 4.92869 19.0717C4.53816 18.6812 4.53816 18.0481 4.92869 17.6575L17.6566 4.92961Z" fill="#262626"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 639 B

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<g id="键盘" opacity="0.6">
<g id="默认">
<path fill="#FFFFFF" d="M47,5v29H3V5H47 M50,2H0v35h50V2z"/>
<rect x="8" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="15" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="23" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="31" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="39" y="10" fill="#FFFFFF" width="3" height="3"/>
<rect x="8" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="15" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="23" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="31" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="39" y="18" fill="#FFFFFF" width="3" height="3"/>
<rect x="13" y="26" fill="#FFFFFF" width="24" height="3"/>
</g>
</g>
<polygon opacity="0.6" fill="#FFFFFF" enable-background="new " points="29,41 25,45 21,41 18,41 25,48 32,41 "/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.5 7.12778V16.8722H23.5V7.12778H21.5ZM5.6834 18.1172L2.14546 12.3607L0.44154 13.4079L3.97948 19.1645L5.6834 18.1172ZM2.14546 11.6393L5.6834 5.88275L3.97948 4.83553L0.44154 10.5921L2.14546 11.6393ZM19.1222 19.25H7.70917V21.25H19.1222V19.25ZM7.70917 4.75L19.1222 4.75V2.75H7.70917V4.75ZM2.14546 12.3607C2.00948 12.1395 2.00948 11.8605 2.14546 11.6393L0.44154 10.5921C-0.0892174 11.4557 -0.0892166 12.5443 0.44154 13.4079L2.14546 12.3607ZM21.5 16.8722C21.5 18.1854 20.4354 19.25 19.1222 19.25V21.25C21.54 21.25 23.5 19.29 23.5 16.8722H21.5ZM23.5 7.12778C23.5 4.71 21.54 2.75 19.1222 2.75V4.75C20.4354 4.75 21.5 5.81457 21.5 7.12778H23.5ZM5.6834 5.88275C6.116 5.17887 6.88297 4.75 7.70917 4.75V2.75C6.18804 2.75 4.77596 3.5396 3.97948 4.83553L5.6834 5.88275ZM3.97948 19.1645C4.77596 20.4604 6.18805 21.25 7.70917 21.25V19.25C6.88297 19.25 6.116 18.8211 5.6834 18.1172L3.97948 19.1645Z" fill="#262626"/>
<rect x="8.0498" y="8.46484" width="2" height="12" rx="1" transform="rotate(-45 8.0498 8.46484)" fill="#262626"/>
<rect width="2" height="12" rx="1" transform="matrix(0.707107 0.707107 0.707107 -0.707107 8.05078 15.5352)" fill="#363940"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<title>画板 15</title>
<g id="下">
<polygon id="默认" fill="#FFFFFF" points="25,32 38,17 12,17 "/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 466 B

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<polygon id="点击" opacity="0.6" fill="#FFFFFF" enable-background="new " points="25,32 38,17 12,17 "/>
</svg>

Before

Width:  |  Height:  |  Size: 460 B

View File

@ -0,0 +1,3 @@
<svg width="56" height="4" viewBox="0 0 56 4" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="56" height="4" rx="2" fill="#1D1D1D"/>
</svg>

After

Width:  |  Height:  |  Size: 153 B

View File

@ -1,11 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 70 50" enable-background="new 0 0 70 50" xml:space="preserve">
<path display="none" fill="none" stroke="#FFFFFF" stroke-width="3" stroke-miterlimit="10" d="M36.5,9.5h2c5.5,0,10,4.5,10,10l0,0
c0,5.5-4.5,10-10,10H5"/>
<polyline fill="none" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
21,16 3,29.5 21,43 "/>
<path fill="none" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round" stroke-miterlimit="10" d="M50,12.5h12.7
c3.3,0,6,2.7,6,6v4.8c0,3.3-2.7,6-6,6H5"/>
</svg>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 17H18C20.2091 17 22 15.2091 22 13V3" stroke="#363940" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M7 12L2 17L7 22" stroke="#363940" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 828 B

After

Width:  |  Height:  |  Size: 344 B

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" opacity="0.6" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" viewBox="0 0 70 50" enable-background="new 0 0 70 50" xml:space="preserve">
<polyline opacity="0.6" fill="none" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" enable-background="new " points="
21,16 3,29.5 21,43 "/>
<path opacity="0.6" fill="none" stroke="#FFFFFF" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" enable-background="new " d="
M50,12.5h12.7c3.3,0,6,2.7,6,6v4.8c0,3.3-2.7,6-6,6H5"/>
</svg>

Before

Width:  |  Height:  |  Size: 794 B

View File

@ -0,0 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 8V15.6C2 17.8402 2 18.9603 2.43597 19.816C2.81947 20.5686 3.43139 21.1805 4.18404 21.564C5.03968 22 6.15979 22 8.4 22H15.6C17.8402 22 18.9603 22 19.816 21.564C20.5686 21.1805 21.1805 20.5686 21.564 19.816C22 18.9603 22 17.8402 22 15.6V8" stroke="#262626" stroke-width="2" stroke-linecap="round"/>
<path d="M8.29289 15.7071C7.90237 15.3166 7.90237 14.6834 8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929L8.29289 15.7071ZM12 18L12.7071 18.7071C12.3166 19.0976 11.6834 19.0976 11.2929 18.7071L12 18ZM14.2929 14.2929C14.6834 13.9024 15.3166 13.9024 15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071L14.2929 14.2929ZM9.70711 14.2929L12.7071 17.2929L11.2929 18.7071L8.29289 15.7071L9.70711 14.2929ZM11.2929 17.2929L14.2929 14.2929L15.7071 15.7071L12.7071 18.7071L11.2929 17.2929Z" fill="#262626"/>
<path d="M11 16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16L11 16ZM13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8L13 8ZM13 16L13 8L11 8L11 16L13 16Z" fill="#262626"/>
<path d="M2 8H22V8C22 6.13623 22 5.20435 21.6955 4.46927C21.2895 3.48915 20.5108 2.71046 19.5307 2.30448C18.7956 2 17.8638 2 16 2H8C6.13623 2 5.20435 2 4.46927 2.30448C3.48915 2.71046 2.71046 3.48915 2.30448 4.46927C2 5.20435 2 6.13623 2 8V8Z" stroke="#262626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 16V8.4C2 6.15979 2 5.03969 2.43597 4.18404C2.81947 3.43139 3.43139 2.81947 4.18404 2.43597C5.03968 2 6.15979 2 8.4 2H15.6C17.8402 2 18.9603 2 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C22 5.03969 22 6.15979 22 8.4V16" stroke="#262626" stroke-width="2" stroke-linecap="round"/>
<path d="M8.29289 8.29289C7.90237 8.68342 7.90237 9.31658 8.29289 9.70711C8.68342 10.0976 9.31658 10.0976 9.70711 9.70711L8.29289 8.29289ZM12 6L12.7071 5.29289C12.3166 4.90237 11.6834 4.90237 11.2929 5.29289L12 6ZM14.2929 9.70711C14.6834 10.0976 15.3166 10.0976 15.7071 9.70711C16.0976 9.31658 16.0976 8.68342 15.7071 8.29289L14.2929 9.70711ZM9.70711 9.70711L12.7071 6.70711L11.2929 5.29289L8.29289 8.29289L9.70711 9.70711ZM11.2929 6.70711L14.2929 9.70711L15.7071 8.29289L12.7071 5.29289L11.2929 6.70711Z" fill="#262626"/>
<path d="M11 16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16L11 16ZM13 6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6L13 6ZM13 16L13 6L11 6L11 16L13 16Z" fill="#262626"/>
<path d="M2 16H22V16C22 17.8638 22 18.7956 21.6955 19.5307C21.2895 20.5108 20.5108 21.2895 19.5307 21.6955C18.7956 22 17.8638 22 16 22H8C6.13623 22 5.20435 22 4.46927 21.6955C3.48915 21.2895 2.71046 20.5108 2.30448 19.5307C2 18.7956 2 17.8638 2 16V16Z" stroke="#262626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,7 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="左" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<title>画板 19</title>
<polygon id="默认" fill="#FFFFFF" points="18,25 33,12 33,38 "/>
</svg>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 2L7 12L17 22" stroke="#262626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 439 B

After

Width:  |  Height:  |  Size: 213 B

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="左" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<title>画板 20</title>
<polygon id="点击" opacity="0.6" fill="#FFFFFF" enable-background="new " points="18,25 33,12 33,38 "/>
</svg>

Before

Width:  |  Height:  |  Size: 481 B

View File

@ -0,0 +1,3 @@
<svg width="20" height="22" viewBox="0 0 20 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.34569 0.738189C9.22632 -0.246061 10.7737 -0.246064 11.6543 0.738188L19.4361 9.43558C20.7058 10.8547 19.6923 13.0988 17.7817 13.0988H15.1658V19.7993C15.1658 21.0147 14.1746 22 12.9519 22H7.04809C5.82538 22 4.83417 21.0147 4.83417 19.7993V13.0988H2.21826C0.30769 13.0988 -0.705754 10.8547 0.563946 9.43558L8.34569 0.738189Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 493 B

View File

@ -1,6 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<polygon id="默认" fill="#FFFFFF" points="33,25 18,12 18,38 "/>
</svg>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 2L17 12L7 22" stroke="#262626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 212 B

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<polygon id="点击" opacity="0.6" fill="#FFFFFF" enable-background="new " points="33,25 18,12 18,38 "/>
</svg>

Before

Width:  |  Height:  |  Size: 460 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.1658 13.0988H16.1658V14.0988V20.7993C16.1658 21.4568 15.628 22 14.9519 22H9.04809C8.372 22 7.83417 21.4568 7.83417 20.7993V14.0988V13.0988H6.83417H4.21826C3.15987 13.0988 2.62398 11.8682 3.30919 11.1024L11.0909 2.40498C11.5741 1.86501 12.4259 1.86501 12.9091 2.40498L20.6908 11.1024C21.376 11.8682 20.8401 13.0988 19.7817 13.0988H17.1658Z" stroke="#262626" stroke-width="2"/>
</svg>

After

Width:  |  Height:  |  Size: 492 B

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0341 1.74795C13.1587 0.763701 11.6206 0.763704 10.7453 1.74795L3.01004 10.4453C1.74793 11.8644 2.75531 14.1085 4.65446 14.1085H7.25473V20.8091C7.25473 22.0245 8.24002 23.0098 9.45543 23.0098H11.5414C11.5046 22.9464 11.4694 22.8818 11.436 22.8162C11.1594 22.2734 11.0713 21.7339 11.0339 21.2767C10.9999 20.8604 10.9999 20.3689 11 19.8641V19.8641L11 19.8003V19.2003L11 19.1365V19.1364C10.9999 18.6317 10.9999 18.1401 11.0339 17.7238C11.0713 17.2666 11.1594 16.7272 11.436 16.1843C11.7917 15.4863 12.3438 14.9093 13.0225 14.5233C13.2626 11.9856 15.3995 10.0003 18 10.0003C19.8088 10.0003 21.3933 10.9608 22.2712 12.3995C22.4233 11.7508 22.2879 11.0284 21.7693 10.4453L14.0341 1.74795Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 16.0192C14.6078 16.0431 14.3295 16.097 14.092 16.218C13.7157 16.4097 13.4097 16.7157 13.218 17.092C13 17.5198 13 18.0799 13 19.2V19.8C13 20.9201 13 21.4802 13.218 21.908C13.4097 22.2843 13.7157 22.5903 14.092 22.782C14.5198 23 15.0799 23 16.2 23H19.8C20.9201 23 21.4802 23 21.908 22.782C22.2843 22.5903 22.5903 22.2843 22.782 21.908C23 21.4802 23 20.9201 23 19.8V19.2C23 18.0799 23 17.5198 22.782 17.092C22.5903 16.7157 22.2843 16.4097 21.908 16.218C21.6705 16.097 21.3922 16.0431 21 16.0192V15C21 13.3431 19.6569 12 18 12C16.3431 12 15 13.3431 15 15V16.0192ZM17 16H19V15C19 14.4477 18.5523 14 18 14C17.4477 14 17 14.4477 17 15V16Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,10 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_3756_117108)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M20 10V13H4V10C4 9.45 3.55 9 3 9C2.45 9 2 9.45 2 10V14C2 14.55 2.45 15 3 15H21C21.55 15 22 14.55 22 14V10C22 9.45 21.55 9 21 9C20.45 9 20 9.45 20 10Z" fill="#1D1D1D"/>
</g>
<defs>
<clipPath id="clip0_3756_117108">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 470 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><defs><style>.cls-1{fill:#fff;}</style></defs><title>画板 11</title><g id="优麒麟"><path id="默认" class="cls-1" d="M25,6A19,19,0,1,0,44,25,19,19,0,0,0,25,6Zm7,4.48a2.75,2.75,0,1,1-2.75,2.76A2.75,2.75,0,0,1,32,10.48ZM25.11,13a12.12,12.12,0,0,1,3.26.45,3.66,3.66,0,0,0,5.29,3.08A12.08,12.08,0,0,1,37.2,24.2l-4.27.06a7.86,7.86,0,0,0-11-6.33l-2.19-3.68A12.07,12.07,0,0,1,25.11,13Zm3.26,13.91.6,1.21L27.8,29.2l.08.91H26.24l1.27-1.81-.44-.54-1.23,1v.64l-1.59,0,1-.95,1-1.19-.84-.58-.86.44-1.17.46-1-.18-.63,1-.2,1.39H20l1.12-1.31-.33-.78-.25-1.54-.81-2,1.46-2.7,1.35-.83L24,19.11l-.4,1,.22,0,1.53-1.54-.65,1.9L25,21.91l-1,1.35,1.49,1.09,2.08.83,1.48-.78.87-1.27,1.42-.44-.26,1.85-.91.32-.67-.13-1.21.69Zm-17.08.88A2.75,2.75,0,1,1,14,25a2.75,2.75,0,0,1-2.75,2.75h0Zm2.06.28a3.67,3.67,0,0,0,0-6,12.14,12.14,0,0,1,5-7l2.18,3.67a7.86,7.86,0,0,0-.11,12.72l-2.09,3.74A12.14,12.14,0,0,1,13.36,28.07ZM32.08,39.54a2.75,2.75,0,1,1,2.75-2.75,2.75,2.75,0,0,1-2.75,2.75Zm1.73-6a3.67,3.67,0,0,0-5.4,3.22,12.11,12.11,0,0,1-8.7-.81l2.08-3.73a7.86,7.86,0,0,0,11.15-6.4l4.27-.06a12.08,12.08,0,0,1-3.4,7.77Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><defs><style>.cls-1{fill:#fff;opacity:0.4;}</style></defs><title>画板 12</title><g id="优麒麟"><path id="点击" class="cls-1" d="M25,6A19,19,0,1,0,44,25,19,19,0,0,0,25,6Zm7,4.48a2.75,2.75,0,1,1-2.75,2.76A2.75,2.75,0,0,1,32,10.48ZM25.11,13a12.12,12.12,0,0,1,3.26.45,3.66,3.66,0,0,0,5.29,3.08A12.08,12.08,0,0,1,37.2,24.2l-4.27.06a7.86,7.86,0,0,0-11-6.33l-2.19-3.68A12.07,12.07,0,0,1,25.11,13Zm3.26,13.91.6,1.21L27.8,29.2l.08.91H26.24l1.27-1.81-.44-.54-1.23,1v.64l-1.59,0,1-.95,1-1.19-.84-.58-.86.44-1.17.46-1-.18-.63,1-.2,1.39H20l1.12-1.31-.33-.78-.25-1.54-.81-2,1.46-2.7,1.35-.83L24,19.11l-.4,1,.22,0,1.53-1.54-.65,1.9L25,21.91l-1,1.35,1.49,1.09,2.08.83,1.48-.78.87-1.27,1.42-.44-.26,1.85-.91.32-.67-.13-1.21.69Zm-17.08.88A2.75,2.75,0,1,1,14,25a2.75,2.75,0,0,1-2.75,2.75h0Zm2.06.28a3.67,3.67,0,0,0,0-6,12.14,12.14,0,0,1,5-7l2.18,3.67a7.86,7.86,0,0,0-.11,12.72l-2.09,3.74A12.14,12.14,0,0,1,13.36,28.07ZM32.08,39.54a2.75,2.75,0,1,1,2.75-2.75,2.75,2.75,0,0,1-2.75,2.75Zm1.73-6a3.67,3.67,0,0,0-5.4,3.22,12.11,12.11,0,0,1-8.7-.81l2.08-3.73a7.86,7.86,0,0,0,11.15-6.4l4.27-.06a12.08,12.08,0,0,1-3.4,7.77Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3" y="10.5" width="18" height="12" rx="3" stroke="#262626" stroke-width="2" stroke-linejoin="round"/>
<path d="M17.25 6.75V6.75C17.25 3.85051 14.8995 1.5 12 1.5V1.5C9.10051 1.5 6.75 3.85051 6.75 6.75V10.5" stroke="#262626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<rect x="11.25" y="14.25" width="1.5" height="4.5" rx="0.75" fill="#262626"/>
</svg>

After

Width:  |  Height:  |  Size: 479 B

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<title>画板 13</title>
<g id="上">
<polygon id="默认" fill="#FFFFFF" points="25,17 12,32 38,32 "/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 466 B

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
<polygon id="默认" opacity="0.6" fill="#FFFFFF" enable-background="new " points="25,17 12,32 38,32 "/>
</svg>

Before

Width:  |  Height:  |  Size: 460 B

View File

@ -0,0 +1,165 @@
#include "kbbutton.h"
#include "commondef.h"
#include <QDebug>
#include <QEvent>
KBButton::KBButton(QWidget *parent/* = nullptr*/)
: QPushButton(parent)
{
this->installEventFilter(this);
this->setIconSize(KEYBOARD_FIXED_DEFAULT_ICONSIZE);
this->setFocusPolicy(Qt::NoFocus);
connect(this, &QPushButton::clicked, this, [&,this]() {
if (m_charId.isLetter()) {
if (m_isShift) {
if (m_isCaps) {
m_charId = m_charId.toLower();
} else {
m_charId = m_charId.toUpper();
}
} else {
if (m_isCaps) {
m_charId = m_charId.toUpper();
} else {
m_charId = m_charId.toLower();
}
}
}
Q_EMIT clicked(m_charId);
});
}
KBButton::~KBButton()
{
}
bool KBButton::eventFilter(QObject *watched, QEvent *event)
{
if (m_clrNormal == KEYBOARD_LETTER_COLOR_NORMAL)
return QPushButton::eventFilter(watched, event);
if (event->type() == QEvent::MouseButtonPress) {
QPixmap pressIcon = this->icon().pixmap(QSize(24, 24));
pressIcon = drawSymbolicColoredPixmap(pressIcon, "white");
this->setIcon(pressIcon);
} else if (event->type() == QEvent::MouseButtonRelease) {
QPixmap releaseIcon = this->icon().pixmap(QSize(24, 24));
releaseIcon = drawSymbolicColoredPixmap(releaseIcon, "black");
this->setIcon(releaseIcon);
}
return QPushButton::eventFilter(watched, event);
}
void KBButton::setCharId(QChar charId)
{
m_charId = charId;
if (charId == '&') {
setText("&&");
} else {
setText(m_charId);
}
}
void KBButton::updateStyleSheet(QString clrNormal, QString clrHover, QString clrChecked, QString clrBoard, QString clrBoardPress, QString clrFontPress, int radius, bool is_lock)
{
QString strBorderRadius = QString("border-top-left-radius: %1px; border-top-right-radius: %2px; border-bottom-right-radius: %3px;border-bottom-left-radius: %4px;")
.arg((radius&BORDER_RADIUS_LT)?8:0)
.arg((radius&BORDER_RADIUS_TR)?8:0)
.arg((radius&BORDER_RADIUS_RB)?8:0)
.arg((radius&BORDER_RADIUS_LB)?8:0);
if (!is_lock) {
setStyleSheet(QString("QPushButton{%1 border: 2px solid %2; border-width: 0px 0px 2px 0px; background: %3; color: #262626}"
// "QPushButton:hover{border: 2px solid %4; border-width: 2px 0px 0px 0px; background: %5;}"
"QPushButton:pressed{border: 2px solid %4; border-width: 2px 0px 0px 0px; background: %5; color: %6}"
"QPushButton:checked{border: 2px solid %7; border-width: 2px 0px 0px 0px; background: %8; color: %9}")
.arg(strBorderRadius).arg(clrBoard).arg(clrNormal).arg(clrBoardPress).arg(clrHover).arg(clrFontPress).arg(clrBoardPress).arg(clrChecked).arg(clrFontPress)
);
} else {
setStyleSheet(QString("QPushButton{%1 border: 2px solid %2; border-width: 0px 0px 2px 0px; background: %3; color: #FFFFFF}"
// "QPushButton:hover{border: 2px solid %4; border-width: 2px 0px 0px 0px; background: %5;}"
"QPushButton:pressed{border: 2px solid %4; border-width: 2px 0px 0px 0px; background: %5; color: %6}"
"QPushButton:checked{border: 2px solid %7; border-width: 2px 0px 0px 0px; background: %8; color: %9}")
.arg(strBorderRadius).arg(clrBoard).arg(clrNormal).arg(clrBoardPress).arg(clrHover).arg(clrFontPress).arg(clrBoardPress).arg(clrChecked).arg(clrFontPress)
);
}
m_clrBoard = clrBoard;
m_clrNormal = clrNormal;
m_clrBoardPress = clrBoardPress;
m_clrHover = clrHover;
m_clrChecked = clrChecked;
if (m_clrNormal == KEYBOARD_LETTER_COLOR_NORMAL) {
sysFont.setPixelSize(32);
this->setFont(sysFont);
this->setIconSize(QSize(32, 32));
} else {
sysFont.setPixelSize(24);
this->setFont(sysFont);
this->setIconSize(QSize(24, 24));
}
}
QPixmap KBButton::drawSymbolicColoredPixmap(const QPixmap &source, QString cgColor)
{
QImage img = source.toImage();
for (int x = 0; x < img.width(); x++) {
for (int y = 0; y < img.height(); y++) {
auto color = img.pixelColor(x, y);
if (color.alpha() > 0) {
if ( "white" == cgColor) {
color.setRed(255);
color.setGreen(255);
color.setBlue(255);
img.setPixelColor(x, y, color);
} else if( "black" == cgColor) {
color.setRed(0);
color.setGreen(0);
color.setBlue(0);
img.setPixelColor(x, y, color);
} else if ("gray"== cgColor) {
color.setRed(152);
color.setGreen(163);
color.setBlue(164);
img.setPixelColor(x, y, color);
} else if ("blue" == cgColor){
color.setRed(61);
color.setGreen(107);
color.setBlue(229);
img.setPixelColor(x, y, color);
} else {
return source;
}
}
}
}
return QPixmap::fromImage(img);
}
void KBButton::setShiftState(bool isShift)
{
if (m_isShift != isShift) {
if (m_charId.isLetter()) {
if (isShift) {
setText(m_charId.toUpper());
} else {
setText(m_charId.toLower());
}
}
m_isShift = isShift;
}
}
void KBButton::setCapsStatus(bool isCaps)
{
m_isCaps = isCaps;
setShiftState(m_isCaps);
}
void KBButton::setCtrlState(bool isCtrl)
{
}
void KBButton::setAltState(bool isAlt)
{
}

View File

@ -0,0 +1,52 @@
#ifndef KBBUTTON_H
#define KBBUTTON_H
#include <QPushButton>
class KBButton : public QPushButton
{
Q_OBJECT
public:
enum BORDER_RADIUS{
BORDER_RADIUS_NONE,
BORDER_RADIUS_LT = 1,
BORDER_RADIUS_TR = 2,
BORDER_RADIUS_RB = 4,
BORDER_RADIUS_LB = 8,
BORDER_RADIUS_ALL = 0xF,
};
KBButton(QWidget *parent = nullptr);
virtual ~KBButton();
void setCharId(QChar charId);
void updateStyleSheet(QString clrNormal, QString clrHover, QString clrChecked, QString clrBoard, QString clrBoardPress, QString clrFontPress, int radius = BORDER_RADIUS_ALL, bool is_lock = false);
void setShiftState(bool isShift);
void setCapsStatus(bool isCaps);
void setCtrlState(bool isCtrl);
void setAltState(bool isAlt);
protected:
bool eventFilter(QObject *watched, QEvent *event);
Q_SIGNALS:
void clicked(QChar charId);
private:
QPixmap drawSymbolicColoredPixmap(const QPixmap &source, QString cgColor);
private:
int m_nKeyId = -1;
bool m_isShift = false;
bool m_isCtrl = false;
bool m_isAlt = false;
bool m_isCaps = false;
QChar m_charId = QChar::Null;
QString m_clrBoard;
QString m_clrNormal;
QString m_clrBoardPress;
QString m_clrHover;
QString m_clrChecked;
QFont sysFont;
};
#endif // KBBUTTON_H

View File

@ -0,0 +1,97 @@
#include "kbtitle.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include "commondef.h"
#include <QDebug>
KBTitle::KBTitle(QWidget *parent/* = nullptr*/)
: QWidget(parent)
{
setAttribute(Qt::WA_TranslucentBackground);//背景透明
initUI();
initConnections();
}
KBTitle::~KBTitle()
{
}
void KBTitle::initUI()
{
setFixedHeight(KEYBOARD_TITLE_DEFAULT_HEIGHT);
QString strBtnStyle = "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%); }"
"QPushButton::pressed { background-color: rgba(255,255,255,40%); }"
"QPushButton::checked { background-color: rgba(255,255,255,40%); }";
m_btnFloat = new QPushButton(this);
m_btnFloat->setFlat(true);
m_btnFloat->setIcon(QIcon(":/images/images/float.svg"));
m_btnFloat->setObjectName("btn_float");
m_btnFloat->setIconSize(KEYBOARD_FIXED_DEFAULT_ICONSIZE);
m_btnFloat->setGeometry(1484, 8, KEYBOARD_TITLEBTN_DEFAULT_WIDTH, KEYBOARD_TITLEBTN_DEFAULT_HEIGHT);
m_btnFloat->setStyleSheet(strBtnStyle);
m_mapSubGeometrys[m_btnFloat] = m_btnFloat->geometry();
m_btnClose = new QPushButton(this);
m_btnClose->setFlat(true);
m_btnClose->setIcon(QIcon(":/images/images/close.svg"));
m_btnClose->setIconSize(KEYBOARD_FIXED_DEFAULT_ICONSIZE);
m_btnClose->setObjectName("btn_close");
m_btnClose->setGeometry(1548, 8, KEYBOARD_TITLEBTN_DEFAULT_WIDTH, KEYBOARD_TITLEBTN_DEFAULT_HEIGHT);
m_btnClose->setStyleSheet(strBtnStyle);
m_mapSubGeometrys[m_btnClose] = m_btnClose->geometry();
}
void KBTitle::initConnections()
{
connect(m_btnFloat, &QPushButton::clicked, this, &KBTitle::onBtnClicked);
connect(m_btnClose, &QPushButton::clicked, this, &KBTitle::onBtnClicked);
}
void KBTitle::onBtnClicked()
{
QObject *obj = sender();
QPushButton *btn = static_cast<QPushButton*>(obj);
QString objName = btn->objectName();
int lastUnderline = objName.lastIndexOf('_');
int start = strlen("btn_");
int keyLength = lastUnderline - start;
QString keyName = objName.mid(start, keyLength);
if (keyName == BTN_FLOAT) {
if (floatStatus) {
btn->setIcon(QIcon(":/images/images/float.svg"));
} else {
btn->setIcon(QIcon(":/images/images/float-restore.svg"));
}
floatStatus = !floatStatus;
}
Q_EMIT btnClicked(keyName);
}
void KBTitle::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
{
setFixedHeight(KEYBOARD_TITLE_DEFAULT_HEIGHT*lfHeightScale);
QMap<QPushButton*, QRect>::iterator itGeometry = m_mapSubGeometrys.begin();
for (; itGeometry != m_mapSubGeometrys.end(); itGeometry ++) {
QPushButton *button = itGeometry.key();
if (button) {
QRect oldGeometry = itGeometry.value();
QRect newGeometry = oldGeometry;
if (floatStatus) {
newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
} else {
newGeometry.setX(oldGeometry.x()*lfWidthScale);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
}
button->setGeometry(newGeometry);
}
}
}

View File

@ -0,0 +1,35 @@
#ifndef KBTITLE_H
#define KBTITLE_H
#include <QWidget>
#include <QPushButton>
#include <QMap>
class KBTitle : public QWidget
{
Q_OBJECT
public:
KBTitle(QWidget *parent = nullptr);
virtual ~KBTitle();
public:
void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
public Q_SLOTS:
void onBtnClicked();
Q_SIGNALS:
void btnClicked(QString keyName);
private:
void initUI();
void initConnections();
private:
QPushButton *m_btnFloat = nullptr;
QPushButton *m_btnClose = nullptr;
QMap<QPushButton*, QRect> m_mapSubGeometrys;
bool floatStatus = false;
};
#endif // KBTITLE_H

View File

@ -1,27 +1,17 @@
<RCC>
<qresource prefix="/qss">
<file>keyboard.qss</file>
</qresource>
<qresource prefix="/images">
<file>images/backspace_click.svg</file>
<file>images/backspace.svg</file>
<file>images/capslock_click.svg</file>
<file>images/capslock_hl.svg</file>
<file>images/capslock.svg</file>
<file>images/down_click.svg</file>
<file>images/down.svg</file>
<file>images/enter_click.svg</file>
<file>images/enter.svg</file>
<file>images/left_click.svg</file>
<file>images/left.svg</file>
<file>images/right_click.svg</file>
<file>images/right.svg</file>
<file>images/super_click.svg</file>
<file>images/super.svg</file>
<file>images/up.svg</file>
<file>images/close_click.svg</file>
<file>images/close.svg</file>
<file>images/capslock_hl_click.svg</file>
<file>images/up_click.svg</file>
<file>images/unlock.svg</file>
<file>images/space.svg</file>
<file>images/shift.svg</file>
<file>images/float.svg</file>
<file>images/float-restore.svg</file>
<file>images/drag.svg</file>
<file>images/delet.svg</file>
<file>images/shift_lock.svg</file>
<file>images/rectangle.svg</file>
</qresource>
</RCC>

View File

@ -1,37 +0,0 @@
QPushButton
{
border: none;
font: 24px;
color: white;
background: #35322f;
border-radius: 5px;
}
QPushButton::pressed
{
color: gray;
background: #2a2826;
}
#btn_backspace, #btn_enter, #btn_shift_l,
#btn_shift_r, #btn_ctrl_l, #btn_ctrl_r,
#btn_alt_l, #btn_alt_r, #btn_super
{
font: 16px;
background: #1e1b18
}
#btn_backspace::pressed, #btn_enter::pressed, #btn_shift_l::pressed,
#btn_shift_r::pressed, #btn_ctrl_l::pressed, #btn_ctrl_r::pressed,
#btn_alt_l::pressed, #btn_alt_r::pressed, #btn_super::pressed
{
background: #181613;
color: gray;
}
#btn_letter, #btn_symbol, #btn_number,
#btn_insert, #btn_delete, #btn_home,
#btn_end, #btn_pgup, #btn_pgdn, #btn_close
{
font: 16px;
}

View File

@ -1,459 +0,0 @@
/**
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301, USA.
**/
#include "keyboardwidget.h"
#include "ui_keyboardwidget.h"
#include <QDebug>
#include <QMap>
#include <QVector>
#define SYMBOL_KEY_COUNT 29
#define SYMBOL_PAGE_COUNT 2
#define BUTTON_BG "QPushButton{background:#1E1B18}"
#define BUTTON_BG_PRESSED "QPushButton{background: #181613;}"
#define BUTTON_BG_HL "QPushButton{background:#80c342}"
#define BUTTON_BG_HL_PRESSED "QPushButton{background:#486E25}"
QChar symbols[SYMBOL_PAGE_COUNT][SYMBOL_KEY_COUNT] =
{ {'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p',
'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l',
'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/'},
{'!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
'`', '-', '=', '[', ']', '\\', '|', '{', '}',
'~','<', '>', ':', ';', '\'', '"', '_', '+', '?'}};
KeyboardWidget::KeyboardWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::KeyboardWidget),
capsLock(false),
isShift(false),
page(0)
{
vKeyboard = new X11Keyboard(this);
connect(this, SIGNAL(keyPressed(QChar)),
vKeyboard, SLOT(onKeyPressed(QChar)));
connect(this, SIGNAL(keyPressed(FuncKey::FUNCKEY)),
vKeyboard, SLOT(onKeyPressed(FuncKey::FUNCKEY)));
ui->setupUi(this);
bindSingal();
setDefaultIcon();
}
KeyboardWidget::~KeyboardWidget()
{
delete ui;
}
void KeyboardWidget::resizeEvent(QResizeEvent */*event*/)
{
int w = width();
int h = height();
int mainLeftMargin = ui->hl_main->contentsMargins().left();
int mainRightMargin = ui->hl_main->contentsMargins().right();
int mainTopMargin = ui->hl_main->contentsMargins().left();
int mainBottomMargin = ui->hl_main->contentsMargins().right();
int mainSpacing = ui->hl_main->spacing();
int itemSpacing = ui->hl_1->spacing();
int btnWidthCount = w - 11 * itemSpacing - mainSpacing- mainLeftMargin - mainRightMargin;
int btnHeightCount = h - 3 * itemSpacing - mainTopMargin - mainBottomMargin;
double btnWidth = btnWidthCount / 12;
double btnHeight = btnHeightCount / 4;
for(int i = 0; i <= 28; i++) {
QString btnObjName = "btn_" + QString::number(i);
QPushButton *btn = ui->page_letter->findChild<QPushButton*>(btnObjName);
btn->setFixedSize(btnWidth, btnHeight);
}
ui->btn_ctrl_l->setFixedSize(btnWidth * 1.3, btnHeight);
ui->btn_ctrl_r->setFixedSize(btnWidth * 1.3, btnHeight);
ui->btn_alt_l->setFixedSize(btnWidth, btnHeight);
ui->btn_alt_r->setFixedSize(btnWidth, btnHeight);
ui->btn_super->setFixedSize(btnWidth, btnHeight);
ui->btn_shift_l->setFixedSize(btnWidth, btnHeight);
ui->btn_shift_r->setFixedHeight(btnHeight);
ui->spacer_2->changeSize(btnWidth / 2, 20);
for(int i = 1; i <= 9; i++) {
QString btnObjName = "btn_num_" + QString::number(i);
QPushButton *btn = ui->page_number->findChild<QPushButton*>(btnObjName);
btn->setFixedWidth(btnWidth);
}
ui->btn_backspace_num->setFixedSize(btnWidth,btnHeight);
ui->btn_insert->setFixedWidth(btnWidth);
ui->btn_delete->setFixedWidth(btnWidth);
ui->btn_home->setFixedWidth(btnWidth);
ui->btn_end->setFixedWidth(btnWidth);
ui->btn_pgup->setFixedWidth(btnWidth);
ui->btn_pgdn->setFixedWidth(btnWidth);
ui->btn_up->setFixedSize(btnWidth,btnHeight);
ui->btn_down->setFixedSize(btnWidth,btnHeight);
ui->btn_left->setFixedSize(btnWidth,btnHeight);
ui->btn_right->setFixedSize(btnWidth,btnHeight);
ui->btn_close->setFixedHeight(btnHeight);
ui->btn_letter->setFixedHeight(btnHeight);
ui->btn_symbol->setFixedHeight(btnHeight);
ui->btn_number->setFixedHeight(btnHeight);
setIconSize();
}
float hScale = 0.6;
float wScale = hScale;
#define SET_ICON_SIZE_SCALE(btn) \
ui->btn_##btn->setIconSize(QSize(ui->btn_##btn->width() * hScale, ui->btn_##btn->height() * wScale));
#define SET_ICON_SIZE(btn) \
ui->btn_##btn->setIconSize(QSize(ui->btn_##btn->width(), ui->btn_##btn->height()));
#define SET_SHIFT_ICON_SIZE_SCALE(btn) \
ui->btn_##btn->setIconSize(QSize(ui->btn_##btn->height() * 0.4, ui->btn_##btn->height() * 0.4));
#define SET_ENTER_ICON_SIZE_SCALE(btn) \
ui->btn_##btn->setIconSize(QSize(ui->btn_##btn->width() * 0.4, ui->btn_##btn->height() * 0.4));
void KeyboardWidget::setIconSize()
{
SET_ICON_SIZE_SCALE(backspace);
SET_ICON_SIZE_SCALE(backspace_num);
SET_ENTER_ICON_SIZE_SCALE(enter);
SET_ICON_SIZE_SCALE(enter_num);
SET_ICON_SIZE_SCALE(close);
SET_ICON_SIZE_SCALE(super);
SET_SHIFT_ICON_SIZE_SCALE(shift_l);
SET_SHIFT_ICON_SIZE_SCALE(shift_r);
SET_ICON_SIZE(up);
SET_ICON_SIZE(down);
SET_ICON_SIZE(left);
SET_ICON_SIZE(right);
}
void KeyboardWidget::bindSingal()
{
for(auto obj : ui->page_letter->children()) {
if(obj->metaObject()->className() == QString("QPushButton")) {
QPushButton *btn = static_cast<QPushButton*>(obj);
btn->setFocusPolicy(Qt::NoFocus);
connect(btn, &QPushButton::clicked, this, &KeyboardWidget::onButtonClicked);
connect(btn, &QPushButton::pressed, this, &KeyboardWidget::onButtonPressed);
connect(btn, &QPushButton::released, this, &KeyboardWidget::onButtonReleased);
}
}
for(auto obj : ui->page_number->children()) {
if(obj->metaObject()->className() == QString("QPushButton")) {
QPushButton *btn = static_cast<QPushButton*>(obj);
btn->setFocusPolicy(Qt::NoFocus);
connect(btn, &QPushButton::clicked, this, &KeyboardWidget::onButtonClicked);
connect(btn, &QPushButton::pressed, this, &KeyboardWidget::onButtonPressed);
connect(btn, &QPushButton::released, this, &KeyboardWidget::onButtonReleased);
}
}
ui->btn_close->setFocusPolicy(Qt::NoFocus);
ui->btn_letter->setFocusPolicy(Qt::NoFocus);
ui->btn_symbol->setFocusPolicy(Qt::NoFocus);
ui->btn_number->setFocusPolicy(Qt::NoFocus);
connect(ui->btn_letter, &QPushButton::clicked, this, [&] {
ui->stackedWidget->setCurrentWidget(ui->page_letter);
page = 0;
switchPage();
});
connect(ui->btn_symbol, &QPushButton::clicked, this, [&] {
ui->stackedWidget->setCurrentWidget(ui->page_letter);
page = 1;
switchPage();
});
connect(ui->btn_number, &QPushButton::clicked, this, [&] {
ui->stackedWidget->setCurrentWidget(ui->page_number);
});
connect(ui->btn_close, &QPushButton::clicked,
this, &KeyboardWidget::aboutToClose);
connect(ui->btn_close, &QPushButton::pressed,
this, &KeyboardWidget::onButtonPressed);
connect(ui->btn_close, &QPushButton::released,
this, &KeyboardWidget::onButtonReleased);
}
void KeyboardWidget::setDefaultIcon()
{
ui->btn_backspace->setIcon(QIcon(":/images/images/backspace.svg"));
ui->btn_backspace_num->setIcon(QIcon(":/images/images/backspace.svg"));
ui->btn_enter->setIcon(QIcon(":/images/images/enter.svg"));
ui->btn_enter_num->setIcon(QIcon(":/images/images/enter.svg"));
ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
ui->btn_close->setIcon(QIcon(":/images/images/close.svg"));
//ui->btn_super->setIcon(QIcon(":/images/images/super.svg"));
ui->btn_super->setText("Super");
ui->btn_up->setIcon(QIcon(":/images/images/up.svg"));
ui->btn_down->setIcon(QIcon(":/images/images/down.svg"));
ui->btn_left->setIcon(QIcon(":/images/images/left.svg"));
ui->btn_right->setIcon(QIcon(":/images/images/right.svg"));
}
QString KeyboardWidget::getKeyName(QPushButton *btn)
{
QString objName = btn->objectName();
int lastUnderline = objName.lastIndexOf('_');
int start = strlen("btn_");
int keyLength = lastUnderline - start;
QString keyName = objName.mid(start, keyLength);
return keyName;
}
void KeyboardWidget::changeFuncKeyStyle(QPushButton *btn, bool isPressed)
{
QString modName = getKeyName(btn);
Modifier::MOD mod = Modifier::getModifier(modName);
if(vKeyboard->hasModifier(mod)) {
if(isPressed)
btn->setStyleSheet(BUTTON_BG_HL_PRESSED);
else
btn->setStyleSheet(BUTTON_BG_HL);
} else {
if(isPressed)
btn->setStyleSheet(BUTTON_BG_PRESSED);
else
btn->setStyleSheet(BUTTON_BG);
}
}
void KeyboardWidget::changeShitKeyStyle(QPushButton *btn, bool isPressed)
{
if(page == 0){
if(isShift) {
if(capsLock){
if(isPressed) {
btn->setStyleSheet(BUTTON_BG_HL_PRESSED);
btn->setIcon(QIcon(":/images/images/capslock_click.svg"));
} else {
btn->setStyleSheet(BUTTON_BG_HL);
btn->setIcon(QIcon(":/images/images/capslock.svg"));
}
}
else {
if(isPressed)
btn->setIcon(QIcon(":/images/images/capslock_hl_click.svg"));
else
btn->setIcon(QIcon(":/images/images/capslock_hl.svg"));
}
} else {
if(isPressed)
btn->setIcon(QIcon(":/images/images/capslock_click.svg"));
else
btn->setIcon(QIcon(":/images/images/capslock.svg"));
}
}
}
void KeyboardWidget::changeDirectKeyStyle(QPushButton *btn, bool isPressed)
{
QString keyName = getKeyName(btn);
FuncKey::FUNCKEY key = FuncKey::getKey(keyName);
if(key == FuncKey::UNKNOWN)
return;
QString iconName = QString(":/images/images/%1.svg").arg(keyName);
QString iconNamePressed = QString(":/images/images/%1_click.svg").arg(keyName);
if(isPressed)
btn->setIcon(QIcon(iconNamePressed));
else
btn->setIcon(QIcon(iconName));
}
/**
* @brief
* @param obj
* @param isPressed
*/
void KeyboardWidget::changeKeyStyle(QPushButton *btn, bool isPressed)
{
if(btn == ui->btn_ctrl_l || btn == ui->btn_ctrl_r ||
btn == ui->btn_alt_l || btn == ui->btn_alt_r ||
btn == ui->btn_super) {
changeFuncKeyStyle(btn, isPressed);
}
if(btn == ui->btn_shift_l)
changeShitKeyStyle(ui->btn_shift_l, isPressed);
if(btn == ui->btn_shift_r)
changeShitKeyStyle(ui->btn_shift_r, isPressed);
changeDirectKeyStyle(btn, isPressed);
}
void KeyboardWidget::onButtonPressed()
{
QPushButton *btn = static_cast<QPushButton*>(sender());
changeKeyStyle(btn, true);
}
void KeyboardWidget::onButtonReleased()
{
QPushButton *btn = static_cast<QPushButton*>(sender());
changeKeyStyle(btn, false);
}
void KeyboardWidget::onButtonClicked()
{
QObject *obj = sender();
if(obj->metaObject()->className() != QString("QPushButton"))
return;
QPushButton *btn = static_cast<QPushButton*>(obj);
QString keyName = getKeyName(btn);
qDebug() << "keyName: " << keyName;
Modifier::MOD mod = Modifier::getModifier(keyName);
FuncKey::FUNCKEY funcKey = FuncKey::getKey(keyName);
if(keyName == "shift") {
if(page == 0) {
isShift = !isShift;
if(isShift) { //第一次被按下
capsLock = false;
shiftLastClicked = QTime::currentTime();
ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock_hl.svg"));
ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock_hl.svg"));
}
else {
int doubleClickInterval = QApplication::doubleClickInterval();
if(shiftLastClicked.msecsTo(QTime::currentTime()) <= doubleClickInterval) {
//shift键双击锁定大写
capsLock = true;
isShift = true;
ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
ui->btn_shift_l->setStyleSheet("QPushButton{background:#80c342}");
ui->btn_shift_r->setStyleSheet("QPushButton{background:#80c342}");
} else {
ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
ui->btn_shift_l->setStyleSheet("QPushButton{background:#1e1b18}");
ui->btn_shift_r->setStyleSheet("QPushButton{background:#1e1b18}");
}
}
toggleCase();
} else {
page = page % (SYMBOL_PAGE_COUNT - 1) + 1;
switchPage();
}
} else if(mod != Modifier::UNKNOWN) {
if(vKeyboard->hasModifier(mod)) {
vKeyboard->removeModifier(mod);
btn->setStyleSheet(BUTTON_BG);
btn->setStyleSheet(BUTTON_BG);
} else {
vKeyboard->addModifier(mod);
btn->setStyleSheet(BUTTON_BG_HL);
btn->setStyleSheet(BUTTON_BG_HL);
}
} else if(funcKey != FuncKey::UNKNOWN) {
Q_EMIT keyPressed(funcKey);
} else { //字符键
QChar c;
QString text = btn->text();
qDebug() << "clicked button text: " << text;
if(text == "&&")
c = '&';
else if(text.length() == 1)
c = text.at(0);
Q_EMIT keyPressed(c);
//如果shift键被单击按一个键后就恢复为小写
if(isShift && !capsLock) {
isShift = false;
toggleCase();
changeShitKeyStyle(ui->btn_shift_l, false);
changeShitKeyStyle(ui->btn_shift_r, false);
}
clearModifier();
}
}
void KeyboardWidget::clearModifier()
{
for(auto mod : vKeyboard->getAllModifier()) {
QString modName = Modifier::getModifierName(mod);
if(mod == Modifier::SUPER) {
QString objName = QString("btn_%1").arg(modName);
QPushButton *btn = ui->page_letter->findChild<QPushButton*>(objName);
btn->setStyleSheet(BUTTON_BG);
} else {
QString objName = QString("btn_%1_l").arg(modName);
QPushButton *btn = ui->page_letter->findChild<QPushButton*>(objName);
btn->setStyleSheet(BUTTON_BG);
objName = QString("btn_%1_r").arg(modName);
btn = ui->page_letter->findChild<QPushButton*>(objName);
btn->setStyleSheet(BUTTON_BG);
}
}
vKeyboard->clearModifier();
}
void KeyboardWidget::toggleCase()
{
for(int i = 0; i < 26; i++) {
QString objName = "btn_" + QString::number(i);
QPushButton *btn = findChild<QPushButton*>(objName);
QChar ch;
if(isShift) { //切换到大写
ch = symbols[0][i].toUpper();
} else {
ch = symbols[0][i];
}
btn->setText(ch);
}
}
void KeyboardWidget::switchPage()
{
if(page == 0) {
ui->btn_shift_l->setText("");
ui->btn_shift_r->setText("");
ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
} else {
ui->btn_shift_l->setText("");
ui->btn_shift_r->setText("");
ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
}
for(int i = 0; i < SYMBOL_KEY_COUNT; i++) {
QString btnObjName = "btn_" + QString::number(i);
QPushButton *btn = ui->page_letter->findChild<QPushButton*>(btnObjName);
QChar c = symbols[page][i];
if(c == '&')
btn->setText("&&");
else
btn->setText(c);
}
}

View File

@ -1,77 +0,0 @@
/**
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301, USA.
**/
#ifndef KEYBOARDWIDGET_H
#define KEYBOARDWIDGET_H
#include <QWidget>
#include <QMap>
#include <QTime>
#include "x11keyboard.h"
namespace Ui {
class KeyboardWidget;
}
class QPushButton;
class KeyboardWidget : public QWidget
{
Q_OBJECT
public:
explicit KeyboardWidget(QWidget *parent = 0);
~KeyboardWidget();
protected:
void resizeEvent(QResizeEvent *event);
private:
void bindSingal();
void toggleCase();
void switchPage();
void setDefaultIcon();
void setIconSize();
void changeKeyStyle(QPushButton *btn, bool isPressed);
void changeFuncKeyStyle(QPushButton *btn, bool isPressed);
void changeShitKeyStyle(QPushButton *btn, bool isPressed);
void changeDirectKeyStyle(QPushButton *btn, bool isPressed);
void clearModifier();
QString getKeyName(QPushButton *btn);
private Q_SLOTS:
void onButtonClicked();
void onButtonPressed();
void onButtonReleased();
Q_SIGNALS:
void aboutToClose();
void keyPressed(QChar c);
void keyPressed(FuncKey::FUNCKEY key);
private:
Ui::KeyboardWidget *ui;
bool capsLock; //是否大写锁定
bool isShift;
QTime shiftLastClicked; //shift键上次被点击的时间
int page; //当前是第几页的键盘
X11Keyboard *vKeyboard;
};
#endif // KEYBOARDWIDGET_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,349 @@
#include "letterswidget.h"
#include "commondef.h"
#include <QDebug>
LettersWidget::LettersWidget(QWidget *parent/* = nullptr*/)
: QWidget(parent)
{
this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
initUI();
settings = new QGSettings("org.ukui.peripherals-keyboard", "", this);
connect(settings, &QGSettings::changed,
this, &LettersWidget::onCapsChanged);
capsState = settings->get("capslock-state").toBool();
onCapsChanged();
}
LettersWidget::~LettersWidget()
{
}
void LettersWidget::initUI()
{
// line 1
QChar chLine1[] = {'q','w','e','r','t','y','u','i','o','p'};
for (int n = 0; n < sizeof(chLine1)/sizeof(QChar); n++) {
KBButton *letterBtn = new KBButton(this);
QString objName = "btn_" + QString::number(chLine1[n].toLatin1());
letterBtn->setObjectName(objName);
letterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L1+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*n,
KEYBOARD_FIXED_DEFAULT_TMARGIN,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
letterBtn->setCharId(chLine1[n]);
letterBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(letterBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[letterBtn] = letterBtn->geometry();
}
// backspace
KBButton *backspaceBtn = new KBButton(this);
backspaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L1+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
KEYBOARD_FIXED_DEFAULT_TMARGIN,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
backspaceBtn->setObjectName("btn_backspace");
backspaceBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
backspaceBtn->setIcon(QIcon(":/images/images/delet.svg"));
connect(backspaceBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[backspaceBtn] = backspaceBtn->geometry();
qDebug()<<"backspaceBtn geometry:"<<backspaceBtn->geometry();
// line 2
QChar chLine2[] = {'a','s','d','f','g','h','j','k','l'};
for (int n = 0; n < sizeof(chLine2)/sizeof(QChar); n++) {
KBButton *letterBtn = new KBButton(this);
QString objName = "btn_" + QString::number(chLine2[n].toLatin1());
letterBtn->setObjectName(objName);
letterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L2+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*n,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING),
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
letterBtn->setCharId(chLine2[n]);
letterBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(letterBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[letterBtn] = letterBtn->geometry();
}
// enter
KBButton *enterBtn = new KBButton(this);
enterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L2+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*9,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING),
KEYBOARD_FIXED_DEFAULT_ENTERBTN_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
enterBtn->setObjectName("btn_enter");
enterBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
enterBtn->setIcon(QIcon(":/images/images/enter.svg"));
connect(enterBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[enterBtn] = enterBtn->geometry();
// line 3
QChar chLine3[] = {'z','x','c','v','b','n','m',',','.'};
for (int n = 0; n < sizeof(chLine3)/sizeof(QChar); n++) {
KBButton *letterBtn = new KBButton(this);
QString objName = "btn_" + QString::number(chLine3[n].toLatin1());
letterBtn->setObjectName(objName);
letterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
letterBtn->setCharId(chLine3[n]);
letterBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,
KEYBOARD_FONT_COLOR_PRESS);
connect(letterBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[letterBtn] = letterBtn->geometry();
}
// shift l
KBButton *shiftLBtn = new KBButton(this);
shiftLBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
shiftLBtn->setObjectName("btn_shift_l");
shiftLBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
KEYBOARD_OTHER_FONT_COLOR_PRESS);
shiftLBtn->setIcon(QIcon(":/images/images/shift.svg"));
connect(shiftLBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[shiftLBtn] = shiftLBtn->geometry();
// shift r
KBButton *shiftRBtn = new KBButton(this);
shiftRBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
shiftRBtn->setObjectName("btn_shift_r");
shiftRBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
KEYBOARD_OTHER_FONT_COLOR_PRESS);
shiftRBtn->setIcon(QIcon(":/images/images/shift.svg"));
connect(shiftRBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[shiftRBtn] = shiftRBtn->geometry();
// line 4
KBButton *symbolBtn = new KBButton(this);
symbolBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
symbolBtn->setObjectName("btn_symbol");
symbolBtn->setText(tr("&&?!"));
symbolBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(symbolBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[symbolBtn] = symbolBtn->geometry();
KBButton *numBtn = new KBButton(this);
numBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING),
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
numBtn->setObjectName("btn_num");
numBtn->setText(tr("123"));
numBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(numBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[numBtn] = numBtn->geometry();
KBButton *ctrlBtn = new KBButton(this);
ctrlBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*2,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
ctrlBtn->setObjectName("btn_ctrl");
ctrlBtn->setText(tr("Ctrl"));
ctrlBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(ctrlBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[ctrlBtn] = ctrlBtn->geometry();
KBButton *spaceBtn = new KBButton(this);
spaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*3,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_SPACEBTN_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
spaceBtn->setObjectName("btn_space");
spaceBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
KEYBOARD_LETTER_COLOR_BORDER_PRESSED,
KEYBOARD_OTHER_FONT_COLOR_PRESS);
spaceBtn->setIcon(QIcon(":/images/images/space.svg"));
connect(spaceBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[spaceBtn] = spaceBtn->geometry();
KBButton *altBtn = new KBButton(this);
altBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*8,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
altBtn->setObjectName("btn_alt");
altBtn->setText(tr("Alt"));
altBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(altBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[altBtn] = altBtn->geometry();
KBButton *leftBtn = new KBButton(this);
leftBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*9,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
leftBtn->setObjectName("btn_left");
leftBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
KEYBOARD_OTHER_FONT_COLOR_PRESS);
leftBtn->setIcon(QIcon(":/images/images/left.svg"));
connect(leftBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[leftBtn] = leftBtn->geometry();
KBButton *rightBtn = new KBButton(this);
rightBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
rightBtn->setObjectName("btn_right");
rightBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
KEYBOARD_OTHER_FONT_COLOR_PRESS);
rightBtn->setIcon(QIcon(":/images/images/right.svg"));
connect(rightBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
m_mapBtnGeometrys[rightBtn] = rightBtn->geometry();
}
void LettersWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
{
QMap<KBButton*, QRect>::iterator itGeometry = m_mapBtnGeometrys.begin();
for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) {
KBButton *button = itGeometry.key();
if (button) {
QRect oldGeometry = itGeometry.value();
QRect newGeometry = oldGeometry;
if (floatStatus) {
newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
} else {
newGeometry.setX(oldGeometry.x()*lfWidthScale);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
}
button->setGeometry(newGeometry);
}
}
}
void LettersWidget::onBtnClicked(QChar charId)
{
QObject *obj = sender();
KBButton *btn = static_cast<KBButton*>(obj);
QString objName = btn->objectName();
int lastUnderline = objName.lastIndexOf('_');
int start = strlen("btn_");
int keyLength = lastUnderline - start;
QString keyName = objName.mid(start, keyLength);
if (charId != QChar::Null && isShift && !capsState) { //第一次按shift按后取消shift状态
isShift = false;
changeFuncKeyStyle("shift_l", false);
changeFuncKeyStyle("shift_r", false);
toggleCase();
}
if (keyName == "num") { //数字页面
Q_EMIT specialBtnClicked(PAGE_NUMBER);
} else if (keyName == "symbol") { //符号页面
Q_EMIT specialBtnClicked(PAGE_CHAR);
} else if (keyName == BTN_SHIFT) { //shift
if (capsState) {
capsState = false;
isShift = false;
changeFuncKeyStyle("shift_l", false);
changeFuncKeyStyle("shift_r", false);
Q_EMIT specialBtnClicked(BTN_CAPSLOCK);
} else if (isShift) { //shift键锁定
capsState = true;
isShift = true;
changeFuncKeyStyle("shift_l", true);
changeFuncKeyStyle("shift_r", true);
Q_EMIT specialBtnClicked(BTN_CAPSLOCK);
} else {
isShift = true;
changeFuncKeyStyle("shift_l", true);
changeFuncKeyStyle("shift_r", true);
}
toggleCase();
} else if (charId != QChar::Null) { //字符
Q_EMIT normalBtnClicked(charId);
} else { //ctrl或者alt
Q_EMIT specialBtnClicked(keyName);
}
}
void LettersWidget::onCapsChanged()
{
capsState = settings->get("capslock-state").toBool();
isShift = capsState;
for (int i = 97; i < 123; i++) { //大小写切换
QString objName = QString("btn_%1").arg(QString::number(i));
KBButton *btn = findChild<KBButton*>(objName);
btn->setCapsStatus(capsState);
changeFuncKeyStyle("shift_l", capsState);
changeFuncKeyStyle("shift_r", capsState);
}
}
void LettersWidget::toggleCase()
{
for (int i = 97; i < 123; i++) { //大小写切换
QString objName = QString("btn_%1").arg(QString::number(i));
KBButton *btn = findChild<KBButton*>(objName);
btn->setShiftState(isShift);
}
}
void LettersWidget::changeFuncKeyStyle(QString obj, bool isLock)
{
if(obj == BTN_CAPSLOCK)
return;
QString objName = QString("btn_%1").arg(obj);
KBButton *btn = findChild<KBButton*>(objName);
if (isLock) {
btn->updateStyleSheet(KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS,
KBButton::BORDER_RADIUS_ALL,true);
if (capsState && obj.contains(BTN_SHIFT)) {
btn->setIcon(QIcon(":/images/images/shift_lock.svg"));
} else if (obj.contains(BTN_SHIFT)) {
btn->setIcon(QIcon(":/images/images/rectangle.svg"));
}
} else {
btn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
if (obj.contains(BTN_SHIFT)) {
btn->setIcon(QIcon(":/images/images/shift.svg"));
}
}
}

View File

@ -0,0 +1,41 @@
#ifndef LETTERSWIDGET_H
#define LETTERSWIDGET_H
#include <QWidget>
#include <QGSettings/qgsettings.h>
#include "kbbutton.h"
#include <QMap>
class LettersWidget : public QWidget
{
Q_OBJECT
public:
explicit LettersWidget(QWidget *parent = nullptr);
virtual ~LettersWidget();
void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
void changeFuncKeyStyle(QString obj, bool isLock);
public Q_SLOTS:
void onBtnClicked(QChar charId);
void onCapsChanged();
Q_SIGNALS:
void clicked(int nKeyId);
void specialBtnClicked(QString keyName);
void normalBtnClicked(QChar c);
private:
void initUI();
void toggleCase();
private:
QMap<KBButton*, QRect> m_mapBtnGeometrys;
bool isShift = false;
QGSettings *settings;
bool capsState = false;
};
#endif // LETTERSWIDGET_H

View File

@ -0,0 +1,276 @@
#include "numberswidget.h"
#include "kbbutton.h"
#include "commondef.h"
#include <QFrame>
#include <QScrollArea>
#include <QScrollBar>
#include <QVBoxLayout>
#include <QVariant>
#include <QDebug>
NumbersWidget::NumbersWidget(QWidget *parent)
: QWidget(parent)
{
this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
initUI();
}
NumbersWidget::~NumbersWidget()
{
}
void NumbersWidget::initUI()
{
// all chars
m_layoutBtnList = new QVBoxLayout();
m_layoutBtnList->setContentsMargins(8,0,0,0);
m_layoutBtnList->setSpacing(1);
listFrame = new QFrame();
listFrame->setObjectName("listFrame");
listFrame->setLayout(m_layoutBtnList);
listFrame->setStyleSheet("QFrame{border-radius: 8px}");
listFrame->setFrameStyle(QFrame::Plain);
m_scrollFrame = new QScrollArea(this);
m_scrollFrame->setObjectName("scrollFrame");
m_scrollFrame->setFocusPolicy(Qt::NoFocus);
m_scrollFrame->setContentsMargins(0, 0, 0, 0);
m_scrollFrame->setStyleSheet("QScrollArea {background-color: #C0CED3D9; border-radius:8px;}");
m_scrollFrame->viewport()->setStyleSheet("background-color:transparent;");
m_scrollFrame->verticalScrollBar()->setProperty("drawScrollBarGroove", false);
m_scrollFrame->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_scrollFrame->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu);
m_scrollFrame->setWidgetResizable(true);
m_scrollFrame->setWidget(listFrame);
m_scrollFrame->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L1, KEYBOARD_FIXED_DEFAULT_TMARGIN,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH, KEYBOARD_FIXED_DEFAULT_NUMBER_CHARS_HEIGHT);
listFrame->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L1, KEYBOARD_FIXED_DEFAULT_TMARGIN,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH, KEYBOARD_FIXED_DEFAULT_NUMBER_CHARS_HEIGHT);
m_mapBtnGeometrys[m_scrollFrame] = m_scrollFrame->geometry();
//m_mapBtnGeometrys[listFrame] = listFrame->geometry();
QChar chChars[] = {',', '.', '?', '!', '\'', ':', '~', '@', ';', '"',
'/', '(', ')', '_', '+', '=', '`', '^', '#', '*',
'%', '&', '\\', '[', ']', '<', '>', '{', '}', '|',
'$', '-'};
for (int n = 0; n < sizeof(chChars)/sizeof(QChar); n++) {
KBButton *charBtn = new KBButton(listFrame);
charBtn->setCharId(chChars[n]);
charBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_NORMAL,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS,
KBButton::BORDER_RADIUS_NONE);
charBtn->setObjectName(QString("btn_%1").arg(QString(chChars[n])));
connect(charBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
charBtn->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
m_layoutBtnList->addWidget(charBtn);
}
// line 1
QChar chLine1[] = {'1','2','3'};
for (int n = 0; n < sizeof(chLine1)/sizeof(QChar); n++) {
KBButton *numberBtn = new KBButton(this);
numberBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L1+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
KEYBOARD_FIXED_DEFAULT_TMARGIN,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
numberBtn->setCharId(chLine1[n]);
numberBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(numberBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[numberBtn] = numberBtn->geometry();
}
// backspace
KBButton *backspaceBtn = new KBButton(this);
backspaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L1+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*4,
KEYBOARD_FIXED_DEFAULT_TMARGIN,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
backspaceBtn->setObjectName("btn_backspace");
backspaceBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
backspaceBtn->setIcon(QIcon(":/images/images/delet.svg"));
connect(backspaceBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[backspaceBtn] = backspaceBtn->geometry();
// line 2
QChar chLine2[] = {'4','5','6'};
for (int n = 0; n < sizeof(chLine2)/sizeof(QChar); n++) {
KBButton *numberBtn = new KBButton(this);
numberBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L2+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*1,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
numberBtn->setCharId(chLine2[n]);
numberBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(numberBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[numberBtn] = numberBtn->geometry();
}
// @
KBButton *atBtn = new KBButton(this);
atBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L2+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*4,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*1,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
atBtn->setCharId('@');
atBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(atBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[atBtn] = atBtn->geometry();
// line 3
QChar chLine3[] = {'7','8','9'};
for (int n = 0; n < sizeof(chLine3)/sizeof(QChar); n++) {
KBButton *numberBtn = new KBButton(this);
numberBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L3+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
numberBtn->setCharId(chLine3[n]);
numberBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(numberBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[numberBtn] = numberBtn->geometry();
}
// symbol
KBButton *symbolBtn = new KBButton(this);
symbolBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L3+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*4,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
symbolBtn->setObjectName("btn_symbol");
symbolBtn->setText(tr("&&?!"));
symbolBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(symbolBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[symbolBtn] = symbolBtn->geometry();
// line 4
KBButton *returnBtn = new KBButton(this);
returnBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L4,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
returnBtn->setObjectName("btn_return");
returnBtn->setText(tr("Return"));
returnBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
connect(returnBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[returnBtn] = returnBtn->geometry();
// space
KBButton *spaceBtn = new KBButton(this);
spaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L4+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*1,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
spaceBtn->setObjectName("btn_space");
spaceBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
spaceBtn->setIcon(QIcon(":/images/images/space.svg"));
connect(spaceBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[spaceBtn] = spaceBtn->geometry();
// .
KBButton *dianBtn = new KBButton(this);
dianBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L4+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*3,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
dianBtn->setCharId('.');
dianBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(dianBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[dianBtn] = dianBtn->geometry();
// 9
KBButton *num0Btn = new KBButton(this);
num0Btn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L4+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*2,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
num0Btn->setCharId('0');
num0Btn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
connect(num0Btn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[num0Btn] = num0Btn->geometry();
// enter
KBButton *enterBtn = new KBButton(this);
enterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L3+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*4,
KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
enterBtn->setObjectName("btn_enter");
enterBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
enterBtn->setIcon(QIcon(":/images/images/enter.svg"));
connect(enterBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
m_mapBtnGeometrys[enterBtn] = enterBtn->geometry();
}
void NumbersWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
{
QMap<QWidget*, QRect>::iterator itGeometry = m_mapBtnGeometrys.begin();
for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) {
QWidget *widget = itGeometry.key();
if (widget) {
QRect oldGeometry = itGeometry.value();
QRect newGeometry = oldGeometry;
if (floatStatus) {
newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
} else {
newGeometry.setX(oldGeometry.x()*lfWidthScale);
newGeometry.setY(oldGeometry.y()*lfHeightScale);
newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
}
widget->setGeometry(newGeometry);
}
}
QChar chChars[] = {',', '.', '?', '!', '\'', ':', '~', '@', ';', '"',
'/', '(', ')', '_', '+', '=', '`', '^', '#', '*',
'%', '&', '\\', '[', ']', '<', '>', '{', '}', '|',
'$', '-'};
for (int n = 0; n < sizeof(chChars)/sizeof(QChar); n++) { //单独更新符号btn的高度
QString objName = QString("btn_%1").arg(QString(chChars[n]));
KBButton *btn = findChild<KBButton*>(objName);
btn->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT *lfHeightScale);
}
//更新listfarame的高度
listFrame->setFixedHeight((KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT *lfHeightScale +1) * (m_layoutBtnList->count()));
}
void NumbersWidget::onBtnClicked(QChar charId)
{
QObject *obj = sender();
KBButton *btn = static_cast<KBButton*>(obj);
QString objName = btn->objectName();
int lastUnderline = objName.lastIndexOf('_');
int start = strlen("btn_");
int keyLength = lastUnderline - start;
QString keyName = objName.mid(start, keyLength);
qDebug() << "keyName: " << keyName;
if (keyName == BTN_RETURN) {
Q_EMIT specialBtnClicked(PAGE_LETTER);
} else if (keyName == "symbol") {
Q_EMIT specialBtnClicked(PAGE_CHAR);
} else if (charId != QChar::Null) {
Q_EMIT narmalBtnClicked(charId);
} else if (keyName == BTN_BACK) {
Q_EMIT specialBtnClicked(BTN_BACK);
} else {
Q_EMIT specialBtnClicked(keyName);
}
}

View File

@ -0,0 +1,38 @@
#ifndef NUMBERSWIDGET_H
#define NUMBERSWIDGET_H
#include <QWidget>
#include <QMap>
class KBButton;
class QVBoxLayout;
class QScrollArea;
class QFrame;
class NumbersWidget : public QWidget
{
Q_OBJECT
public:
explicit NumbersWidget(QWidget *parent = nullptr);
virtual ~NumbersWidget();
void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
public Q_SLOTS:
void onBtnClicked(QChar charId);
Q_SIGNALS:
void clicked(int nKeyId);
void specialBtnClicked(QString keyName);
void narmalBtnClicked(QChar charId);
private:
void initUI();
private:
QMap<QWidget*, QRect> m_mapBtnGeometrys;
QVBoxLayout *m_layoutBtnList = nullptr;
QScrollArea *m_scrollFrame = nullptr;
QFrame *listFrame = nullptr;
};
#endif // NUMBERSWIDGET_H

View File

@ -1,79 +0,0 @@
/**
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301, USA.
**/
#include "virtualkeyboard.h"
#include <QFile>
#include <QDesktopWidget>
#include <QHBoxLayout>
#include <QApplication>
VirtualKeyboard::VirtualKeyboard(QWidget *parent)
: QWidget(parent)
{
Q_INIT_RESOURCE(keyboard);
setAutoFillBackground(true);
QPalette plt;
plt.setBrush(QPalette::Background, Qt::black);
setPalette(plt);
setWindowFlags(Qt::FramelessWindowHint |
Qt::WindowStaysOnTopHint |
Qt::WindowDoesNotAcceptFocus);
keyboardWidget = new KeyboardWidget(this);
QHBoxLayout *hl_keyboard = new QHBoxLayout(this);
QSpacerItem *spacer = new QSpacerItem(40, 20);
hl_keyboard->addSpacerItem(spacer);
hl_keyboard->addWidget(keyboardWidget);
QSpacerItem *spacer2 = new QSpacerItem(40, 20);
hl_keyboard->addSpacerItem(spacer2);
QFile qssFile(":/qss/keyboard.qss");
qssFile.open(QIODevice::ReadOnly);
setStyleSheet(qssFile.readAll());
qssFile.close();
QDesktopWidget *desktop = QApplication::desktop();
cursorMonitor = new CursorMonitor(this);
//在多显示器情况下,监视鼠标指针的位置和主显示器变化信号
connect(cursorMonitor, &CursorMonitor::cursorPosChanged,
this, [&](const QPoint &pos){
adjustGeometry(desktop->screenNumber(pos));
});
connect(desktop, &QDesktopWidget::primaryScreenChanged,
this, [&]{
adjustGeometry(desktop->primaryScreen());
});
connect(keyboardWidget, &KeyboardWidget::aboutToClose,
this, &VirtualKeyboard::aboutToClose);
adjustGeometry(desktop->primaryScreen());
}
void VirtualKeyboard::adjustGeometry(int screen)
{
QDesktopWidget *desktop = QApplication::desktop();
QWidget *activateScreen = desktop->screen(screen);
setGeometry(0, activateScreen->height() - activateScreen->height() / 3,
activateScreen->width(), activateScreen->height() / 3);
}

View File

@ -1,47 +0,0 @@
/**
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301, USA.
**/
#ifndef VIRTUALKEYBOARD_H
#define VIRTUALKEYBOARD_H
#include <QWidget>
#include <QPushButton>
#include "keyboardwidget.h"
#include "cursormonitor.h"
class VirtualKeyboard : public QWidget
{
Q_OBJECT
public:
explicit VirtualKeyboard(QWidget *parent = 0);
private:
void adjustGeometry(int screen);
Q_SIGNALS:
void aboutToClose();
private:
KeyboardWidget *keyboardWidget;
CursorMonitor *cursorMonitor;
bool isApplication;
};
#endif // VIRTUALKEYBOARD_H

View File

@ -0,0 +1,303 @@
/**
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301, USA.
**/
#include "virtualkeyboardwidget.h"
#include <QPainterPath>
#include <QPainter>
#include <QMouseEvent>
#include "commondef.h"
#include <QDebug>
#include <QVBoxLayout>
#include "dragwidget.h"
#include "kbtitle.h"
#include "letterswidget.h"
#include "numberswidget.h"
#include "charswidget.h"
#include "charsmorewidget.h"
VirtualKeyboardWidget::VirtualKeyboardWidget(QWidget *parent)
: QWidget(parent)
, m_lfWidthScale(1.0)
, m_lfHeightScale(1.0)
, m_isVertical(false)
{
Q_INIT_RESOURCE(keyboard);
setAttribute(Qt::WA_TranslucentBackground);//背景透明
//setAutoFillBackground(true);
setWindowFlags(Qt::FramelessWindowHint |
Qt::WindowStaysOnTopHint |
Qt::WindowDoesNotAcceptFocus);
vKeyboard = new X11Keyboard(this);
connect(this, SIGNAL(keyPressed(QChar)),
vKeyboard, SLOT(onKeyPressed(QChar)));
connect(this, SIGNAL(keyPressed(FuncKey::FUNCKEY)),
vKeyboard, SLOT(onKeyPressed(FuncKey::FUNCKEY)));
initUI();
initConnections();
}
VirtualKeyboardWidget::~VirtualKeyboardWidget()
{
}
void VirtualKeyboardWidget::initUI()
{
QVBoxLayout *layoutMain = new QVBoxLayout(this);
layoutMain->setContentsMargins(0,0,0,0);
layoutMain->setSpacing(0);
m_dragWidget = new DragWidget();
layoutMain->addWidget(m_dragWidget);
m_dragWidget->installEventFilter(this);
m_kbTitle = new KBTitle();
layoutMain->addWidget(m_kbTitle);
m_stackedWidget = new QStackedWidget();
m_lettersWidget = new LettersWidget();
m_stackedWidget->addWidget(m_lettersWidget);
m_numbersWidget = new NumbersWidget(this);
m_stackedWidget->addWidget(m_numbersWidget);
m_charsWidget = new CharsWidget();
m_stackedWidget->addWidget(m_charsWidget);
m_charsMoreWidget = new CharsMoreWidget();
m_stackedWidget->addWidget(m_charsMoreWidget);
m_stackedWidget->setCurrentIndex(VKB_PAGE_LETTERS);
m_nCurPage = VKB_PAGE_CHARSMORE;
layoutMain->addWidget(m_stackedWidget);
}
void VirtualKeyboardWidget::initConnections()
{
connect(m_kbTitle, &KBTitle::btnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
connect(m_lettersWidget, &LettersWidget::specialBtnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
connect(m_lettersWidget, &LettersWidget::normalBtnClicked, this, &VirtualKeyboardWidget::onNormalBtnClicked);
connect(m_numbersWidget, &NumbersWidget::specialBtnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
connect(m_numbersWidget, &NumbersWidget::narmalBtnClicked, this, &VirtualKeyboardWidget::onNormalBtnClicked);
connect(m_charsWidget, &CharsWidget::specialBtnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
connect(m_charsWidget, &CharsWidget::normalBtnClicked, this, &VirtualKeyboardWidget::onNormalBtnClicked);
connect(m_charsMoreWidget, &CharsMoreWidget::specialBtnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
connect(m_charsMoreWidget, &CharsMoreWidget::normalBtnClicked, this, &VirtualKeyboardWidget::onNormalBtnClicked);
}
void VirtualKeyboardWidget::adjustGeometry()
{
QWidget *parentWidget = qobject_cast<QWidget*>(parent());
if (parentWidget) {
//qDebug()<< "parent: " << parentWidget <<"Parent gemotry:"<<parentWidget->geometry();
double lfWidth = parentWidget->geometry().width();
double lfHeight = parentWidget->geometry().height();
m_isVertical = lfHeight > lfWidth;
m_lfWidthScale = lfWidth/KEYBOARD_PARENT_DEFAULT_WIDTH;
if (m_isVertical)
m_lfHeightScale = lfHeight / KEYBOARD_PARENT_DEFAULT_WIDTH;
else
m_lfHeightScale = lfHeight / KEYBOARD_PARENT_DEFAULT_HEIGHT;
if (m_isdragState) {
lfWidth = m_lfWidthScale * KEYBOARD_DRAGSHOW_FIXED_DEFAULT_WIDTH;
lfHeight = m_lfHeightScale * KEYBOARD_DRAGSHOW_FIXED_DEFAULT_HEIGHT;
setGeometry(QRect(m_lfWidthScale * (KEYBOARD_PARENT_DEFAULT_WIDTH - KEYBOARD_DRAGSHOW_FIXED_DEFAULT_WIDTH) / 2,
parentWidget->geometry().height() - lfHeight,
lfWidth, lfHeight));
m_dragWidget->show();
} else {
lfWidth = m_lfWidthScale * KEYBOARD_FIXED_DEFAULT_WIDTH;
lfHeight = m_lfHeightScale * KEYBOARD_DRAGHIDE_FIXED_DEFAULT_HEIGHT;
m_dragWidget->hide();
setGeometry(QRect(0, parentWidget->geometry().height()-lfHeight, lfWidth, lfHeight));
}
//qDebug()<<"Widget geometry:"<<geometry();
} else {
if (m_isdragState) {
setGeometry(QRect(0, 0,
KEYBOARD_DRAGSHOW_FIXED_DEFAULT_WIDTH, KEYBOARD_DRAGSHOW_FIXED_DEFAULT_HEIGHT));
m_dragWidget->show();
} else {
setGeometry(QRect(0, 0,
KEYBOARD_FIXED_DEFAULT_WIDTH, KEYBOARD_DRAGHIDE_FIXED_DEFAULT_HEIGHT));
m_dragWidget->hide();
}
m_lfWidthScale = 1.0;
m_lfHeightScale = 1.0;
m_isVertical = false;
}
if (m_dragWidget) {
m_dragWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
}
if (m_kbTitle) {
m_kbTitle->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
}
if (m_lettersWidget) {
m_lettersWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
}
if (m_numbersWidget) {
m_numbersWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
}
if (m_charsWidget) {
m_charsWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
}
if (m_charsMoreWidget) {
m_charsMoreWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
}
}
bool VirtualKeyboardWidget::eventFilter(QObject *watched, QEvent *event)
{
if(watched != m_dragWidget && !isMove) return QWidget::eventFilter(watched, event);
switch(event->type())
{
case QEvent::MouseButtonPress:
onMouseEvents(1);
return true;
case QEvent::MouseMove:
onMouseEvents(2);
return true;
case QEvent::MouseButtonRelease:
onMouseEvents(3);
return true;
default:
break;
}
return QWidget::eventFilter(watched, event);
}
void VirtualKeyboardWidget::resizeEvent(QResizeEvent *event)
{
adjustGeometry();
}
void VirtualKeyboardWidget::paintEvent(QPaintEvent *event)
{
QPainterPath path;
QPainter painter(this);
painter.setOpacity(1.0);
painter.setRenderHint(QPainter::Antialiasing); // 反锯齿;
painter.setClipping(true);
painter.setPen(Qt::transparent);
if (m_isdragState) {
path.addRoundedRect(this->rect(), 16, 16);
} else {
path.addRoundedRect(this->rect(), 0, 0);
}
path.setFillRule(Qt::WindingFill);
painter.setBrush(QColor("#EBEDEF"));
painter.setPen(Qt::transparent);
painter.drawPath(path);
QWidget::paintEvent(event);
}
void VirtualKeyboardWidget::onSpecialBtnClicked(QString keyName)
{
Modifier::MOD mod = Modifier::getModifier(keyName);
FuncKey::FUNCKEY funcKey = FuncKey::getKey(keyName);
if (mod != Modifier::UNKNOWN) {
if(vKeyboard->hasModifier(mod)) {
vKeyboard->removeModifier(mod);
m_lettersWidget->changeFuncKeyStyle(keyName, false);
} else {
vKeyboard->addModifier(mod);
m_lettersWidget->changeFuncKeyStyle(keyName, true);
}
if (keyName == BTN_CAPSLOCK) {
Q_EMIT keyPressed(FuncKey::UNKNOWN);
clearModifier();
}
} else if(funcKey != FuncKey::UNKNOWN) {
Q_EMIT keyPressed(funcKey);
} else if (keyName == PAGE_CHARSMORE) {
m_stackedWidget->setCurrentIndex(VKB_PAGE_CHARSMORE);
update();
} else if (keyName == PAGE_CHAR) {
m_stackedWidget->setCurrentIndex(VKB_PAGE_CHARS);
update();
} else if (keyName == PAGE_NUMBER) {
m_stackedWidget->setCurrentIndex(VKB_PAGE_NUMBERS);
update();
} else if (keyName == PAGE_LETTER) {
m_stackedWidget->setCurrentIndex(VKB_PAGE_LETTERS);
update();
} else if (keyName == BTN_FLOAT) {
m_isdragState = !m_isdragState;
adjustGeometry();
Q_EMIT aboutToFloat();
} else if (keyName == BTN_CLOSE) {
Q_EMIT aboutToClose();
}
}
void VirtualKeyboardWidget::onNormalBtnClicked(QChar c)
{
Q_EMIT keyPressed(c);
clearModifier();
}
void VirtualKeyboardWidget::clearModifier()
{
for(auto mod : vKeyboard->getAllModifier()) {
QString modName = Modifier::getModifierName(mod);
m_lettersWidget->changeFuncKeyStyle(modName, false);
}
vKeyboard->clearModifier();
}
void VirtualKeyboardWidget::onMouseEvents(int type)
{
switch (type) {
case 1:
{
isMove = true;
lastPoint = QCursor::pos();
break;
}
case 2:
{
if(isMove)
{
QPoint cPoint = QCursor::pos();
QPoint p = pos();
p.setX(p.x() - lastPoint.x() + cPoint.x());
p.setY(p.y() - lastPoint.y() + cPoint.y());
lastPoint = cPoint;
move(p);
}
break;
}
case 3:
{
isMove = false;
break;
}
default:
break;
}
}
bool VirtualKeyboardWidget::getFloatStatus()
{
return m_isdragState;
}

View File

@ -0,0 +1,89 @@
/**
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301, USA.
**/
#ifndef VIRTUALKEYBOARDWIDGET_H
#define VIRTUALKEYBOARDWIDGET_H
#include <QWidget>
#include <QStackedWidget>
#include <QList>
#include <QMap>
#include "x11keyboard.h"
class DragWidget;
class KBTitle;
class LettersWidget;
class NumbersWidget;
class CharsWidget;
class CharsMoreWidget;
class VirtualKeyboardWidget : public QWidget
{
Q_OBJECT
public:
enum {
VKB_PAGE_LETTERS,
VKB_PAGE_NUMBERS,
VKB_PAGE_CHARS,
VKB_PAGE_CHARSMORE,
};
VirtualKeyboardWidget(QWidget *parent = nullptr);
virtual ~VirtualKeyboardWidget();
bool getFloatStatus();
public Q_SLOTS:
void onNormalBtnClicked(QChar c);
void onSpecialBtnClicked(QString keyName);
Q_SIGNALS:
void aboutToClose();
void aboutToFloat();
void keyPressed(QChar c);
void keyPressed(FuncKey::FUNCKEY key);
protected:
void paintEvent(QPaintEvent *) override;
void resizeEvent(QResizeEvent *event) override;
bool eventFilter(QObject *watched, QEvent *event) override;
private:
void initUI();
void initConnections();
void adjustGeometry();
void onMouseEvents(int type);
void clearModifier();
private:
double m_lfWidthScale;
double m_lfHeightScale;
bool m_isVertical;
QStackedWidget *m_stackedWidget = nullptr;
LettersWidget *m_lettersWidget = nullptr;
NumbersWidget *m_numbersWidget = nullptr;
CharsWidget *m_charsWidget = nullptr;
CharsMoreWidget *m_charsMoreWidget = nullptr;
KBTitle *m_kbTitle = nullptr;
DragWidget *m_dragWidget = nullptr;
int m_nCurPage;
QList<int> m_listPageHis;
bool m_isdragState = false;//是否为悬浮状态
bool isMove;// 是否可移动
QPoint lastPoint;// 拖拽控件时 记录当前控件的位置
X11Keyboard *vKeyboard;
};
#endif // VIRTUALKEYBOARDWIDGET_H

View File

@ -86,7 +86,8 @@ QMap<Modifier::MOD, KeySym> modifierMap = {
{Modifier::CTRL, XK_Control_L},
{Modifier::ALT, XK_Alt_L},
{Modifier::SUPER, XK_Super_L},
{Modifier::SHIFT, XK_Shift_L}
{Modifier::SHIFT, XK_Shift_L},
{Modifier::CAPSLOCK, XK_Caps_Lock}
};
QVector<QChar> shiftKeyVec = {'~', '!', '@', '#', '$', '%', '^', '&', '*',
@ -203,6 +204,9 @@ void X11Keyboard::sendKey(unsigned int keyCode)
KeyCode keyCode = XKeysymToKeycode(display, modifierMap[mod]);
XTestFakeKeyEvent(display, keyCode, False, 2);
}
//输入结束清除shift状态
isShift = false;
XFlush(display);
}

View File

@ -33,7 +33,8 @@ public:
CTRL,
SHIFT,
ALT,
SUPER
SUPER,
CAPSLOCK
};
Q_ENUM(MOD)

View File

@ -4,3 +4,4 @@ install(FILES ukui-screensaver.directory DESTINATION /usr/share/desktop-director
install(FILES ukui-screensavers.menu DESTINATION /etc/xdg/menus)
install(FILES ukui-screensaver-qt DESTINATION /etc/pam.d)
install(FILES screensaver-startup.sh DESTINATION /usr/bin)
install(FILES ukui-screensaver-dialog.desktop DESTINATION /usr/share/applications)

View File

@ -166,7 +166,7 @@
<description>Allow the session status message to be displayed when the screen is locked.</description>
</key>
<key name="background" type="s">
<default>'/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg'</default>
<default>'/usr/share/backgrounds/1-openkylin.jpg'</default>
<summary>the background iamge of lockscreen</summary>
<description>Allow the user to set the background iamge of lockscreen.</description>
</key>

View File

@ -0,0 +1,15 @@
[Desktop Entry]
Type=Application
Name=Lockscreen Dialog
Name[tr]=Ekran pencere
Name[zh_CN]=锁屏窗口程序
Name[zh_HK]=鎖屏窗口程式
Name[zh_TW]=鎖屏窗口程式
Comment[tr]=Ekran kilidini ve kurtarıcı göster
Comment[zh_CN]=展示屏幕锁定和保护程序
Comment[zh_TW]=展示屏幕鎖定和保護程式
Exec=/usr/bin/ukui-screensaver-dialog
NoDisplay=true
OnlyShowIn=UKUI
X-KDE-Wayland-Interfaces=org_kde_plasma_window_management,org_kde_kwin_keystate

View File

@ -17,3 +17,4 @@ X-UKUI-Bugzilla-Product=ukui-screensaver
X-UKUI-Bugzilla-Component=general
X-UKUI-Bugzilla-Version=1.0.0
OnlyShowIn=UKUI
X-UKUI-AutoRestart=true

View File

@ -4,111 +4,146 @@
<context>
<name>AuthDialog</name>
<message>
<location filename="../src/authdialog.cpp" line="656"/>
<location filename="../src/authdialog.cpp" line="912"/>
<source>Authentication failure, Please try again</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="248"/>
<location filename="../src/authdialog.cpp" line="249"/>
<location filename="../src/authdialog.cpp" line="316"/>
<location filename="../src/authdialog.cpp" line="317"/>
<location filename="../src/authdialog.cpp" line="326"/>
<location filename="../src/authdialog.cpp" line="327"/>
<location filename="../src/authdialog.cpp" line="396"/>
<location filename="../src/authdialog.cpp" line="397"/>
<source>Please try again in %1 minutes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="258"/>
<location filename="../src/authdialog.cpp" line="259"/>
<location filename="../src/authdialog.cpp" line="325"/>
<location filename="../src/authdialog.cpp" line="326"/>
<location filename="../src/authdialog.cpp" line="223"/>
<source>Enter the ukey password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="240"/>
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="336"/>
<location filename="../src/authdialog.cpp" line="337"/>
<location filename="../src/authdialog.cpp" line="405"/>
<location filename="../src/authdialog.cpp" line="406"/>
<source>Please try again in %1 seconds.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="268"/>
<location filename="../src/authdialog.cpp" line="269"/>
<location filename="../src/authdialog.cpp" line="334"/>
<location filename="../src/authdialog.cpp" line="335"/>
<location filename="../src/authdialog.cpp" line="346"/>
<location filename="../src/authdialog.cpp" line="347"/>
<location filename="../src/authdialog.cpp" line="414"/>
<location filename="../src/authdialog.cpp" line="415"/>
<source>Account locked permanently.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="455"/>
<location filename="../src/authdialog.cpp" line="566"/>
<source>Verify face recognition or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="460"/>
<location filename="../src/authdialog.cpp" line="571"/>
<source>Press fingerprint or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="465"/>
<location filename="../src/authdialog.cpp" line="576"/>
<source>Verify voiceprint or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="470"/>
<location filename="../src/authdialog.cpp" line="581"/>
<source>Verify finger vein or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="475"/>
<location filename="../src/authdialog.cpp" line="586"/>
<source>Verify iris or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="480"/>
<location filename="../src/authdialog.cpp" line="591"/>
<source>Use the bound wechat scanning code or enter the password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="533"/>
<location filename="../src/authdialog.cpp" line="534"/>
<location filename="../src/authdialog.cpp" line="649"/>
<location filename="../src/authdialog.cpp" line="650"/>
<source>Password cannot be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="617"/>
<location filename="../src/authdialog.cpp" line="871"/>
<source>Password </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="619"/>
<location filename="../src/authdialog.cpp" line="873"/>
<source>Input Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="682"/>
<location filename="../src/authdialog.cpp" line="940"/>
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="694"/>
<location filename="../src/authdialog.cpp" line="957"/>
<source>Retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="916"/>
<location filename="../src/authdialog.cpp" line="1260"/>
<source>Failed to verify %1, please enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="920"/>
<location filename="../src/authdialog.cpp" line="1264"/>
<location filename="../src/authdialog.cpp" line="1266"/>
<source>Unable to verify %1, please enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="926"/>
<location filename="../src/authdialog.cpp" line="1279"/>
<location filename="../src/authdialog.cpp" line="1283"/>
<source>Failed to verify %1, you still have %2 verification opportunities</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="937"/>
<location filename="../src/authdialog.cpp" line="1296"/>
<source>Abnormal network</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
<message>
<location filename="../src/batterywidget.cpp" line="163"/>
<source>Charging...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="165"/>
<source>fully charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="169"/>
<source>PowerMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="172"/>
<source>BatteryMode</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BiometricAuthWidget</name>
<message>
@ -145,6 +180,32 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsMoreWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charsmorewidget.cpp" line="166"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="97"/>
<source>More</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="111"/>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="124"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConfForm</name>
<message>
@ -279,6 +340,11 @@
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="71"/>
<source>ukey</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="73"/>
<source>QRCode</source>
<translation type="unfinished"></translation>
</message>
@ -1424,6 +1490,124 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EngineDevice</name>
<message>
<location filename="../src/enginedevice.cpp" line="101"/>
<source>yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="101"/>
<source>no</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="120"/>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="120"/>
<source>No</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="284"/>
<source>%1% available, charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="290"/>
<source>Left %1h %2m (%3%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="295"/>
<source>%1% available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="301"/>
<source>Left %1h %2m to full</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="303"/>
<source>charging (%1%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="309"/>
<source>%1 waiting to discharge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="314"/>
<source>%1 waiting to charge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="334"/>
<source>AC adapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="338"/>
<source>Laptop battery</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="342"/>
<source>UPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="346"/>
<source>Monitor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="350"/>
<source>Mouse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="354"/>
<source>Keyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="358"/>
<source>PDA</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="362"/>
<source>Cell phone</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="366"/>
<source>Media player</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="370"/>
<source>Tablet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="374"/>
<source>Computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="378"/>
<source>unrecognised</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1458,14 +1642,6 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KeyboardWidget</name>
<message>
<location filename="../VirtualKeyboard/src/keyboardwidget.ui" line="29"/>
<source>KeyboardWidget</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KylinNM</name>
<message>
@ -1541,7 +1717,7 @@
<location filename="../KylinNM/src/kylinnm.cpp" line="1535"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1701"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2426"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2517"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2518"/>
<source>Not connected</source>
<translation type="unfinished"></translation>
</message>
@ -1554,7 +1730,7 @@
<location filename="../KylinNM/src/kylinnm.cpp" line="1828"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1995"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2428"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2519"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2520"/>
<source>Disconnected</source>
<translation type="unfinished"></translation>
</message>
@ -1580,26 +1756,49 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2705"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2706"/>
<source>Conn Ethernet Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2717"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2718"/>
<source>Conn Ethernet Fail</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2742"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2743"/>
<source>Conn Wifi Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2751"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2752"/>
<source>Confirm your Wi-Fi password or usable of wireless card</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LettersWidget</name>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="138"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="152"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="166"/>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="194"/>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
<message>
@ -1618,17 +1817,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="523"/>
<location filename="../src/lockwidget.cpp" line="1135"/>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="727"/>
<location filename="../src/lockwidget.cpp" line="1445"/>
<source>LAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="729"/>
<location filename="../src/lockwidget.cpp" line="1447"/>
<source>WLAN</source>
<translation type="unfinished"></translation>
</message>
@ -1636,12 +1835,17 @@
<context>
<name>LoginOptionsWidget</name>
<message>
<location filename="../src/loginoptionswidget.cpp" line="57"/>
<location filename="../src/loginoptionswidget.cpp" line="73"/>
<source>Login Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="540"/>
<location filename="../src/loginoptionswidget.cpp" line="270"/>
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="664"/>
<source>Identify device removed!</source>
<translation type="unfinished"></translation>
</message>
@ -1656,6 +1860,19 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NumbersWidget</name>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="143"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="157"/>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OneConnForm</name>
<message>
@ -1821,38 +2038,38 @@
<context>
<name>PowerManager</name>
<message>
<location filename="../src/powermanager.cpp" line="307"/>
<location filename="../src/powermanager.cpp" line="316"/>
<source>Log Out</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="290"/>
<location filename="../src/powermanager.cpp" line="299"/>
<source>lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="325"/>
<location filename="../src/powermanager.cpp" line="648"/>
<source>Reboot</source>
<location filename="../src/powermanager.cpp" line="334"/>
<location filename="../src/powermanager.cpp" line="673"/>
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="345"/>
<location filename="../src/powermanager.cpp" line="354"/>
<source>Power Off</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="666"/>
<location filename="../src/powermanager.cpp" line="694"/>
<source>Shut Down</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="692"/>
<location filename="../src/powermanager.cpp" line="722"/>
<source>Hibernate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="719"/>
<location filename="../src/powermanager.cpp" line="751"/>
<source>Suspend</source>
<translation type="unfinished"></translation>
</message>
@ -1860,30 +2077,39 @@
<context>
<name>QObject</name>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="78"/>
<location filename="../src/ukui-screensaver-command.cpp" line="90"/>
<source>The screensaver is active.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="80"/>
<location filename="../src/ukui-screensaver-command.cpp" line="92"/>
<source>The screensaver is inactive.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>S:</name>
<message>
<location filename="../src/enginedevice.cpp" line="308"/>
<source></source>
<comment>tablet device</comment>
<translation></translation>
</message>
</context>
<context>
<name>Screensaver</name>
<message>
<location filename="../screensaver/screensaver.cpp" line="142"/>
<location filename="../screensaver/screensaver.cpp" line="145"/>
<source>Picture does not exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1199"/>
<location filename="../screensaver/screensaver.cpp" line="1205"/>
<source>View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1364"/>
<location filename="../screensaver/screensaver.cpp" line="1374"/>
<source>You have new notification</source>
<translation type="unfinished"></translation>
</message>
@ -1891,7 +2117,7 @@
<context>
<name>SleepTime</name>
<message>
<location filename="../screensaver/sleeptime.cpp" line="64"/>
<location filename="../screensaver/sleeptime.cpp" line="72"/>
<source>You have rested</source>
<translation type="unfinished"></translation>
</message>
@ -1919,22 +2145,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="40"/>
<location filename="../src/surewindow.cpp" line="47"/>
<source>The following program is running to prevent the system from reboot!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="43"/>
<location filename="../src/surewindow.cpp" line="50"/>
<source>The following program is running to prevent the system from shutting down!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="46"/>
<location filename="../src/surewindow.cpp" line="53"/>
<source>The following program is running to prevent the system from suspend!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="49"/>
<location filename="../src/surewindow.cpp" line="56"/>
<source>The following program is running to prevent the system from hibernate!</source>
<translation type="unfinished"></translation>
</message>
@ -1955,38 +2181,38 @@
<context>
<name>TabletLockWidget</name>
<message>
<location filename="../src/tabletlockwidget.cpp" line="180"/>
<location filename="../src/tabletlockwidget.cpp" line="200"/>
<location filename="../src/tabletlockwidget.cpp" line="219"/>
<location filename="../src/tabletlockwidget.cpp" line="234"/>
<location filename="../src/tabletlockwidget.cpp" line="373"/>
<location filename="../src/tabletlockwidget.cpp" line="388"/>
<location filename="../src/tabletlockwidget.cpp" line="189"/>
<location filename="../src/tabletlockwidget.cpp" line="209"/>
<location filename="../src/tabletlockwidget.cpp" line="228"/>
<location filename="../src/tabletlockwidget.cpp" line="243"/>
<location filename="../src/tabletlockwidget.cpp" line="382"/>
<location filename="../src/tabletlockwidget.cpp" line="397"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="186"/>
<location filename="../src/tabletlockwidget.cpp" line="398"/>
<location filename="../src/tabletlockwidget.cpp" line="195"/>
<location filename="../src/tabletlockwidget.cpp" line="407"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="239"/>
<location filename="../src/tabletlockwidget.cpp" line="248"/>
<source>Skip</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="266"/>
<location filename="../src/tabletlockwidget.cpp" line="275"/>
<source>New password is the same as old</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="277"/>
<location filename="../src/tabletlockwidget.cpp" line="286"/>
<source>Reset password error:%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="289"/>
<location filename="../src/tabletlockwidget.cpp" line="298"/>
<source>Please scan by correct WeChat</source>
<translation type="unfinished"></translation>
</message>
@ -2058,6 +2284,35 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Widget</name>
<message>
<location filename="../examples/LoadCustomPlugin/widget.ui" line="14"/>
<source>Widget</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../examples/LoadCustomPlugin/widget.ui" line="26"/>
<source>LoadPlugin</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>delay</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="179"/>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>has-lock</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="182"/>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
@ -2081,52 +2336,67 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="42"/>
<location filename="../src/ukui-screensaver-command.cpp" line="43"/>
<source>Start command for the ukui ScreenSaver.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="47"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="164"/>
<location filename="../src/ukui-screensaver-command.cpp" line="48"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="166"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="168"/>
<source>lock the screen immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="50"/>
<location filename="../src/ukui-screensaver-command.cpp" line="51"/>
<source>query the status of the screen saver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="53"/>
<location filename="../src/ukui-screensaver-command.cpp" line="54"/>
<source>unlock the screen saver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="55"/>
<location filename="../src/ukui-screensaver-command.cpp" line="56"/>
<source>show the screensaver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="159"/>
<location filename="../src/ukui-screensaver-command.cpp" line="58"/>
<source>show blank and delay to lock,param:idle/lid/lowpower</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="160"/>
<source>Dialog for the ukui ScreenSaver.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="168"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="170"/>
<source>activated by session idle signal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="170"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="174"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="172"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="176"/>
<source>lock the screen and show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="172"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="174"/>
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="178"/>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="181"/>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

File diff suppressed because it is too large Load Diff

View File

@ -107,6 +107,33 @@
<source>Abnormal network</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter the ukey password</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
<message>
<source>Charging...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fully charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>BatteryMode</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BioAuthWidget</name>
@ -203,6 +230,28 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsMoreWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsWidget</name>
<message>
<source>More</source>
<translation type="unfinished">Más</translation>
</message>
<message>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>123</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConfForm</name>
<message>
@ -312,6 +361,10 @@
<source>QRCode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ukey</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DigitalAuthDialog</name>
@ -1225,6 +1278,101 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EngineDevice</name>
<message>
<source>yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>no</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1% available, charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left %1h %2m (%3%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1% available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left %1h %2m to full</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>charging (%1%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 waiting to discharge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 waiting to charge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AC adapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Laptop battery</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>UPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Monitor</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mouse</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PDA</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cell phone</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Media player</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Tablet</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unrecognised</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1256,7 +1404,7 @@
<name>KeyboardWidget</name>
<message>
<source>KeyboardWidget</source>
<translation>TecladoWidget</translation>
<translation type="vanished">TecladoWidget</translation>
</message>
</context>
<context>
@ -1354,6 +1502,25 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LettersWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
<message>
@ -1397,7 +1564,7 @@
</message>
<message>
<source>Password</source>
<translation type="obsolete">Contraseña</translation>
<translation type="unfinished">Contraseña</translation>
</message>
<message>
<source>Identify device removed!</source>
@ -1411,6 +1578,17 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NumbersWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OneConnForm</name>
<message>
@ -1567,7 +1745,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Reboot</source>
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1582,6 +1760,14 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>S:</name>
<message>
<source></source>
<comment>tablet device</comment>
<translation></translation>
</message>
</context>
<context>
<name>Screensaver</name>
<message>
@ -1729,6 +1915,31 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Widget</name>
<message>
<source>Widget</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LoadPlugin</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>delay</name>
<message>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>has-lock</name>
<message>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
@ -1783,5 +1994,17 @@
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank and delay to lock,param:idle/lid/lowpower</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -107,6 +107,33 @@
<source>Abnormal network</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter the ukey password</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
<message>
<source>Charging...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fully charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>BatteryMode</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BioAuthWidget</name>
@ -203,6 +230,28 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsMoreWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsWidget</name>
<message>
<source>More</source>
<translation type="unfinished">Plus</translation>
</message>
<message>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>123</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConfForm</name>
<message>
@ -312,6 +361,10 @@
<source>QRCode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ukey</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DigitalAuthDialog</name>
@ -1225,6 +1278,101 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EngineDevice</name>
<message>
<source>yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>no</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1% available, charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left %1h %2m (%3%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1% available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left %1h %2m to full</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>charging (%1%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 waiting to discharge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 waiting to charge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AC adapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Laptop battery</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>UPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Monitor</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mouse</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PDA</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cell phone</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Media player</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Tablet</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unrecognised</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1256,7 +1404,7 @@
<name>KeyboardWidget</name>
<message>
<source>KeyboardWidget</source>
<translation>KeyboardWidget</translation>
<translation type="vanished">KeyboardWidget</translation>
</message>
</context>
<context>
@ -1354,6 +1502,25 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LettersWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
<message>
@ -1397,7 +1564,7 @@
</message>
<message>
<source>Password</source>
<translation type="obsolete">Mot de passe</translation>
<translation type="unfinished">Mot de passe</translation>
</message>
<message>
<source>Identify device removed!</source>
@ -1411,6 +1578,17 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NumbersWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OneConnForm</name>
<message>
@ -1567,7 +1745,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Reboot</source>
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1582,6 +1760,14 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>S:</name>
<message>
<source></source>
<comment>tablet device</comment>
<translation></translation>
</message>
</context>
<context>
<name>Screensaver</name>
<message>
@ -1729,6 +1915,31 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Widget</name>
<message>
<source>Widget</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LoadPlugin</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>delay</name>
<message>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>has-lock</name>
<message>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
@ -1783,5 +1994,17 @@
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank and delay to lock,param:idle/lid/lowpower</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -107,6 +107,33 @@
<source>Abnormal network</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter the ukey password</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
<message>
<source>Charging...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fully charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>BatteryMode</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BioAuthWidget</name>
@ -203,6 +230,28 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsMoreWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsWidget</name>
<message>
<source>More</source>
<translation type="unfinished">Mais</translation>
</message>
<message>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>123</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConfForm</name>
<message>
@ -312,6 +361,10 @@
<source>QRCode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ukey</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DigitalAuthDialog</name>
@ -1225,6 +1278,101 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EngineDevice</name>
<message>
<source>yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>no</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1% available, charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left %1h %2m (%3%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1% available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left %1h %2m to full</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>charging (%1%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 waiting to discharge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 waiting to charge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AC adapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Laptop battery</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>UPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Monitor</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mouse</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PDA</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cell phone</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Media player</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Tablet</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unrecognised</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1256,7 +1404,7 @@
<name>KeyboardWidget</name>
<message>
<source>KeyboardWidget</source>
<translation>KeyboardWidget</translation>
<translation type="vanished">KeyboardWidget</translation>
</message>
</context>
<context>
@ -1354,6 +1502,25 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LettersWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
<message>
@ -1397,7 +1564,7 @@
</message>
<message>
<source>Password</source>
<translation type="obsolete">Senha</translation>
<translation type="unfinished">Senha</translation>
</message>
<message>
<source>Identify device removed!</source>
@ -1411,6 +1578,17 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NumbersWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OneConnForm</name>
<message>
@ -1567,7 +1745,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Reboot</source>
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1582,6 +1760,14 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>S:</name>
<message>
<source></source>
<comment>tablet device</comment>
<translation></translation>
</message>
</context>
<context>
<name>Screensaver</name>
<message>
@ -1729,6 +1915,31 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Widget</name>
<message>
<source>Widget</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LoadPlugin</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>delay</name>
<message>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>has-lock</name>
<message>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
@ -1783,5 +1994,17 @@
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank and delay to lock,param:idle/lid/lowpower</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -107,6 +107,33 @@
<source>Abnormal network</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter the ukey password</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
<message>
<source>Charging...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fully charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>BatteryMode</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BioAuthWidget</name>
@ -203,6 +230,28 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsMoreWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsWidget</name>
<message>
<source>More</source>
<translation type="unfinished">Больше</translation>
</message>
<message>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>123</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConfForm</name>
<message>
@ -312,6 +361,10 @@
<source>QRCode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ukey</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DigitalAuthDialog</name>
@ -1225,6 +1278,101 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EngineDevice</name>
<message>
<source>yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>no</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1% available, charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left %1h %2m (%3%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1% available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Left %1h %2m to full</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>charging (%1%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 waiting to discharge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 waiting to charge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AC adapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Laptop battery</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>UPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Monitor</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mouse</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PDA</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cell phone</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Media player</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Tablet</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unrecognised</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1256,7 +1404,7 @@
<name>KeyboardWidget</name>
<message>
<source>KeyboardWidget</source>
<translation>KeyboardWidget</translation>
<translation type="vanished">KeyboardWidget</translation>
</message>
</context>
<context>
@ -1354,6 +1502,25 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LettersWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
<message>
@ -1397,7 +1564,7 @@
</message>
<message>
<source>Password</source>
<translation type="obsolete">пароль</translation>
<translation type="unfinished">пароль</translation>
</message>
<message>
<source>Identify device removed!</source>
@ -1411,6 +1578,17 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NumbersWidget</name>
<message>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OneConnForm</name>
<message>
@ -1567,7 +1745,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Reboot</source>
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1582,6 +1760,14 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>S:</name>
<message>
<source></source>
<comment>tablet device</comment>
<translation></translation>
</message>
</context>
<context>
<name>Screensaver</name>
<message>
@ -1729,6 +1915,31 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Widget</name>
<message>
<source>Widget</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>LoadPlugin</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>delay</name>
<message>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>has-lock</name>
<message>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
@ -1783,5 +1994,17 @@
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank and delay to lock,param:idle/lid/lowpower</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -16,7 +16,7 @@
<translation type="obsolete">Parola</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="694"/>
<location filename="../src/authdialog.cpp" line="957"/>
<source>Retry</source>
<translation type="unfinished">Yeniden Dene</translation>
</message>
@ -41,102 +41,114 @@
<translation type="vanished">Kimlik doğrulama hatası, hala %1 kalan denemen var</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="656"/>
<location filename="../src/authdialog.cpp" line="912"/>
<source>Authentication failure, Please try again</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="248"/>
<location filename="../src/authdialog.cpp" line="249"/>
<location filename="../src/authdialog.cpp" line="316"/>
<location filename="../src/authdialog.cpp" line="317"/>
<location filename="../src/authdialog.cpp" line="326"/>
<location filename="../src/authdialog.cpp" line="327"/>
<location filename="../src/authdialog.cpp" line="396"/>
<location filename="../src/authdialog.cpp" line="397"/>
<source>Please try again in %1 minutes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="258"/>
<location filename="../src/authdialog.cpp" line="259"/>
<location filename="../src/authdialog.cpp" line="325"/>
<location filename="../src/authdialog.cpp" line="326"/>
<location filename="../src/authdialog.cpp" line="223"/>
<source>Enter the ukey password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="240"/>
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="336"/>
<location filename="../src/authdialog.cpp" line="337"/>
<location filename="../src/authdialog.cpp" line="405"/>
<location filename="../src/authdialog.cpp" line="406"/>
<source>Please try again in %1 seconds.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="268"/>
<location filename="../src/authdialog.cpp" line="269"/>
<location filename="../src/authdialog.cpp" line="334"/>
<location filename="../src/authdialog.cpp" line="335"/>
<location filename="../src/authdialog.cpp" line="346"/>
<location filename="../src/authdialog.cpp" line="347"/>
<location filename="../src/authdialog.cpp" line="414"/>
<location filename="../src/authdialog.cpp" line="415"/>
<source>Account locked permanently.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="455"/>
<location filename="../src/authdialog.cpp" line="566"/>
<source>Verify face recognition or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="460"/>
<location filename="../src/authdialog.cpp" line="571"/>
<source>Press fingerprint or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="465"/>
<location filename="../src/authdialog.cpp" line="576"/>
<source>Verify voiceprint or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="470"/>
<location filename="../src/authdialog.cpp" line="581"/>
<source>Verify finger vein or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="475"/>
<location filename="../src/authdialog.cpp" line="586"/>
<source>Verify iris or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="480"/>
<location filename="../src/authdialog.cpp" line="591"/>
<source>Use the bound wechat scanning code or enter the password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="533"/>
<location filename="../src/authdialog.cpp" line="534"/>
<location filename="../src/authdialog.cpp" line="649"/>
<location filename="../src/authdialog.cpp" line="650"/>
<source>Password cannot be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="617"/>
<location filename="../src/authdialog.cpp" line="871"/>
<source>Password </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="619"/>
<location filename="../src/authdialog.cpp" line="873"/>
<source>Input Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="682"/>
<location filename="../src/authdialog.cpp" line="940"/>
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="916"/>
<location filename="../src/authdialog.cpp" line="1260"/>
<source>Failed to verify %1, please enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="920"/>
<location filename="../src/authdialog.cpp" line="1264"/>
<location filename="../src/authdialog.cpp" line="1266"/>
<source>Unable to verify %1, please enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="926"/>
<location filename="../src/authdialog.cpp" line="1279"/>
<location filename="../src/authdialog.cpp" line="1283"/>
<source>Failed to verify %1, you still have %2 verification opportunities</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="937"/>
<location filename="../src/authdialog.cpp" line="1296"/>
<source>Abnormal network</source>
<translation type="unfinished"></translation>
</message>
@ -153,6 +165,29 @@
<translation type="obsolete">Diğer Ayıtlar</translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
<message>
<location filename="../src/batterywidget.cpp" line="163"/>
<source>Charging...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="165"/>
<source>fully charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="169"/>
<source>PowerMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="172"/>
<source>BatteryMode</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BioDevices</name>
<message>
@ -227,6 +262,32 @@
<translation type="unfinished">Tamam</translation>
</message>
</context>
<context>
<name>CharsMoreWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charsmorewidget.cpp" line="166"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="97"/>
<source>More</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="111"/>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="124"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConfForm</name>
<message>
@ -361,6 +422,11 @@
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="71"/>
<source>ukey</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="73"/>
<source>QRCode</source>
<translation type="unfinished"></translation>
</message>
@ -1506,6 +1572,124 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EngineDevice</name>
<message>
<location filename="../src/enginedevice.cpp" line="101"/>
<source>yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="101"/>
<source>no</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="120"/>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="120"/>
<source>No</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="284"/>
<source>%1% available, charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="290"/>
<source>Left %1h %2m (%3%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="295"/>
<source>%1% available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="301"/>
<source>Left %1h %2m to full</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="303"/>
<source>charging (%1%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="309"/>
<source>%1 waiting to discharge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="314"/>
<source>%1 waiting to charge (%2%)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="334"/>
<source>AC adapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="338"/>
<source>Laptop battery</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="342"/>
<source>UPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="346"/>
<source>Monitor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="350"/>
<source>Mouse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="354"/>
<source>Keyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="358"/>
<source>PDA</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="362"/>
<source>Cell phone</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="366"/>
<source>Media player</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="370"/>
<source>Tablet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="374"/>
<source>Computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/enginedevice.cpp" line="378"/>
<source>unrecognised</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1540,14 +1724,6 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KeyboardWidget</name>
<message>
<location filename="../VirtualKeyboard/src/keyboardwidget.ui" line="29"/>
<source>KeyboardWidget</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KylinNM</name>
<message>
@ -1623,7 +1799,7 @@
<location filename="../KylinNM/src/kylinnm.cpp" line="1535"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1701"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2426"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2517"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2518"/>
<source>Not connected</source>
<translation type="unfinished"></translation>
</message>
@ -1636,7 +1812,7 @@
<location filename="../KylinNM/src/kylinnm.cpp" line="1828"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1995"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2428"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2519"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2520"/>
<source>Disconnected</source>
<translation type="unfinished"></translation>
</message>
@ -1662,26 +1838,49 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2705"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2706"/>
<source>Conn Ethernet Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2717"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2718"/>
<source>Conn Ethernet Fail</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2742"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2743"/>
<source>Conn Wifi Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2751"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2752"/>
<source>Confirm your Wi-Fi password or usable of wireless card</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LettersWidget</name>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="138"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="152"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="166"/>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="194"/>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
<message>
@ -1708,17 +1907,17 @@
<translation type="vanished">Kullanıcı Değiştir</translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="523"/>
<location filename="../src/lockwidget.cpp" line="1135"/>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="727"/>
<location filename="../src/lockwidget.cpp" line="1445"/>
<source>LAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="729"/>
<location filename="../src/lockwidget.cpp" line="1447"/>
<source>WLAN</source>
<translation type="unfinished"></translation>
</message>
@ -1726,16 +1925,17 @@
<context>
<name>LoginOptionsWidget</name>
<message>
<location filename="../src/loginoptionswidget.cpp" line="57"/>
<location filename="../src/loginoptionswidget.cpp" line="73"/>
<source>Login Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="270"/>
<source>Password</source>
<translation type="obsolete">Parola</translation>
<translation type="unfinished">Parola</translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="540"/>
<location filename="../src/loginoptionswidget.cpp" line="664"/>
<source>Identify device removed!</source>
<translation type="unfinished"></translation>
</message>
@ -1750,6 +1950,19 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NumbersWidget</name>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="143"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="157"/>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OneConnForm</name>
<message>
@ -1915,7 +2128,7 @@
<context>
<name>PowerManager</name>
<message>
<location filename="../src/powermanager.cpp" line="290"/>
<location filename="../src/powermanager.cpp" line="299"/>
<source>lock</source>
<translation>kilit</translation>
</message>
@ -1944,37 +2157,33 @@
<translation type="obsolete">Kullanıcı Değiştir</translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="307"/>
<location filename="../src/powermanager.cpp" line="316"/>
<source>Log Out</source>
<translation type="unfinished">Çıkış</translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="334"/>
<location filename="../src/powermanager.cpp" line="673"/>
<source>Restart</source>
<translation type="obsolete">Yeniden Başlat</translation>
<translation type="unfinished">Yeniden Başlat</translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="325"/>
<location filename="../src/powermanager.cpp" line="648"/>
<source>Reboot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="345"/>
<location filename="../src/powermanager.cpp" line="354"/>
<source>Power Off</source>
<translation type="unfinished">Bilgisayarı Kapat</translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="666"/>
<location filename="../src/powermanager.cpp" line="694"/>
<source>Shut Down</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="692"/>
<location filename="../src/powermanager.cpp" line="722"/>
<source>Hibernate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="719"/>
<location filename="../src/powermanager.cpp" line="751"/>
<source>Suspend</source>
<translation type="unfinished"></translation>
</message>
@ -1982,16 +2191,25 @@
<context>
<name>QObject</name>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="78"/>
<location filename="../src/ukui-screensaver-command.cpp" line="90"/>
<source>The screensaver is active.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="80"/>
<location filename="../src/ukui-screensaver-command.cpp" line="92"/>
<source>The screensaver is inactive.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>S:</name>
<message>
<location filename="../src/enginedevice.cpp" line="308"/>
<source></source>
<comment>tablet device</comment>
<translation></translation>
</message>
</context>
<context>
<name>Screensaver</name>
<message>
@ -2003,17 +2221,17 @@
<translation type="obsolete">çıkış</translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="142"/>
<location filename="../screensaver/screensaver.cpp" line="145"/>
<source>Picture does not exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1199"/>
<location filename="../screensaver/screensaver.cpp" line="1205"/>
<source>View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1364"/>
<location filename="../screensaver/screensaver.cpp" line="1374"/>
<source>You have new notification</source>
<translation type="unfinished"></translation>
</message>
@ -2029,7 +2247,7 @@
<context>
<name>SleepTime</name>
<message>
<location filename="../screensaver/sleeptime.cpp" line="64"/>
<location filename="../screensaver/sleeptime.cpp" line="72"/>
<source>You have rested</source>
<translation type="unfinished"></translation>
</message>
@ -2057,22 +2275,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="40"/>
<location filename="../src/surewindow.cpp" line="47"/>
<source>The following program is running to prevent the system from reboot!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="43"/>
<location filename="../src/surewindow.cpp" line="50"/>
<source>The following program is running to prevent the system from shutting down!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="46"/>
<location filename="../src/surewindow.cpp" line="53"/>
<source>The following program is running to prevent the system from suspend!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="49"/>
<location filename="../src/surewindow.cpp" line="56"/>
<source>The following program is running to prevent the system from hibernate!</source>
<translation type="unfinished"></translation>
</message>
@ -2093,38 +2311,38 @@
<context>
<name>TabletLockWidget</name>
<message>
<location filename="../src/tabletlockwidget.cpp" line="180"/>
<location filename="../src/tabletlockwidget.cpp" line="200"/>
<location filename="../src/tabletlockwidget.cpp" line="219"/>
<location filename="../src/tabletlockwidget.cpp" line="234"/>
<location filename="../src/tabletlockwidget.cpp" line="373"/>
<location filename="../src/tabletlockwidget.cpp" line="388"/>
<location filename="../src/tabletlockwidget.cpp" line="189"/>
<location filename="../src/tabletlockwidget.cpp" line="209"/>
<location filename="../src/tabletlockwidget.cpp" line="228"/>
<location filename="../src/tabletlockwidget.cpp" line="243"/>
<location filename="../src/tabletlockwidget.cpp" line="382"/>
<location filename="../src/tabletlockwidget.cpp" line="397"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="186"/>
<location filename="../src/tabletlockwidget.cpp" line="398"/>
<location filename="../src/tabletlockwidget.cpp" line="195"/>
<location filename="../src/tabletlockwidget.cpp" line="407"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="239"/>
<location filename="../src/tabletlockwidget.cpp" line="248"/>
<source>Skip</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="266"/>
<location filename="../src/tabletlockwidget.cpp" line="275"/>
<source>New password is the same as old</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="277"/>
<location filename="../src/tabletlockwidget.cpp" line="286"/>
<source>Reset password error:%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="289"/>
<location filename="../src/tabletlockwidget.cpp" line="298"/>
<source>Please scan by correct WeChat</source>
<translation type="unfinished"></translation>
</message>
@ -2196,56 +2414,100 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Widget</name>
<message>
<location filename="../examples/LoadCustomPlugin/widget.ui" line="14"/>
<source>Widget</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../examples/LoadCustomPlugin/widget.ui" line="26"/>
<source>LoadPlugin</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>delay</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="179"/>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>has-lock</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="182"/>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="42"/>
<location filename="../src/ukui-screensaver-command.cpp" line="43"/>
<source>Start command for the ukui ScreenSaver.</source>
<translation type="unfinished">Ukui Ekran Koruyucu için başlatma komutu.</translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="47"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="164"/>
<location filename="../src/ukui-screensaver-command.cpp" line="48"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="166"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="168"/>
<source>lock the screen immediately</source>
<translation type="unfinished">Ekranı hemen kilitle</translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="50"/>
<location filename="../src/ukui-screensaver-command.cpp" line="51"/>
<source>query the status of the screen saver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="53"/>
<location filename="../src/ukui-screensaver-command.cpp" line="54"/>
<source>unlock the screen saver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="55"/>
<location filename="../src/ukui-screensaver-command.cpp" line="56"/>
<source>show the screensaver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="159"/>
<location filename="../src/ukui-screensaver-command.cpp" line="58"/>
<source>show blank and delay to lock,param:idle/lid/lowpower</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="160"/>
<source>Dialog for the ukui ScreenSaver.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="168"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="170"/>
<source>activated by session idle signal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="170"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="174"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="172"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="176"/>
<source>lock the screen and show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="172"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="174"/>
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="178"/>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="181"/>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="65"/>
<source>Screensaver for ukui-screensaver</source>

View File

@ -16,7 +16,7 @@
<translation type="obsolete">使</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="696"/>
<location filename="../src/authdialog.cpp" line="957"/>
<source>Retry</source>
<translation></translation>
</message>
@ -45,71 +45,72 @@
<translation type="vanished">%1%2</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="248"/>
<location filename="../src/authdialog.cpp" line="249"/>
<location filename="../src/authdialog.cpp" line="316"/>
<location filename="../src/authdialog.cpp" line="317"/>
<location filename="../src/authdialog.cpp" line="326"/>
<location filename="../src/authdialog.cpp" line="327"/>
<location filename="../src/authdialog.cpp" line="396"/>
<location filename="../src/authdialog.cpp" line="397"/>
<source>Please try again in %1 minutes.</source>
<translation>%1</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="258"/>
<location filename="../src/authdialog.cpp" line="259"/>
<location filename="../src/authdialog.cpp" line="325"/>
<location filename="../src/authdialog.cpp" line="326"/>
<location filename="../src/authdialog.cpp" line="336"/>
<location filename="../src/authdialog.cpp" line="337"/>
<location filename="../src/authdialog.cpp" line="405"/>
<location filename="../src/authdialog.cpp" line="406"/>
<source>Please try again in %1 seconds.</source>
<translation>%1</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="268"/>
<location filename="../src/authdialog.cpp" line="269"/>
<location filename="../src/authdialog.cpp" line="334"/>
<location filename="../src/authdialog.cpp" line="335"/>
<location filename="../src/authdialog.cpp" line="346"/>
<location filename="../src/authdialog.cpp" line="347"/>
<location filename="../src/authdialog.cpp" line="414"/>
<location filename="../src/authdialog.cpp" line="415"/>
<source>Account locked permanently.</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="455"/>
<location filename="../src/authdialog.cpp" line="566"/>
<source>Verify face recognition or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="460"/>
<location filename="../src/authdialog.cpp" line="571"/>
<source>Press fingerprint or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="465"/>
<location filename="../src/authdialog.cpp" line="576"/>
<source>Verify voiceprint or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="470"/>
<location filename="../src/authdialog.cpp" line="581"/>
<source>Verify finger vein or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="475"/>
<location filename="../src/authdialog.cpp" line="586"/>
<source>Verify iris or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="619"/>
<location filename="../src/authdialog.cpp" line="873"/>
<source>Input Password</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="916"/>
<location filename="../src/authdialog.cpp" line="1260"/>
<source>Failed to verify %1, please enter password to unlock</source>
<translation>%1</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="920"/>
<location filename="../src/authdialog.cpp" line="1264"/>
<location filename="../src/authdialog.cpp" line="1266"/>
<source>Unable to verify %1, please enter password to unlock</source>
<translation>%1</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="937"/>
<location filename="../src/authdialog.cpp" line="1296"/>
<source>Abnormal network</source>
<translation></translation>
</message>
@ -118,8 +119,8 @@
<translation type="vanished">使</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="533"/>
<location filename="../src/authdialog.cpp" line="534"/>
<location filename="../src/authdialog.cpp" line="649"/>
<location filename="../src/authdialog.cpp" line="650"/>
<source>Password cannot be empty</source>
<translation></translation>
</message>
@ -132,7 +133,8 @@
<translation type="vanished">%1.</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="926"/>
<location filename="../src/authdialog.cpp" line="1279"/>
<location filename="../src/authdialog.cpp" line="1283"/>
<source>Failed to verify %1, you still have %2 verification opportunities</source>
<translation>%1%2</translation>
</message>
@ -161,22 +163,32 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="656"/>
<location filename="../src/authdialog.cpp" line="912"/>
<source>Authentication failure, Please try again</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="480"/>
<location filename="../src/authdialog.cpp" line="591"/>
<source>Use the bound wechat scanning code or enter the password to unlock</source>
<translation>使</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="617"/>
<location filename="../src/authdialog.cpp" line="223"/>
<source>Enter the ukey password</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="240"/>
<source>Insert the ukey into the USB port</source>
<translation>USB端口</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="871"/>
<source>Password </source>
<translation> </translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="682"/>
<location filename="../src/authdialog.cpp" line="940"/>
<source>Login</source>
<translation></translation>
</message>
@ -204,24 +216,22 @@
<context>
<name>BatteryWidget</name>
<message>
<location filename="../src/batterywidget.cpp" line="71"/>
<location filename="../src/batterywidget.cpp" line="139"/>
<location filename="../src/batterywidget.cpp" line="172"/>
<source>BatteryMode</source>
<translation></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="71"/>
<location filename="../src/batterywidget.cpp" line="136"/>
<location filename="../src/batterywidget.cpp" line="169"/>
<source>PowerMode</source>
<translation></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="129"/>
<location filename="../src/batterywidget.cpp" line="163"/>
<source>Charging...</source>
<translation>...</translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="131"/>
<location filename="../src/batterywidget.cpp" line="165"/>
<source>fully charged</source>
<translation></translation>
</message>
@ -300,6 +310,44 @@
<translation></translation>
</message>
</context>
<context>
<name>CharsMoreWidget</name>
<message>
<source>Return</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charsmorewidget.cpp" line="166"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharsWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="97"/>
<source>More</source>
<translation></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="111"/>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="124"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Return</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Number</source>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>ConfForm</name>
<message>
@ -446,6 +494,11 @@
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="71"/>
<source>ukey</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="73"/>
<source>QRCode</source>
<translation></translation>
</message>
@ -1783,14 +1836,6 @@
<translation></translation>
</message>
</context>
<context>
<name>KeyboardWidget</name>
<message>
<location filename="../VirtualKeyboard/src/keyboardwidget.ui" line="29"/>
<source>KeyboardWidget</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KylinDBus</name>
<message>
@ -1916,7 +1961,7 @@
<location filename="../KylinNM/src/kylinnm.cpp" line="1535"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1701"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2426"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2517"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2518"/>
<source>Not connected</source>
<translation></translation>
</message>
@ -1929,7 +1974,7 @@
<location filename="../KylinNM/src/kylinnm.cpp" line="1828"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1995"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2428"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2519"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2520"/>
<source>Disconnected</source>
<translation></translation>
</message>
@ -1965,7 +2010,7 @@
<translation type="obsolete">线</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2751"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2752"/>
<source>Confirm your Wi-Fi password or usable of wireless card</source>
<translation type="unfinished">Wi-Fi密码或无线设备</translation>
</message>
@ -2021,21 +2066,52 @@
<translation type="vanished"> Wi-Fi列表</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2705"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2706"/>
<source>Conn Ethernet Success</source>
<translation>线</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2717"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2718"/>
<source>Conn Ethernet Fail</source>
<translation>线</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2742"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2743"/>
<source>Conn Wifi Success</source>
<translation>线</translation>
</message>
</context>
<context>
<name>LettersWidget</name>
<message>
<source>Symbol</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Num</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="138"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="152"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="166"/>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="194"/>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
<message>
@ -2062,17 +2138,17 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="523"/>
<location filename="../src/lockwidget.cpp" line="1135"/>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
<translation>退</translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="727"/>
<location filename="../src/lockwidget.cpp" line="1445"/>
<source>LAN</source>
<translation type="unfinished">线</translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="729"/>
<location filename="../src/lockwidget.cpp" line="1447"/>
<source>WLAN</source>
<translation type="unfinished">线</translation>
</message>
@ -2080,20 +2156,21 @@
<context>
<name>LoginOptionsWidget</name>
<message>
<location filename="../src/loginoptionswidget.cpp" line="57"/>
<location filename="../src/loginoptionswidget.cpp" line="73"/>
<source>Login Options</source>
<translation></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="270"/>
<source>Password</source>
<translation type="vanished"></translation>
<translation></translation>
</message>
<message>
<source>Wechat</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="540"/>
<location filename="../src/loginoptionswidget.cpp" line="664"/>
<source>Identify device removed!</source>
<translation>!</translation>
</message>
@ -2108,6 +2185,23 @@
<translation></translation>
</message>
</context>
<context>
<name>NumbersWidget</name>
<message>
<source>Symbol</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="143"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="157"/>
<source>Return</source>
<translation></translation>
</message>
</context>
<context>
<name>OneConnForm</name>
<message>
@ -2301,7 +2395,7 @@
<context>
<name>PowerManager</name>
<message>
<location filename="../src/powermanager.cpp" line="290"/>
<location filename="../src/powermanager.cpp" line="299"/>
<source>lock</source>
<translation></translation>
</message>
@ -2330,37 +2424,37 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="307"/>
<location filename="../src/powermanager.cpp" line="316"/>
<source>Log Out</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="325"/>
<location filename="../src/powermanager.cpp" line="334"/>
<location filename="../src/powermanager.cpp" line="673"/>
<source>Restart</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="325"/>
<source>Reboot</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="345"/>
<location filename="../src/powermanager.cpp" line="354"/>
<source>Power Off</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="666"/>
<location filename="../src/powermanager.cpp" line="694"/>
<source>Shut Down</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="692"/>
<location filename="../src/powermanager.cpp" line="722"/>
<source>Hibernate</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="719"/>
<location filename="../src/powermanager.cpp" line="751"/>
<source>Suspend</source>
<translation></translation>
</message>
@ -2372,12 +2466,12 @@
<context>
<name>QObject</name>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="78"/>
<location filename="../src/ukui-screensaver-command.cpp" line="90"/>
<source>The screensaver is active.</source>
<translation></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="80"/>
<location filename="../src/ukui-screensaver-command.cpp" line="92"/>
<source>The screensaver is inactive.</source>
<translation></translation>
</message>
@ -2387,7 +2481,7 @@
<message>
<location filename="../src/enginedevice.cpp" line="308"/>
<source></source>
<comment>this is only shown for laptops with multiple batteries</comment>
<comment>tablet device</comment>
<translation></translation>
</message>
</context>
@ -2402,7 +2496,7 @@
<translation type="vanished">退</translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="142"/>
<location filename="../screensaver/screensaver.cpp" line="145"/>
<source>Picture does not exist</source>
<translation></translation>
</message>
@ -2419,12 +2513,12 @@
<translation type="obsolete">%1</translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1364"/>
<location filename="../screensaver/screensaver.cpp" line="1374"/>
<source>You have new notification</source>
<translation></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1199"/>
<location filename="../screensaver/screensaver.cpp" line="1205"/>
<source>View</source>
<translation></translation>
</message>
@ -2436,7 +2530,7 @@
<translation type="vanished">:</translation>
</message>
<message>
<location filename="../screensaver/sleeptime.cpp" line="64"/>
<location filename="../screensaver/sleeptime.cpp" line="72"/>
<source>You have rested</source>
<translation></translation>
</message>
@ -2468,22 +2562,22 @@
<translation type="vanished">退</translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="46"/>
<location filename="../src/surewindow.cpp" line="53"/>
<source>The following program is running to prevent the system from suspend!</source>
<translation></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="49"/>
<location filename="../src/surewindow.cpp" line="56"/>
<source>The following program is running to prevent the system from hibernate!</source>
<translation></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="43"/>
<location filename="../src/surewindow.cpp" line="50"/>
<source>The following program is running to prevent the system from shutting down!</source>
<translation></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="40"/>
<location filename="../src/surewindow.cpp" line="47"/>
<source>The following program is running to prevent the system from reboot!</source>
<translation></translation>
</message>
@ -2523,38 +2617,38 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="266"/>
<location filename="../src/tabletlockwidget.cpp" line="275"/>
<source>New password is the same as old</source>
<translation></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="277"/>
<location filename="../src/tabletlockwidget.cpp" line="286"/>
<source>Reset password error:%1</source>
<translation>:%1</translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="289"/>
<location filename="../src/tabletlockwidget.cpp" line="298"/>
<source>Please scan by correct WeChat</source>
<translation>使</translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="180"/>
<location filename="../src/tabletlockwidget.cpp" line="200"/>
<location filename="../src/tabletlockwidget.cpp" line="219"/>
<location filename="../src/tabletlockwidget.cpp" line="234"/>
<location filename="../src/tabletlockwidget.cpp" line="373"/>
<location filename="../src/tabletlockwidget.cpp" line="388"/>
<location filename="../src/tabletlockwidget.cpp" line="189"/>
<location filename="../src/tabletlockwidget.cpp" line="209"/>
<location filename="../src/tabletlockwidget.cpp" line="228"/>
<location filename="../src/tabletlockwidget.cpp" line="243"/>
<location filename="../src/tabletlockwidget.cpp" line="382"/>
<location filename="../src/tabletlockwidget.cpp" line="397"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="186"/>
<location filename="../src/tabletlockwidget.cpp" line="398"/>
<location filename="../src/tabletlockwidget.cpp" line="195"/>
<location filename="../src/tabletlockwidget.cpp" line="407"/>
<source>Back</source>
<translation></translation>
</message>
<message>
<location filename="../src/tabletlockwidget.cpp" line="239"/>
<location filename="../src/tabletlockwidget.cpp" line="248"/>
<source>Skip</source>
<translation></translation>
</message>
@ -2630,56 +2724,100 @@
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>Widget</name>
<message>
<location filename="../examples/LoadCustomPlugin/widget.ui" line="14"/>
<source>Widget</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../examples/LoadCustomPlugin/widget.ui" line="26"/>
<source>LoadPlugin</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>delay</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="179"/>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>has-lock</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="182"/>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="42"/>
<location filename="../src/ukui-screensaver-command.cpp" line="43"/>
<source>Start command for the ukui ScreenSaver.</source>
<translation></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="47"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="164"/>
<location filename="../src/ukui-screensaver-command.cpp" line="48"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="166"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="168"/>
<source>lock the screen immediately</source>
<translation></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="50"/>
<location filename="../src/ukui-screensaver-command.cpp" line="51"/>
<source>query the status of the screen saver</source>
<translation></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="53"/>
<location filename="../src/ukui-screensaver-command.cpp" line="54"/>
<source>unlock the screen saver</source>
<translation></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="55"/>
<location filename="../src/ukui-screensaver-command.cpp" line="56"/>
<source>show the screensaver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="159"/>
<location filename="../src/ukui-screensaver-command.cpp" line="58"/>
<source>show blank and delay to lock,param:idle/lid/lowpower</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="160"/>
<source>Dialog for the ukui ScreenSaver.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="168"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="170"/>
<source>activated by session idle signal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="170"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="174"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="172"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="176"/>
<source>lock the screen and show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="172"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="174"/>
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="178"/>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="181"/>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="65"/>
<source>Screensaver for ukui-screensaver</source>

View File

@ -1,6 +1,7 @@
pkg_check_modules(X11 REQUIRED x11)
pkg_check_modules(XTST REQUIRED xtst)
pkg_check_modules(QGS REQUIRED gsettings-qt)
pkg_check_modules(KDKINFO REQUIRED kysdk-sysinfo)
include_directories(${PROJECT_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR}/Common)
@ -9,14 +10,20 @@ include_directories(
${X11_INCLUDE_DIRS}
${XTST_INCLUDE_DIRS}
${QGS_INCLUDE_DIRS}
${KDKINFO_INCLUDE_DIRS}
)
link_directories(
${KDKINFO_LIBRARY_DIRS}
)
set(EXTRA_LIBS
${EXTRA_LIBS}
${X11_LIBRARIES}
${XTST_LIBRARIES}
${QGS_LIBRARIES}
Common
${QGS_LIBRARIES}
${KDKINFO_LIBRARIES}
Common
)
qt5_add_resources(screensaver_SRC
default.qrc

View File

@ -1,13 +1,10 @@
QLabel#dateOfWeek {
font-size:16px;
color: #ffffff;
}
QLabel#dateOfLocaltime {
font-size:50px;
color: #ffffff;
}
QLabel#dateOfDay {
font-size:16px;
color: #ffffff;
}
QLabel#dateOfLunar {
@ -17,28 +14,22 @@ QLabel#dateOfLunar {
QLabel#clockTime {
background:rgba(255,255,255,0.15);
border-radius: 6px;
font-size:20px;
color: #ffffff;
}
QLabel#colon {
font-size:20px;
color: #ffffff;
}
QLabel#restTime {
font-size:20px;
color: #ffffff;
opacity:0.6;
}
QLabel#centerLabel {
font-size:36px;
color: #ffffff;
}
QLabel#authorLabel {
font-size:28px;
color: #ffffff;
}
QLabel#myText{
font-size:24px;
border-radius: 6px;
background: rgba(255, 255, 255, 82%);
padding: 24px 24px 24px 24px;

View File

@ -1,168 +1,121 @@
[1]
OL=天生我材必有用,千金散尽还复来。
author=李白《将进酒》
FL=世上的事,只要肯用心去学,
SL=没有一件是太晚的。
author=三毛《送你一匹马》
[2]
OL=新时代的伟大成就是党和人民一道拼出来、干出来、奋斗出来的
author=习近平
OL=如果你是大河,何必在乎别人把你当成小溪
author=汪国真 《如果》
[3]
OL=莫愁前路无知己,天下谁人不识君
author=高适《别董大二首
OL=世界上有不绝的风景,我有不老的心情
author=汪国真《我喜欢出发
[4]
OL=莫听穿林打叶声,何妨吟啸且徐行
author=苏轼《定风波
OL=人生如逆旅,我亦是行人
author=苏轼《临江仙·送钱穆父
[5]
OL=党用伟大奋斗创造了百年伟业,也一定能用新的伟大奋斗创造新的伟业
author=习近平
OL=行乐直须年少,尊前看取衰翁
author=欧阳修《朝中措·送刘仲原甫出守维扬》
[6]
OL=巧言令色,鲜矣仁!
author=《论语
OL=行到水穷处,坐看云起时。
author=王维《终南别业
[7]
FL=与君初相识,犹如故人归。
SL=天涯明月新,朝暮最相思。
author=杜牧《会友》
[8]
FL=一个饱经沧桑而初心不变的党,才能基业常青;
SL=一个铸就辉煌仍勇于自我革命的党,才能无坚不摧。
author=习近平
[9]
OL=见贤思齐焉,见不贤而内自省也。
author=《论语》
[10]
OL=为政以德,譬如北辰,居其所而众星共之。
author=《论语》
[11]
FL=道阻且长,行则将至。前进道路上,无论是风高浪急还是惊涛骇浪,
SL=人民永远是我们最坚实的依托、最强大的底气。
author=习近平
[12]
OL=知彼知己,百战不殆。
author=《孙子兵法》
[13]
OL=人患不知其过,既知之,不能改,是无勇也。
author=韩愈《五箴》
[14]
FL=新征程是充满光荣和梦想的远征。蓝图已经绘就,号角已经吹响。
SL=我们要踔厉奋发、勇毅前行,努力创造更加灿烂的明天。
author=习近平
[15]
OL=万物并育而不相害,道并行而不相悖
author=《礼记·中庸》
[16]
OL=自信人生二百年,会当水击三千里
author=毛泽东《七古·残句》
[17]
OL=我们完全有信心有能力在新时代新征程创造令世人刮目相看的新的更大奇迹。
author=习近平
[18]
OL=青春虚度无所成,白首衔悲亦何及。
author=权德舆《放歌行》
[19]
OL=劳动模范是民族的精英、人民的楷模,是共和国的功臣。
author=习近平
[20]
FL=当前最重要的任务是撸起袖子加油干,
SL=一步一个脚印把党的二十大作出的重大决策部署付诸行动、见之于成效。
author=习近平
[21]
FL=广大人民群众坚持爱国奉献,无怨无悔,让我感到千千万万普通人最伟大,
SL=同时让我感到幸福都是奋斗出来的。
author=2018新年贺词 习近平
[22]
OL=中华文化既是历史的、也是当代的,既是民族的、也是世界的。
author=习近平
[23]
OL=没有坚实的物质技术基础,就不可能全面建成社会主义现代化强国。
author=习近平
[24]
OL=我们党没有自己的特殊利益,党在任何时候都是把群众利益放在第一位。
author=习近平
[25]
OL=知者行之始。行者知之成。
author=王阳明《传习录·卷上·门人陆澄录》
[26]
FL=江山就是人民,人民就是江山。
SL=中国共产党领导人民打江山、守江山,守的是人民的心,治国有常,利民为本。
author=习近平
[27]
OL=此心不动,随机而动。
author=王阳明
[28]
OL=你未看此花时,此花与汝心同归于寂。
author=《传习录·卷下·门人黄省曾录》
[29]
FL=时代呼唤我们,人民期待着我们,
SL=唯有矢志不渝、笃行不怠,方能不负时代、不负人民。
author=习近平
[30]
OL=省察是有事时存养,存养是无事时省察。
author=王阳明《传习录》
[31]
OL=路漫漫其修远兮,吾将上下而求索。
author=《离骚》
[32]
OL=当代中国青年生逢其时,施展才干的舞台无比广阔,实现梦想的前景无比光明。
author=习近平
[33]
FL=解决台湾问题是中国人自己的事,要由中国人来决定。
SL=国家统一、民族复兴的历史车轮滚滚向前,祖国完全统一一定要实现,也一定能够实现。
author=习近平
[34]
OL=悲莫悲兮生别离,乐莫乐兮新相知。
author=《九歌·少司命》
[35]
OL=风飒飒兮木萧萧,思公子兮徒离忧。
author=《九歌·山鬼》
[36]
OL=善守者,藏于九地之下,善攻者,动于九天之上。
author=《孙子兵法》
[37]
FL=我们正意气风发迈向全面建设社会主义现代化国家新征程,
SL=向第二个百年奋斗目标进军,以中国式现代化全面推进中华民族伟大复兴。
author=习近平
[38]
OL=善战者,致人而不致于人。
author=《孙子兵法·虚实第六》
[39]
OL=乱生于治,怯生于勇,弱生于强。
author=《孙子兵法·兵势第五》
[40]
FL=中国式现代化是中国共产党和中国人民长期实践探索的成果,
SL=是一项伟大而艰巨的事业。惟其艰巨,所以伟大;惟其艰巨,更显光荣。
author=习近平
[41]
OL=不战而屈人之兵,善之善者也。
author=《孙子兵法·谋攻第三》
[42]
OL=天行健,君子以自强不息。
author=《周易.乾卦》
[43]
FL=中国开放的大门只会越来越大。我们将坚定不移全面深化改革开放,
SL=坚定不移推动高质量发展,以自身发展为世界创造更多机遇。
author=习近平
[44]
OL=积善之家,必有余庆;积不善之家,必有余殃。
author=《周易.坤卦》
[45]
OL=穷则变,变则通,通则久。
author=《周易.系辞下》
[46]
FL=我们历来主张,人类的前途命运应该由世界各国人民来把握和决定。
SL=只要共行天下大道,各国就能够和睦相处、合作共赢,携手创造世界的美好未来。
author=习近平
[47]
OL=天若有情天亦老,人间正道是沧桑
author=毛泽东《七律·人民解放军占领南京》
[48]
OL=仰天大笑出门去,我辈岂是蓬蒿人。
author=李白《南陵别儿童入京》
[49]
OL=落叶秋风生渭水,落叶满长安。
author=贾岛《忆江上吴处士》
[50]
OL=人生来是精神所附丽的物质,免不掉物质所常有的惰性。
author=朱光潜《朝抵抗力最大的路径走》
[51]
FL=能朝抵抗力最大的路径走,是人的特点。
SL=人在能尽量发挥这特点时,就足见出他有富裕的生活力。
author=朱光潜《朝抵抗力最大的路径走》
[8]
OL=天生我材必有用,千金散尽还复来。
author=李白《将进酒》
[9]
OL=希君生羽翼,一化北溟鱼。
author=李白《江夏使君叔席上赠史郎中》
[10]
OL=惟沉默是最高的轻蔑。
author=鲁迅《且介亭杂文附集》
[11]
OL=虽偶有轻风细雨,但总归晴天朗照。
author=史铁生《记忆与印象》
[12]
OL=不能走远路却有辽阔的心。
author=史铁生《我与地坛》
[13]
OL=从卖气球的人那里,每个孩子牵走一个心愿。
author=北岛《代课》
[14]
OL=要有最朴素的生活和最遥远的梦想
author=海子《枫》
[15]
OL=雾打湿了我的双翼,可风却不容我再迟疑。
author=舒婷《双桅船》
[16]
OL=拯救地球好累,虽然有些疲惫但我还是会。
author=《超人不会飞》
[17]
OL=宁可一思进,莫在一思停。
author=电影《一代宗师》
[18]
OL=让人类永远保持理智,确实是一件奢侈的事。
author=电影《流浪地球》
[19]
FL=无论结果如何,人类的勇气和坚毅,
SL=都被镌刻在星空下。
author=电影《流浪地球》
[20]
OL=生活就像一盒巧克力,你不知道你的下一块口味是什么。
author=电影《阿甘正传》
[21]
FL=也许我们这些聪明人,脑袋里能装的目标太多,
SL=所以忘了执着。
author=电影《阿甘正传》
[22]
FL=我并不是每次吃完饭就看电视,有时我边吃边看电视,
SL=生活中有些改变会增加乐趣。
author=电影《加菲猫》
[23]
OL=做人如果没梦想,那跟咸鱼有什么分别?
author=电影《少林足球》
[24]
FL=世界上有一种鸟是关不住的,因为它们的每一片羽毛都沾满了太阳的光辉。
SL=当它们飞走的时候,你会觉得把它关起来是一种罪恶。
author=电影《肖申克的救赎》
[25]
FL=你每天都在做很多看起来毫无意义的决定,
SL=但某天你的某个决定就能改变你一生。
author=电影《西雅图未眠夜》
[26]
FL=把人类看做虫子的三体人似乎忘记了一个事实:
SL=虫子从来没有被战胜过。
author=刘慈欣《三体》
[27]
FL=在宇宙中,你再快都有比你更快的,
SL=你再慢也有比你更慢的。
author=刘慈欣《三体》
[28]
OL=人间风雨各处有,何处不是浪浪山?
author=国漫《小妖怪的夏天》
[29]
FL=我看到那些岁月如何奔驰,
SL=挨过了冬季,便迎来了春天。
author=《瓦尔登湖》
[30]
OL=保持热爱,奔赴山海。
author=佚名
[31]
OL=别慌,月亮也正在大海某处迷茫。
author=佚名
[32]
OL=当太阳升到最高点的时候,影子就不见了。
author=佚名
[33]
OL=大直若屈,大巧若拙,大辩若讷。
author=《老子》
[34]
OL=博学之,审问之,慎思之,明辨之,笃行之。
author=《礼记》
[35]
OL=你要批评指点四周的风景,你首先要爬上屋顶。
author=歌德
[36]
OL=只有流过血的手指,才能弹出世间的绝唱。
author=泰戈尔
[37]
OL=他强任他强,清风拂山岗。
author=佚名

View File

@ -34,6 +34,7 @@
#include "config.h"
#define WORKING_DIRECTORY "/usr/share/ukui-screensaver"
bool bControlFlg = false;//是否控制面板窗口
int main(int argc, char *argv[])
@ -43,7 +44,15 @@ int main(int argc, char *argv[])
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QApplication a(argc, argv);
prctl(PR_SET_PDEATHSIG, SIGHUP);
prctl(PR_SET_PDEATHSIG, SIGHUP);
//加载翻译文件
QString locale = QLocale::system().name();
QTranslator translator;
QString qmFile = QString(WORKING_DIRECTORY"/i18n_qm/%1.qm").arg(locale);
translator.load(qmFile);
a.installTranslator(&translator);
qDebug() << "load translation file " << qmFile;
QCommandLineParser parser;
QString windowId;
@ -72,14 +81,24 @@ int main(int argc, char *argv[])
scale = screen->devicePixelRatio();
if(onWindow){
windowId = parser.value("window-id");
windowId = parser.value("window-id");
WId wid = windowId.toULong();
/*获取窗口属性失败时程序退出,这是为了避免应用调用屏保的一瞬间崩溃,导致
winid*/
if(!XGetWindowAttributes (QX11Info::display(), wid, &xwa))
{
qDebug()<<"XGetWindowAttributes failed";
exit(0);
}
QWindow* window = QWindow::fromWinId(wid);
window->setProperty("_q_embedded_native_parent_handle",QVariant(wid));
s.setProperty("_q_embedded_native_parent_handle",QVariant(wid));
/*设置焦点穿透*/
s.setWindowFlag(Qt::WindowTransparentForInput, true);
s.winId();
s.windowHandle()->setParent(window);
XGetWindowAttributes (QX11Info::display(), wid, &xwa);
/*
s.windowHandle()->setParent(window);
#ifndef USE_INTEL
XClassHint ch;
ch.res_name = NULL;
@ -87,9 +106,10 @@ int main(int argc, char *argv[])
XGetClassHint (QX11Info::display(), wid, &ch);
if(ch.res_name && strcmp(ch.res_name,"ukui-control-center")==0){
bControlFlg = true;
s.addClickedEvent();
}
#endif
*/
//获取屏保所在屏幕对应的缩放比例。
for(auto screen : QGuiApplication::screens())
{

View File

@ -21,6 +21,10 @@
#include <QSettings>
#include <QGSettings>
#include <QString>
#include <kysdk/kysdk-system/libkysysinfo.h>
#include <QScreen>
#include <QApplication>
#include "glibinterface.h"
#define GSETTINGS_SCHEMA_SCREENSAVER "org.ukui.screensaver"
#define GSETTINGS_SCHEMA_MATE_BACKGROUND "org.mate.background"
@ -119,9 +123,13 @@ void SCConfiguration::onConfigurationChanged(QString key)
}else if(key == "menuTransparency"){
int blur_Num = stygsettings->get("menuTransparency").toInt();
Q_EMIT blurChanged(blur_Num);
}else if(key == "styleName"){
}else if(key == "styleName"){
QString m_curStyle = stygsettings->get("styleName").toString();
Q_EMIT styleChanged(m_curStyle);
} else if (key == "systemFontSize") {
double m_curFontSize = stygsettings->get("systemFontSize").toDouble();
qDebug() << "curFontSize = " << m_curFontSize ;
Q_EMIT fontSizeChanged(m_curFontSize);
}
}
@ -132,10 +140,19 @@ QString SCConfiguration::getDefaultBackground()
backgroundFile = ukgsettings->get("background").toString();
}
if(ispicture(backgroundFile))
if(ispicture(backgroundFile)) {
return backgroundFile;
else
} else {
char *systemName = kdk_system_get_systemName();
if (systemName) {
if (QString(systemName) == "openKylin") {
free(systemName);
return "/usr/share/backgrounds/1-openkylin.jpg";
}
free(systemName);
}
return "/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg";
}
}
int SCConfiguration::getTimeType()
@ -162,6 +179,30 @@ QString SCConfiguration::getDateType()
return dateType;
}
int SCConfiguration::getFontSize()
{
double fontSize = 0;
if(stygsettings){
QStringList keys = stygsettings->keys();
if (keys.contains("systemFontSize")) {
fontSize = stygsettings->get("systemFontSize").toDouble();
}
}
double defaultFontSize = getDefaultFontSize();
qDebug()<<"defaultFontSize = "<<defaultFontSize;
return fontSize - defaultFontSize;
}
double SCConfiguration::getPtToPx()
{
double m_ptTopx = 1.0;
if (QApplication::primaryScreen()->logicalDotsPerInch() > 0)
m_ptTopx = 72/(QApplication::primaryScreen()->logicalDotsPerInch());
return m_ptTopx;
}
bool SCConfiguration::getAutoSwitch()
{
bool ret = false;

View File

@ -38,6 +38,8 @@ public:
QString getDefaultBackground(); //获取屏保默认背景
int getTimeType(); //获取显示时间格式
QString getDateType(); //获取日期格式
int getFontSize(); //获取当前字体大小
double getPtToPx();
bool getAutoSwitch(); //获取是否自动切换
bool getCShowRestTime(); //自定义是否显示休息时间
bool getUShowRestTime(); //UKUI是否显示休息时间
@ -69,6 +71,7 @@ Q_SIGNALS:
QString dateTypeChanged(QString type);
int blurChanged(int num);
QString styleChanged(QString type);
int fontSizeChanged(int fontSize);
private:
void initGsettings();

View File

@ -68,7 +68,6 @@
#define KEY_MESSAGE_SHOW_ENABLED "show-message-enabled"
#define KEY_HOURSYSTEM "hoursystem"
#define KEY_DATE_FORMAT "date"
#define WORKING_DIRECTORY "/usr/share/ukui-screensaver"
QTime Screensaver::m_currentTime = QTime::currentTime();
extern bool bControlFlg;
@ -99,14 +98,6 @@ Screensaver::Screensaver(bool isscreensaver,QWidget *parent):
screenLabel(nullptr),
respondClick(false)
{
//加载翻译文件
QString locale = QLocale::system().name();
QTranslator translator;
QString qmFile = QString(WORKING_DIRECTORY"/i18n_qm/%1.qm").arg(locale);
translator.load(qmFile);
qApp->installTranslator(&translator);
qDebug() << "load translation file " << qmFile;
installEventFilter(this);
// setWindowFlags(Qt::X11BypassWindowManagerHint);
setUpdateCenterWidget();
@ -123,7 +114,8 @@ Screensaver::Screensaver(bool isscreensaver,QWidget *parent):
myText = configuration->getMyText();
}else
isUShowRestTime = configuration->getUShowRestTime();
curFontSize = configuration->getFontSize();
m_ptToPx = configuration->getPtToPx();
initUI();
m_background = new MBackground();
@ -251,6 +243,11 @@ void Screensaver::onDateFormatChanged(QString type){
dateType = type;
}
void Screensaver::onFontSizeChanged(int fontSize)
{
curFontSize = fontSize;
}
void Screensaver::onMessageNumberChanged(int num)
{
int number = configuration->getMessageNumber();
@ -513,12 +510,23 @@ void Screensaver::resizeEvent(QResizeEvent */*event*/)
for(int i = 0;i<labelList.count();i++)
{
int fontsize = labelList.at(i)->font().pixelSize();
int fontpt = labelList.at(i)->font().pointSize();
if (fontsize > 0) {
#ifdef USE_INTEL
const QString SheetStyle = QString("font-size:%1px;").arg(fontsize/3);
const QString SheetStyle = QString("font-size:%1px;").arg(fontsize/3);
#else
const QString SheetStyle = QString("font-size:%1px;").arg(fontsize/4);
const QString SheetStyle = QString("font-size:%1px;").arg(fontsize/4);
#endif
labelList.at(i)->setStyleSheet(SheetStyle);
labelList.at(i)->setStyleSheet(SheetStyle);
} else {
QFont font = labelList.at(i)->font();
#ifdef USE_INTEL
font.setPointSize(fontpt/3);
#else
font.setPointSize(fontpt/4);
#endif
labelList.at(i)->setFont(font);
}
}
QList<QWidget*> childList = timeLayout->findChildren<QWidget *>();
for (int i = 0; i < childList.count(); ++i) {
@ -531,25 +539,6 @@ void Screensaver::resizeEvent(QResizeEvent */*event*/)
flag = 1;
#ifndef USE_INTEL
if(myTextWidget){
// QColor highLightColor = palette().color(QPalette::Base);
// QString stringColor = QString("rgba(%1,%2,%3,82%)")
// .arg(highLightColor.red())
// .arg(highLightColor.green())
// .arg(highLightColor.blue());
// QColor textColor = palette().color(QPalette::Text);
// QString textString = QString("rgb(%1,%2,%3)")
// .arg(textColor.red())
// .arg(textColor.green())
// .arg(textColor.blue());
// QColor borderColor = palette().color(QPalette::BrightText);
// QString borderString = QString("rgba(%1,%2,%3,85%)")
// .arg(borderColor.red())
// .arg(borderColor.green())
// .arg(borderColor.blue());
// myTextLabel->setStyleSheet(QString("font-size:5px;border-radius: 2px;background: %1;color: %2;padding: 4px 8px 4px 8px;border-width: 1px;border-style: solid;border-color:%3;") \
// .arg(stringColor).arg(textString).arg(borderString));
if(curStyle == "ukui-dark" || curStyle == "ukui-black"){
myTextLabel->setStyleSheet(QString("QLabel{font-size:5px;border-radius: 2px;padding: 4px 8px 4px 8px;border-width: 1px;\
background: rgba(0, 0, 0, %1); color:#FFFFFF; border-radius:16px}").arg(blur_Num * 0.01));
@ -981,6 +970,9 @@ void Screensaver::setDatelayout()
QVBoxLayout *vtimeLayout = new QVBoxLayout(timeLayout);
this->dateOfLocaltime = new QLabel(this);
sysFont= qApp->font();
sysFont.setPointSize((58 + curFontSize) *m_ptToPx);
this->dateOfLocaltime->setFont(sysFont);
if(timeType == 12)
this->dateOfLocaltime->setText(QDateTime::currentDateTime().toString("A hh:mm"));
else
@ -992,8 +984,10 @@ void Screensaver::setDatelayout()
vtimeLayout->addWidget(dateOfLocaltime);
this->dateOfDay = new QLabel(this);
sysFont.setPointSize((16 + curFontSize) *m_ptToPx);
this->dateOfDay->setFont(sysFont);
if(dateType == "cn")
this->dateOfDay->setText(QDate::currentDate().toString("yyyy/MM/dd ddd"));
this->dateOfDay->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期"));
else
this->dateOfDay->setText(QDate::currentDate().toString("yyyy-MM-dd ddd"));
this->dateOfDay->setObjectName("dateOfDay");
@ -1109,7 +1103,7 @@ void Screensaver::updateTime()
this->dateOfLocaltime->setText(curDateTime.toString("hh:mm"));
if(dateType == "cn")
this->dateOfDay->setText(curDateTime.date().toString("yyyy/MM/dd ddd"));
this->dateOfDay->setText(curDateTime.date().toString("yyyy/MM/dd ddd").replace("","星期"));
else
this->dateOfDay->setText(curDateTime.date().toString("yyyy-MM-dd ddd"));
m_lastDateTime = curDateTime;
@ -1184,7 +1178,8 @@ void Screensaver::setRandomText()
}
layout->addWidget(myTextLabel);
}
sysFont.setPointSize((18 + curFontSize) *m_ptToPx);
myTextLabel->setFont(sysFont);
myTextLabel->setText(myText);
myTextWidget->adjustSize();
if(myText != "")
@ -1279,10 +1274,14 @@ void Screensaver::setCenterWidget()
authorlabel->hide();
}
#endif
centerlabel1->setObjectName("centerLabel");
centerlabel2->setObjectName("centerLabel");
authorlabel->setObjectName("authorLabel");
sysFont.setPointSize((36 + curFontSize) *m_ptToPx);
centerlabel1->setFont(sysFont);
centerlabel2->setFont(sysFont);
sysFont.setPointSize((28 + curFontSize) *m_ptToPx);
authorlabel->setFont(sysFont);
qsettings->endGroup();

View File

@ -136,6 +136,9 @@ private:
static QTime m_currentTime;
int blur_Num;
QString curStyle;
double curFontSize;
double m_ptToPx = 1.0;
QFont sysFont;
WeatherManager *m_weatherManager=nullptr;
QWidget *m_weatherLaout;
@ -181,6 +184,7 @@ private Q_SLOTS:
void onDateFormatChanged(QString type);
void onBlurNumChanged(int num);
void onStyleChanged(QString style);
void onFontSizeChanged(int fontSize);
QPixmap getPaddingPixmap();
};

View File

@ -20,11 +20,13 @@
#include <QLabel>
#include <QDebug>
#include <QListWidget>
#include <QApplication>
SleepTime::SleepTime(QWidget *parent) : QWidget(parent),
sleepTime(0),
m_nLastSleepLeave(0),
m_nLastSleepTimeSecs(0)
m_nLastSleepTimeSecs(0),
configuration(SCConfiguration::instance())
{
init();
}
@ -39,18 +41,22 @@ void SleepTime::init()
layout = new QHBoxLayout(this);
layout->setDirection(QBoxLayout::RightToLeft);
layout->setSpacing(8);
curFontSize = configuration->getFontSize();
sysFont = qApp->font();
sysFont.setPointSize((20 + curFontSize) *m_ptToPx);
for(int i=0;i<3;i++)
{
QLabel *label = new QLabel(this);
label->setText("0");
label->setFixedSize(40,40);
label->setObjectName("clockTime");
label->setFont(sysFont);
list.append(label);
if (i < 2) {
QLabel *colon = new QLabel(this);
colon->setText(":");
colon->setObjectName("colon");
colon->setFont(sysFont);
list.append(colon);
}
}
@ -61,6 +67,8 @@ void SleepTime::init()
}
restTime = new QLabel(this);
sysFont.setPointSize((20 + curFontSize) *m_ptToPx);
restTime->setFont(sysFont);
restTime->setText(tr("You have rested"));
restTime->setObjectName("restTime");
restTime->setAlignment(Qt::AlignBottom);

View File

@ -19,6 +19,7 @@
#ifndef SLEEPTIME_H
#define SLEEPTIME_H
#include "scconfiguration.h"
#include <QWidget>
#include <QLabel>
#include <QTimer>
@ -36,6 +37,7 @@ public:
void setSmallMode();
private:
SCConfiguration *configuration;
QLabel *restTime;
QList<QLabel *> list;
QHBoxLayout *layout;
@ -44,6 +46,9 @@ private:
long long m_nLastSleepTimeSecs;
QDateTime initTime;
QDateTime m_lastTime;
double curFontSize;
double m_ptToPx = 1.0;
QFont sysFont;
void init();
void setHour(int hour);

View File

@ -3,13 +3,18 @@ project(set4kScale)
pkg_check_modules(X11 REQUIRED x11)
pkg_check_modules(XCB REQUIRED xcb)
pkg_check_modules(QGS REQUIRED gsettings-qt)
pkg_check_modules(KDKINFO REQUIRED kysdk-sysinfo)
include_directories(
${X11_INCLUDE_DIRS}
${XCB_INCLUDE_DIRS}
${QGS_INCLUDE_DIRS}
${KDKINFO_INCLUDE_DIRS}
)
link_directories(
${KDKINFO_LIBRARY_DIRS})
set(CMAKE_AUTOMOC ON)
set(bin_SRCS
@ -18,7 +23,7 @@ set(bin_SRCS
)
add_executable(set4kScale ${bin_SRCS})
target_link_libraries(set4kScale Qt5::Core Qt5::Widgets Qt5::X11Extras ${X11_LIBRARIES} ${XCB_LIBRARIES} ${QGS_LIBRARIES})
target_link_libraries(set4kScale Qt5::Core Qt5::Widgets Qt5::X11Extras ${X11_LIBRARIES} ${XCB_LIBRARIES} ${QGS_LIBRARIES} ${KDKINFO_LIBRARIES})
install(TARGETS
set4kScale

View File

@ -11,6 +11,8 @@
#include <QApplication>
#include <QWidget>
#include <QGSettings/QGSettings>
#include <kysdk/kysdk-system/libkysysinfo.h>
extern "C" {
#include <X11/Xatom.h>
#include <X11/Xlib.h>
@ -24,6 +26,26 @@ extern "C" {
#define CURSOR_THEME "cursor-theme"
/* 设置DPI环境变量 */
void setXresources(double scale)
{
Display *dpy;
QGSettings *mouse_settings = new QGSettings(MOUSE_SCHEMA);
QString str = QString("Xft.dpi:\t%1\nXcursor.size:\t%2\nXcursor.theme:\t%3\n")
.arg(scale * 96)
.arg(mouse_settings->get(CURSOR_SIZE).toInt() * scale)
.arg(mouse_settings->get(CURSOR_THEME).toString());
dpy = XOpenDisplay(NULL);
XChangeProperty(dpy, RootWindow(dpy, 0), XA_RESOURCE_MANAGER, XA_STRING, 8,
PropModeReplace, (unsigned char *) str.toLatin1().data(), str.length());
XCloseDisplay(dpy);
qDebug() << "setXresources" << str;
delete mouse_settings;
}
/* 过滤低分辨率高缩放比情况 */
void screenScaleJudgement(QGSettings *settings)
{
@ -40,40 +62,24 @@ void screenScaleJudgement(QGSettings *settings)
if (width < 1920 && height < 1080) {
state = true;
} else if (width == 1920 && height == 1080 && scale > 1.5) {
}
else if (width == 1920 && height == 1080 && scale > 1.5) {
state = true;
} else if (width > 2560 && height > 1440) {
}
/*
else if (width > 2560 && height > 1440) {
mScale = true;
}
*/
}
if (state && !mScale) {
QGSettings *mGsettings = new QGSettings(MOUSE_SCHEMA);
mGsettings->set(CURSOR_SIZE, 24);
// if (state && !mScale) {
if (state) {
settings->set(SCALING_KEY, 1.0);
delete mGsettings;
scale = 1.0;
}
}
}
/* 设置DPI环境变量 */
void setXresources(int dpi)
{
Display *dpy;
QGSettings *mouse_settings = new QGSettings(MOUSE_SCHEMA);
QString str = QString("Xft.dpi:\t%1\nXcursor.size:\t%2\nXcursor.theme:\t%3\n")
.arg(dpi)
.arg(mouse_settings->get(CURSOR_SIZE).toInt())
.arg(mouse_settings->get(CURSOR_THEME).toString());
dpy = XOpenDisplay(NULL);
XChangeProperty(dpy, RootWindow(dpy, 0), XA_RESOURCE_MANAGER, XA_STRING, 8,
PropModeReplace, (unsigned char *) str.toLatin1().data(), str.length());
XCloseDisplay(dpy);
qDebug() << "setXresources" << str;
delete mouse_settings;
setXresources(scale);
}
/* 判断文件是否存在 */
@ -102,21 +108,16 @@ void writeXresourcesFile(QString XresourcesFile, QGSettings *settings, double sc
file.close();
QGSettings *Font = new QGSettings("org.ukui.font-rendering");
QGSettings *mouse_settings = new QGSettings(MOUSE_SCHEMA);
Font->set("dpi", 96.0);
settings->set(SCALING_KEY, scaling);
mouse_settings->set(CURSOR_SIZE, scaling * 24.0);
qDebug() << " writeXresourcesFile: content = " << content
<< " scalings = " << settings->get(SCALING_KEY).toDouble()
<< "cursor size = " << mouse_settings->get(CURSOR_SIZE).toInt();
<< " scalings = " << settings->get(SCALING_KEY).toDouble();
delete Font;
delete mouse_settings;
}
/* 判断是否为首次登陆 */
bool isTheFirstLogin(QGSettings *settings)
{
QString homePath = getenv("HOME");
@ -156,22 +157,23 @@ bool isTheFirstLogin(QGSettings *settings)
if (zoom1) {
mScaling = 1.0;
} else if (!zoom1 && zoom2) {
mScaling = 1.5;
mScaling = 1.5; //考虑新版缩放设置默认150%暂时停止设置;
} else if (!zoom1 && !zoom2 && zoom3) {
mScaling = 2.0;
}
writeXresourcesFile(XresourcesFile, settings, mScaling);
setXresources(mScaling);
return true;
}
/* 配置新装系统、新建用户第一次登陆时4K缩放功能*/
void setHightResolutionScreenZoom()
void setHightResolutionScreenZoom(bool platForm)
{
QGSettings *settings;
double dpi;
double scale;
int ScreenNum = QApplication::screens().length();
if (!QGSettings::isSchemaInstalled(XSETTINGS_SCHEMA) || !QGSettings::isSchemaInstalled("org.ukui.font-rendering") ||
!QGSettings::isSchemaInstalled(MOUSE_SCHEMA)) {
@ -181,28 +183,41 @@ void setHightResolutionScreenZoom()
}
settings = new QGSettings(XSETTINGS_SCHEMA);
scale = settings->get(SCALING_KEY).toDouble();
if (platForm) {
setXresources(scale);
goto end;
}
if (isTheFirstLogin(settings)) {
qDebug() << "Set the default zoom value when logging in for the first time.";
goto end;
}
/* 过滤单双屏下小分辨率大缩放值 */
if (ScreenNum > 1) {
setXresources(scale);
goto end;
}
screenScaleJudgement(settings);
end:
dpi = 0.0;
dpi = settings->get(SCALING_KEY).toDouble() * 96.0;
setXresources(dpi);
delete settings;
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
setHightResolutionScreenZoom();
QString platForm = kdk_system_get_hostCloudPlatform();
if (platForm == "none") {
qDebug() << "platForm=" << platForm << ", 系统环境为实体机";
setHightResolutionScreenZoom(false);
} else {
qDebug() << "platForm=" << platForm << ", 系统环境为云环境";
setHightResolutionScreenZoom(true);
}
return 0;
}

View File

@ -7,6 +7,8 @@ pkg_check_modules(QGS REQUIRED gsettings-qt)
pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(MMIX REQUIRED libmatemixer)
pkg_check_modules(kylin-nm-base REQUIRED kylin-nm-base)
pkg_check_modules(KDKINFO REQUIRED kysdk-sysinfo)
pkg_check_modules(IMLIB2 REQUIRED imlib2)
find_library(PAM_LIBRARIES pam)
@ -28,6 +30,14 @@ include_directories(
${GLIB_INCLUDE_DIRS}
${MMIX_INCLUDE_DIRS}
${kylin-nm-base_INCLUDE_DIRS}
${KF5Wayland_LIBRARIES}
${KDKINFO_INCLUDE_DIRS}
${IMLIB2_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
link_directories(
${KDKINFO_LIBRARY_DIRS}
)
set(EXTRA_LIBS
@ -39,9 +49,15 @@ set(EXTRA_LIBS
${QGS_LIBRARIES}
${GLIB_LIBRARIES}
${MMIX_LIBRARIES}
${KF5Wayland_LIBRARIES}
${KDKINFO_LIBRARIES}
${IMLIB2_LIBRARIES}
-lrt
-lpthread
-lKF5WaylandServer
-lKF5WaylandClient
-llibnm-icon-kylin
-lukuiinputgatherclient
)
qt5_wrap_ui(dialog_SRC
@ -65,7 +81,6 @@ qt5_wrap_cpp(dialog_SRC
screensaverwidget.h
auth.h
auth-pam.h
authpamthread.h
screensavermode.h
screensaverwndadaptor.h
xeventmonitor.h
@ -97,6 +112,9 @@ qt5_wrap_cpp(dialog_SRC
lockchecker.h
servicemanager.h
mytabwidget.h
plasma-shell-manager.h
modebutton.h
klabel.h
PhysicalDeviceSet/brightnessdeviceset.h
PhysicalDeviceSet/flightmodeset.h
PhysicalDeviceSet/sounddeviceset.h
@ -104,6 +122,8 @@ qt5_wrap_cpp(dialog_SRC
device.h
enginedevice.h
batterywidget.h
libinputswitchevent.h
machinemodel.h
)
set(dialog_SRC
@ -116,7 +136,6 @@ set(dialog_SRC
loginoptionswidget.cpp
screensaverwidget.cpp
auth-pam.cpp
authpamthread.cpp
xeventmonitor.cpp
monitorwatcher.cpp
grab-x11.cpp
@ -148,6 +167,10 @@ set(dialog_SRC
lockchecker.cpp
servicemanager.cpp
mytabwidget.cpp
plasma-shell-manager.cpp
modebutton.cpp
klabel.cpp
rootWindowBackground.cpp
PhysicalDeviceSet/brightnessdeviceset.cpp
PhysicalDeviceSet/flightmodeset.cpp
PhysicalDeviceSet/sounddeviceset.cpp
@ -155,6 +178,8 @@ set(dialog_SRC
device.cpp
enginedevice.cpp
batterywidget.cpp
libinputswitchevent.cpp
machinemodel.cpp
)
add_executable(ukui-screensaver-dialog ${dialog_SRC})
add_definitions(-DAPP_API_MAJOR=0 -DAPP_API_MINOR=11 -DAPP_API_FUNC=0)
@ -173,6 +198,9 @@ target_link_libraries(ukui-screensaver-dialog
Kylin-nm
ukui-log4qt
Screensaver
opencv_imgcodecs
opencv_imgproc
opencv_core
)
link_libraries(libmatemixer.so glib-2.0.so)
@ -195,7 +223,7 @@ set(backend_SRC
logind.cpp
)
add_executable(ukui-screensaver-backend ${backend_SRC})
target_link_libraries(ukui-screensaver-backend Qt5::Core Qt5::DBus ${QGS_LIBRARIES} ukui-log4qt)
target_link_libraries(ukui-screensaver-backend Qt5::Core Qt5::DBus ${QGS_LIBRARIES} ukui-log4qt Common)
set(command_SRC
ukui-screensaver-command.cpp
@ -209,6 +237,14 @@ set(checkpass_SRC
add_executable(ukui-screensaver-checkpass ${checkpass_SRC})
target_link_libraries(ukui-screensaver-checkpass ${PAM_LIBRARIES})
set(ukss_SRCS
ukss_interface.cpp
)
add_definitions(-DUKSSSO_LIBRARY)
add_library(ukss SHARED ${ukss_SRCS})
target_link_libraries(ukss Qt5::Core Qt5::DBus ${QGS_LIBRARIES})
install(TARGETS
ukui-screensaver-dialog
ukui-screensaver-backend
@ -216,6 +252,8 @@ install(TARGETS
ukui-screensaver-checkpass
DESTINATION bin)
install(TARGETS ukss DESTINATION ${QT_INSTALL_LIBS})
#set(test-act_SRC
# users.cpp
# test-accounts.cpp

View File

@ -5,9 +5,7 @@
<qresource prefix="/image">
<file>assets/show-password.png</file>
<file>assets/hide-password.png</file>
<file>assets/keyboard.png</file>
<file>assets/switchGreeter.png</file>
<file>assets/switchUser.png</file>
<file>assets/waiting.png</file>
<file>assets/capslock.png</file>
<file>assets/combobox_down.png</file>
@ -25,13 +23,8 @@
<file>assets/unlock-button-pressed.png</file>
<file>assets/iconFace.png</file>
<file>assets/iconFace.svg</file>
<file>assets/powerManager.png</file>
<file>assets/lock.png</file>
<file>assets/logout.png</file>
<file>assets/shutdown.png</file>
<file>assets/suspend.png</file>
<file>assets/hibernate.png</file>
<file>assets/reboot.png</file>
<file>assets/bio-login.png</file>
<file>assets/password-login.png</file>
<file>assets/weather/68.png</file>
@ -119,11 +112,20 @@
<file>assets/ukui-loginopt-finger.svg</file>
<file>assets/ukui-loginopt-face.svg</file>
<file>assets/ukui-loginopt-password.svg</file>
<file>assets/ukui-loginopt-ukey.svg</file>
<file>assets/selected.svg</file>
<file>assets/keyboard.svg</file>
<file>assets/ukui-loginopt-smile.svg</file>
<file>assets/ukui-loginopt-lose.svg</file>
<file>assets/01-default-commercial.png</file>
<file>assets/01-default-community.png</file>
<file>assets/suspend.svg</file>
<file>assets/shutdown.svg</file>
<file>assets/reboot.svg</file>
<file>assets/hibernate.svg</file>
<file>assets/switchuser.svg</file>
</qresource>
<qresource prefix="/">
<file>assets/data/conf.ini</file>
</qresource>
</RCC>

View File

@ -34,14 +34,12 @@ QToolButton::checked {
QLabel {
color: white;
font-size: 16px;
}
QToolTip{
border-radius:4px;
background-color:#FFFFFF;
color:black;
font-size:16px
}
#userWidget{
@ -57,7 +55,6 @@ QToolTip{
/* 用户名 */
#login_nameLabel{
font-size: 24px;
}
/* 密码输入框 */
@ -66,7 +63,6 @@ QLineEdit {
border: 2px solid #FFFFFF;
border-radius: 6px;
color:black;
font-size: 14px;
lineedit-password-character:9679;
}
@ -101,11 +97,6 @@ QLineEdit::focus{
/* 登录按钮 */
#loginButton{
min-width: 24px;
max-width: 24px;
min-height: 24px;
max-height: 24px;
icon-size: 24px;
background:#3D6BE5;
border-radius:12px;
}
@ -117,13 +108,11 @@ QLineEdit::focus{
/* PAM message提示*/
#messageLabel {
font-size: 16px;
color: white;
}
#messageButton{
text-align:center;
font-size: 16px;
color: white;
}
@ -134,7 +123,6 @@ QMenu{
color: white;
border-radius: 4px;
width:250px;
font-size: 16px;
padding: 5px 5px 5px 5px;
}
@ -146,7 +134,6 @@ QMenu::item
width:225px;
border-radius: 4px;
height:36px;
font-size:16px;
padding: 2px 10px 2px 10px;
}

15
src/assets/data/conf.ini Normal file
View File

@ -0,0 +1,15 @@
[MachineType]
PANDING LTDtablet = SLATE
#Phytium12345 = SLATE
#key 值机器的sys_vendor + product_family
#cat /sys/class/dmi/id/product_family
#cat /sys/class/dmi/id/product_name
#cat /sys/class/dmi/id/sys_vendor
#value 有以下四类
#[SLATE]平板
#[LAPTOP]计算机(有永久附加键盘)
#[CONVERTIBLE]平板/计算机(键盘可以分离、翻转或旋转)
#[ALLINONE]台式机

Binary file not shown.

Before

Width:  |  Height:  |  Size: 902 B

1
src/assets/hibernate.svg Normal file
View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M41.06,31.53A18.5,18.5,0,0,1,16,6.44a1.51,1.51,0,0,0-2-2A21.5,21.5,0,1,0,43.1,33.57a1.51,1.51,0,0,0-2-2ZM24.22,41.78A18.5,18.5,0,0,1,11.39,10a21.27,21.27,0,0,0-.67,5.33,21.52,21.52,0,0,0,21.5,21.5,21.27,21.27,0,0,0,5.33-.67A18.49,18.49,0,0,1,24.22,41.78Z" fill="#fff"/><path d="M26,31h6.8a1,1,0,0,0,0-2H28.41l4.3-4.29a1,1,0,0,0,.21-1.09A1,1,0,0,0,32,23H26.4a1,1,0,0,0,0,2h3.19l-4.3,4.29a1,1,0,0,0-.21,1.09A1,1,0,0,0,26,31Z" fill="#fff"/><path d="M29,20h6.8a1,1,0,0,0,0-2H31.41l4.3-4.29a1,1,0,0,0,.21-1.09A1,1,0,0,0,35,12H29.4a1,1,0,0,0,0,2h3.19l-4.3,4.29a1,1,0,0,0-.21,1.09A1,1,0,0,0,29,20Z" fill="#fff"/><path d="M43.8,27H39.41l4.3-4.29a1,1,0,0,0,.21-1.09A1,1,0,0,0,43,21H37.4a1,1,0,0,0,0,2h3.19l-4.3,4.29a1,1,0,0,0-.21,1.09A1,1,0,0,0,37,29h6.8a1,1,0,0,0,0-2Z" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Some files were not shown because too many files have changed in this diff Show More