add 0006-changelog.patch 0007-changelog.patch 0008-changelog.patch from upstream
This commit is contained in:
parent
27a2c4e613
commit
09c8612867
249
0006-changelog.patch
Normal file
249
0006-changelog.patch
Normal file
@ -0,0 +1,249 @@
|
||||
From: lixueman <lixueman@kylinos.cn>
|
||||
Date: Mon, 18 Jul 2022 15:21:40 +0800
|
||||
Subject: =?utf-8?b?5pu05pawY2hhbmdlbG9n5L+h5oGv?=
|
||||
|
||||
---
|
||||
src/UserInterface/ListView/klistview.cpp | 1 +
|
||||
src/UserInterface/Widget/full_function_widget.cpp | 1 +
|
||||
src/UserInterface/Widget/full_function_widget.h | 2 ++
|
||||
src/UserInterface/Widget/full_letter_widget.cpp | 1 +
|
||||
src/UserInterface/Widget/full_letter_widget.h | 2 ++
|
||||
src/UserInterface/full_mainwindow.cpp | 23 ++++++++++++++-
|
||||
src/UserInterface/full_mainwindow.h | 1 +
|
||||
src/UserInterface/mainwindow.cpp | 34 +++++++++++++++++------
|
||||
8 files changed, 55 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp
|
||||
index 96a03e6..8151d04 100755
|
||||
--- a/src/UserInterface/ListView/klistview.cpp
|
||||
+++ b/src/UserInterface/ListView/klistview.cpp
|
||||
@@ -46,6 +46,7 @@ void KListView::onClicked(QModelIndex index)
|
||||
if (var.isValid()) {
|
||||
QString desktopfp = var.value<QString>();
|
||||
execApp(desktopfp);
|
||||
+ Q_EMIT sendHideMainWindowSignal();
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp
|
||||
index 253f210..fd124e4 100755
|
||||
--- a/src/UserInterface/Widget/full_function_widget.cpp
|
||||
+++ b/src/UserInterface/Widget/full_function_widget.cpp
|
||||
@@ -210,6 +210,7 @@ void FullFunctionWidget::insertAppList(QStringList desktopfplist)
|
||||
listview->addData(m_data);
|
||||
connect(listview, &FullListView::sendItemClickedSignal, this, &FullFunctionWidget::execApplication);
|
||||
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullFunctionWidget::sendHideMainWindowSignal);
|
||||
+ connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullFunctionWidget::sendUpdateCommonView);
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/src/UserInterface/Widget/full_function_widget.h b/src/UserInterface/Widget/full_function_widget.h
|
||||
index ead61ff..931104c 100755
|
||||
--- a/src/UserInterface/Widget/full_function_widget.h
|
||||
+++ b/src/UserInterface/Widget/full_function_widget.h
|
||||
@@ -195,6 +195,8 @@ Q_SIGNALS:
|
||||
|
||||
void changeScrollValue(int value, int maximumValue);
|
||||
|
||||
+ void sendUpdateCommonView();
|
||||
+
|
||||
};
|
||||
|
||||
#endif // FULLFUNCTIONWIDGET_H
|
||||
diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp
|
||||
index 96daac2..45fb165 100755
|
||||
--- a/src/UserInterface/Widget/full_letter_widget.cpp
|
||||
+++ b/src/UserInterface/Widget/full_letter_widget.cpp
|
||||
@@ -210,6 +210,7 @@ void FullLetterWidget::fillAppList()
|
||||
listview->addData(m_data);
|
||||
connect(listview, &FullListView::sendItemClickedSignal, this, &FullLetterWidget::execApplication);
|
||||
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullLetterWidget::sendHideMainWindowSignal);
|
||||
+ connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullLetterWidget::sendUpdateCommonView);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/UserInterface/Widget/full_letter_widget.h b/src/UserInterface/Widget/full_letter_widget.h
|
||||
index 5f94658..662408b 100755
|
||||
--- a/src/UserInterface/Widget/full_letter_widget.h
|
||||
+++ b/src/UserInterface/Widget/full_letter_widget.h
|
||||
@@ -197,6 +197,8 @@ Q_SIGNALS:
|
||||
void selectFirstItem();
|
||||
|
||||
void changeScrollValue(int value, int maximumValue);
|
||||
+
|
||||
+ void sendUpdateCommonView();
|
||||
};
|
||||
|
||||
#endif // FULLLETTERWIDGET_H
|
||||
diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp
|
||||
index 4e6ea9a..3c77fd5 100755
|
||||
--- a/src/UserInterface/full_mainwindow.cpp
|
||||
+++ b/src/UserInterface/full_mainwindow.cpp
|
||||
@@ -209,9 +209,12 @@ void FullMainWindow::initConnect()
|
||||
connect(this, &FullMainWindow::sendSetFocusToResult, m_fullResultPage, &FullSearchResultWidget::selectFirstItemTab);
|
||||
// connect(m_fullSelectMenuButton, &QToolButton::clicked, this, &FullMainWindow::on_fullSelectMenuButton_clicked);
|
||||
connect(m_fullCommonPage, &FullCommonUseWidget::sendUpdateOtherView, this, &FullMainWindow::sendUpdateOtherView);
|
||||
+ connect(m_fullFunctionPage, &FullFunctionWidget::sendUpdateCommonView, m_fullCommonPage, &FullCommonUseWidget::updateListViewSlot);
|
||||
+ connect(m_fullLetterPage, &FullLetterWidget::sendUpdateCommonView, m_fullCommonPage, &FullCommonUseWidget::updateListViewSlot);
|
||||
connect(m_fullCommonPage, &FullCommonUseWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
|
||||
connect(m_fullFunctionPage, &FullFunctionWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
|
||||
connect(m_fullLetterPage, &FullLetterWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
|
||||
+ connect(m_fullResultPage, &FullSearchResultWidget::sendHideMainWindowSignal, this, &FullMainWindow::fullWindowHide);
|
||||
connect(m_dropDownMenu, &MenuBox::triggered, this, &FullMainWindow::on_fullSelectMenuButton_triggered);
|
||||
connect(m_dropDownMenu, &MenuBox::sendMainWinActiveSignal, [ = ]() {
|
||||
selectIconAnimation(false);
|
||||
@@ -316,7 +319,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *ke = (QKeyEvent *)event;
|
||||
|
||||
- if (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return) {
|
||||
+ if (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Down) {
|
||||
Q_EMIT sendSetFocusToResult();
|
||||
}
|
||||
}
|
||||
@@ -370,6 +373,23 @@ void FullMainWindow::iconAnimationFinished()
|
||||
-Style::DropMenuWidth, 45)));
|
||||
}
|
||||
|
||||
+void FullMainWindow::keyPressEvent(QKeyEvent *e)
|
||||
+{
|
||||
+ if (e->type() == QEvent::KeyPress) {
|
||||
+ if ((e->key() >= Qt::Key_0 && e->key() <= Qt::Key_9) || (e->key() >= Qt::Key_A && e->key() <= Qt::Key_Z)) {
|
||||
+ qDebug() << "void MainWindow::keyPressEvent(QKeyEvent *e)" << e->text();
|
||||
+ m_lineEdit->setFocus();
|
||||
+ m_lineEdit->setText(e->text());
|
||||
+ }
|
||||
+
|
||||
+ if (e->key() == Qt::Key_Backspace) {
|
||||
+ if (!m_lineEdit->text().isEmpty()) {
|
||||
+ m_lineEdit->setText("");
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void FullMainWindow::selectIconAnimation(const bool &flag)
|
||||
{
|
||||
iconAnimation = new QPropertyAnimation(m_fullSelectMenuButton, "rotation", this);
|
||||
@@ -451,6 +471,7 @@ bool FullMainWindow::event(QEvent *event)
|
||||
}
|
||||
|
||||
if (keyEvent->key() == Qt::Key_Escape) {
|
||||
+ m_lineEdit->clear();
|
||||
this->hide();
|
||||
}
|
||||
}
|
||||
diff --git a/src/UserInterface/full_mainwindow.h b/src/UserInterface/full_mainwindow.h
|
||||
index 34a91ca..9592169 100755
|
||||
--- a/src/UserInterface/full_mainwindow.h
|
||||
+++ b/src/UserInterface/full_mainwindow.h
|
||||
@@ -63,6 +63,7 @@ protected:
|
||||
void initLayout();
|
||||
void selectIconAnimation(const bool &flag);
|
||||
void iconAnimationFinished();
|
||||
+ void keyPressEvent(QKeyEvent *e);
|
||||
|
||||
private:
|
||||
QAction *m_allAction = nullptr;
|
||||
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
|
||||
index 4a3f7d9..1f09418 100755
|
||||
--- a/src/UserInterface/mainwindow.cpp
|
||||
+++ b/src/UserInterface/mainwindow.cpp
|
||||
@@ -319,6 +319,7 @@ void MainWindow::initSearchUi()
|
||||
m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:1px solid rgba(5, 151, 255, 1); background: transparent;"));
|
||||
m_lineEdit->setFrame(false);
|
||||
m_lineEdit->setPlaceholderText(tr("Search"));
|
||||
+ m_lineEdit->installEventFilter(this);
|
||||
m_cancelSearchPushButton = new QPushButton(m_minSearchPage);
|
||||
m_cancelSearchPushButton->setFixedSize(QSize(26, 26));
|
||||
// m_cancelSearchPushButton->setStyleSheet(m_buttonStyle.arg("QPushButton"));
|
||||
@@ -570,6 +571,7 @@ void MainWindow::initUi()
|
||||
connect(m_minFuncListView, &ListView::sendUpdateAppListSignal, this, &MainWindow::updateView);
|
||||
connect(m_minLetterListView, &ListView::sendUpdateAppListSignal, this, &MainWindow::updateView);
|
||||
connect(m_minSearchResultListView, &ListView::sendUpdateAppListSignal, this, &MainWindow::updateView);
|
||||
+ connect(m_collectListView, &RightListView::sendUpdateAppListSignal, this, &MainWindow::updateView);
|
||||
connect(m_minAllListView, &ListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView);
|
||||
connect(m_minFuncListView, &ListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView);
|
||||
connect(m_minSearchResultListView, &ListView::sendCollectViewUpdate, this, &MainWindow::updateCollectView);
|
||||
@@ -1012,6 +1014,13 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
+ if (target == m_lineEdit) {
|
||||
+ if (ke->key() == Qt::Key_Down) {
|
||||
+ m_minSearchResultListView->setFocus();
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (target == m_minSelectButton) {
|
||||
if (ke->key() == Qt::Key_Down) {
|
||||
if (m_state == 0) {
|
||||
@@ -1099,6 +1108,7 @@ void MainWindow::recvSearchResult(QVector<QStringList> arg)
|
||||
m_searchAppThread->quit();
|
||||
QVector<QStringList> m_data;
|
||||
m_data.clear();
|
||||
+ m_minSearchResultListView->verticalScrollBar()->setSliderPosition(0);
|
||||
m_minSearchResultListView->addData(m_data, 3);
|
||||
|
||||
Q_FOREACH (QStringList appinfo, arg) {
|
||||
@@ -1240,14 +1250,16 @@ void MainWindow::on_minMaxChangeButton_clicked()
|
||||
m_canHide = true;
|
||||
m_isFullScreen = true;
|
||||
|
||||
- m_animationPage->show();
|
||||
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
|
||||
- kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(this->x(), this->y(), Style::minw, Style::minh));
|
||||
+ m_maxAnimation->setDuration(1);
|
||||
} else {
|
||||
+ m_animationPage->show();
|
||||
m_animationPage->setGeometry(this->x(), this->y(), Style::minw, Style::minh);
|
||||
+ m_animationPage->raise();
|
||||
+ m_animationPage->repaint();
|
||||
+ m_maxAnimation->setDuration(260);
|
||||
}
|
||||
- m_animationPage->raise();
|
||||
- m_animationPage->repaint();
|
||||
+
|
||||
QEventLoop loop;
|
||||
QTimer::singleShot(100, &loop, SLOT(quit()));
|
||||
loop.exec();
|
||||
@@ -1255,7 +1267,7 @@ void MainWindow::on_minMaxChangeButton_clicked()
|
||||
// m_maxAnimation->setStartValue(QRect(Style::m_primaryScreenX, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh, Style::minw, Style::minh));
|
||||
m_maxAnimation->setStartValue(QRect(this->x(), this->y(), Style::minw, Style::minh));
|
||||
m_maxAnimation->setEndValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
|
||||
- m_maxAnimation->setDuration(260);
|
||||
+
|
||||
m_maxAnimation->start();
|
||||
this->hide();
|
||||
}
|
||||
@@ -1354,13 +1366,17 @@ void MainWindow::repaintWidget()
|
||||
void MainWindow::showNormalWindowSlot()
|
||||
{
|
||||
myDebug() << "Style::m_availableScreenWidth" << Style::m_availableScreenWidth << "Style::m_availableScreenHeight" << Style::m_availableScreenHeight;
|
||||
- m_animationPage->show();
|
||||
+
|
||||
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
|
||||
- kdk::WindowManager::setGeometry(m_animationPage->windowHandle(), QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
|
||||
+ m_minAnimation->setDuration(1);
|
||||
} else {
|
||||
+ m_animationPage->show();
|
||||
m_animationPage->setGeometry(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight);
|
||||
+ m_animationPage->raise();
|
||||
+ m_animationPage->repaint();
|
||||
+ m_minAnimation->setDuration(260);
|
||||
}
|
||||
- m_animationPage->raise();
|
||||
+
|
||||
myDebug() << m_animationPage->rect();
|
||||
QEventLoop loop;
|
||||
QTimer::singleShot(100, &loop, SLOT(quit()));
|
||||
@@ -1369,7 +1385,7 @@ void MainWindow::showNormalWindowSlot()
|
||||
m_minAnimation->setEasingCurve(QEasingCurve::OutExpo);
|
||||
m_minAnimation->setStartValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight));
|
||||
m_minAnimation->setEndValue(QRect(this->x(), this->y(), Style::minw, Style::minh));
|
||||
- m_minAnimation->setDuration(260);
|
||||
+
|
||||
m_minAnimation->start();
|
||||
m_fullWindow->hide();
|
||||
}
|
||||
599
0007-changelog.patch
Normal file
599
0007-changelog.patch
Normal file
@ -0,0 +1,599 @@
|
||||
From: lixueman <lixueman@kylinos.cn>
|
||||
Date: Thu, 21 Jul 2022 14:00:38 +0800
|
||||
Subject: =?utf-8?b?5L+u5pS5Y2hhbmdlbG9n5L+h5oGv?=
|
||||
|
||||
---
|
||||
.../Button/function_classify_button.cpp | 83 +++++++++-------------
|
||||
.../Button/function_classify_button.h | 3 -
|
||||
.../Button/letter_classify_button.cpp | 55 ++++++++++----
|
||||
src/UserInterface/Button/letter_classify_button.h | 2 +-
|
||||
src/UserInterface/Widget/full_commonuse_widget.cpp | 14 ++--
|
||||
src/UserInterface/Widget/full_function_widget.cpp | 14 ++--
|
||||
src/UserInterface/Widget/full_letter_widget.cpp | 16 +++--
|
||||
.../Widget/full_searchresult_widget.cpp | 14 ++--
|
||||
.../Widget/function_button_widget.cpp | 6 +-
|
||||
src/UserInterface/Widget/letter_button_widget.cpp | 6 +-
|
||||
src/UserInterface/full_mainwindow.cpp | 14 ++--
|
||||
src/UserInterface/mainwindow.cpp | 35 ++++-----
|
||||
12 files changed, 146 insertions(+), 116 deletions(-)
|
||||
|
||||
diff --git a/src/UserInterface/Button/function_classify_button.cpp b/src/UserInterface/Button/function_classify_button.cpp
|
||||
index 2494be4..8ddabe1 100755
|
||||
--- a/src/UserInterface/Button/function_classify_button.cpp
|
||||
+++ b/src/UserInterface/Button/function_classify_button.cpp
|
||||
@@ -36,23 +36,11 @@ FunctionClassifyButton::FunctionClassifyButton(int width,
|
||||
m_iconSize(iconSize),
|
||||
m_category(category),
|
||||
m_fullscreen(fullscreen),
|
||||
- m_enabled(enabled),
|
||||
- m_iconLabel(new QLabel),
|
||||
- m_textLabel(new QLabel)
|
||||
+ m_enabled(enabled)
|
||||
{
|
||||
this->setFlat(true);
|
||||
this->setFixedSize(m_width, m_height);
|
||||
this->setFocusPolicy(Qt::NoFocus);
|
||||
- m_iconLabel->setFixedSize(m_iconSize, m_iconSize);
|
||||
- m_textLabel->adjustSize();
|
||||
- m_textLabel->setText(m_category);
|
||||
- m_textLabel->setAlignment(Qt::AlignCenter);
|
||||
-
|
||||
- if (m_fullscreen) {
|
||||
- QPalette pe = m_textLabel->palette();
|
||||
- pe.setColor(QPalette::ButtonText, Qt::white);
|
||||
- m_textLabel->setPalette(pe);
|
||||
- }
|
||||
|
||||
if (m_fullscreen) {
|
||||
updateIconState(Normal);
|
||||
@@ -67,12 +55,6 @@ FunctionClassifyButton::FunctionClassifyButton(int width,
|
||||
this->setCheckable(false);
|
||||
}
|
||||
|
||||
- QHBoxLayout *mainlayout = new QHBoxLayout;
|
||||
- mainlayout->setContentsMargins(0, 0, 0, 0);
|
||||
- mainlayout->setSpacing(Style::LeftSpaceIconText);
|
||||
- this->setLayout(mainlayout);
|
||||
-// mainlayout->addWidget(m_iconLabel);
|
||||
- mainlayout->addWidget(m_textLabel);
|
||||
connect(this, &FunctionClassifyButton::toggled, this, &FunctionClassifyButton::reactToToggle);
|
||||
connect(this, &FunctionClassifyButton::clicked, this, &FunctionClassifyButton::buttonClickedSlot);
|
||||
}
|
||||
@@ -115,6 +97,37 @@ void FunctionClassifyButton::paintEvent(QPaintEvent *e)
|
||||
painter.restore();
|
||||
}
|
||||
|
||||
+ if (!(option.state & QStyle::State_Enabled)) {
|
||||
+ painter.save();
|
||||
+ QColor color;
|
||||
+ if (!m_fullscreen) {
|
||||
+ if ( g_curStyle == "ukui-light") {
|
||||
+ color = Qt::black;
|
||||
+ } else {
|
||||
+ color = Qt::white;
|
||||
+ }
|
||||
+ color.setAlphaF(0.2);
|
||||
+ }
|
||||
+ painter.setPen(color);
|
||||
+ painter.drawText(option.rect, Qt::AlignCenter, m_category);
|
||||
+ painter.restore();
|
||||
+ }
|
||||
+
|
||||
+ if (option.state & QStyle::State_Enabled) {
|
||||
+ painter.save();
|
||||
+ QColor color;
|
||||
+
|
||||
+ if ( g_curStyle == "ukui-light") {
|
||||
+ color = Qt::black;
|
||||
+ } else {
|
||||
+ color = Qt::white;
|
||||
+ }
|
||||
+ color.setAlphaF(0.9);
|
||||
+ painter.setPen(color);
|
||||
+ painter.drawText(option.rect, Qt::AlignCenter, m_category);
|
||||
+ painter.restore();
|
||||
+ }
|
||||
+
|
||||
if (m_fullscreen && (option.state & QStyle::State_On)) {
|
||||
painter.save();
|
||||
painter.setPen(Qt::NoPen);
|
||||
@@ -265,37 +278,7 @@ void FunctionClassifyButton::updateIconState(const FunctionClassifyButton::State
|
||||
// }
|
||||
// pixmap.setDevicePixelRatio(qApp->devicePixelRatio());
|
||||
// m_iconLabel->setPixmap(pixmap);
|
||||
- updateTextState(state);
|
||||
+// updateTextState(state);
|
||||
}
|
||||
|
||||
-void FunctionClassifyButton::updateTextState(const FunctionClassifyButton::State state)
|
||||
-{
|
||||
- // QPalette p= m_textLabel->palette();
|
||||
- switch (state) {
|
||||
- case Enabled:
|
||||
- // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1));
|
||||
- // m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255);");
|
||||
- break;
|
||||
-
|
||||
- case Disabled:
|
||||
- // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1, 0.25));
|
||||
- // m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255, 25%);");
|
||||
- break;
|
||||
-
|
||||
- case Normal:
|
||||
- // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1, 0.50));
|
||||
- // m_textLabel->setStyleSheet("background:transparent; color:rgba(255, 255, 255, 50%);");
|
||||
- break;
|
||||
|
||||
- case Checked:
|
||||
- // p.setColor(QPalette::WindowText,QColor::fromRgbF(1, 1, 1));
|
||||
- // m_textLabel->setStyleSheet("background:transparent;color:rgba(255, 255, 255);");
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- // p.setColor(QPalette::Window,Qt::transparent);
|
||||
- // m_textLabel->setPalette(p);
|
||||
-}
|
||||
diff --git a/src/UserInterface/Button/function_classify_button.h b/src/UserInterface/Button/function_classify_button.h
|
||||
index e99f2c3..6160fb9 100755
|
||||
--- a/src/UserInterface/Button/function_classify_button.h
|
||||
+++ b/src/UserInterface/Button/function_classify_button.h
|
||||
@@ -58,8 +58,6 @@ public:
|
||||
QString m_category;
|
||||
bool m_fullscreen;
|
||||
bool m_enabled;
|
||||
- QLabel *m_iconLabel = nullptr;
|
||||
- QLabel *m_textLabel = nullptr;
|
||||
State m_state = Checked;
|
||||
|
||||
void updateBtnState();
|
||||
@@ -70,7 +68,6 @@ protected:
|
||||
void leaveEvent(QEvent *e);
|
||||
void paintEvent(QPaintEvent *e);
|
||||
void updateIconState(const State state);
|
||||
- void updateTextState(const State state);
|
||||
|
||||
Q_SIGNALS:
|
||||
void buttonClicked();
|
||||
diff --git a/src/UserInterface/Button/letter_classify_button.cpp b/src/UserInterface/Button/letter_classify_button.cpp
|
||||
index 5bc882f..624c38e 100755
|
||||
--- a/src/UserInterface/Button/letter_classify_button.cpp
|
||||
+++ b/src/UserInterface/Button/letter_classify_button.cpp
|
||||
@@ -28,17 +28,17 @@ LetterClassifyButton::LetterClassifyButton(QWidget *parent,
|
||||
m_fullscreen(fullscreen)
|
||||
{
|
||||
this->setFlat(true);
|
||||
-
|
||||
- if (m_fullscreen) {
|
||||
- QFont font;
|
||||
- font.setPixelSize(Style::LeftLetterFontSize);
|
||||
- this->setFont(font);
|
||||
- QPalette pe = this->palette();
|
||||
- pe.setColor(QPalette::ButtonText, Qt::white);
|
||||
- this->setPalette(pe);
|
||||
- }
|
||||
-
|
||||
- this->setText(letter);
|
||||
+ m_letter = letter;
|
||||
+// if (m_fullscreen) {
|
||||
+// QFont font;
|
||||
+// font.setPixelSize(Style::LeftLetterFontSize);
|
||||
+// this->setFont(font);
|
||||
+// QPalette pe = this->palette();
|
||||
+// pe.setColor(QPalette::ButtonText, Qt::white);
|
||||
+// this->setPalette(pe);
|
||||
+// }
|
||||
+
|
||||
+// this->setText(letter);
|
||||
this->setFocusPolicy(Qt::NoFocus);
|
||||
this->setCheckable(true);
|
||||
this->setStyleSheet("padding: 0px;");
|
||||
@@ -82,6 +82,37 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e)
|
||||
painter.restore();
|
||||
}
|
||||
|
||||
+ if (!(option.state & QStyle::State_Enabled)) {
|
||||
+ painter.save();
|
||||
+ QColor color;
|
||||
+ if (!m_fullscreen) {
|
||||
+ if ( g_curStyle == "ukui-light") {
|
||||
+ color = Qt::black;
|
||||
+ } else {
|
||||
+ color = Qt::white;
|
||||
+ }
|
||||
+ color.setAlphaF(0.2);
|
||||
+ }
|
||||
+ painter.setPen(color);
|
||||
+ painter.drawText(option.rect, Qt::AlignCenter, m_letter);
|
||||
+ painter.restore();
|
||||
+ }
|
||||
+
|
||||
+ if (option.state & QStyle::State_Enabled) {
|
||||
+ painter.save();
|
||||
+ QColor color;
|
||||
+
|
||||
+ if ( g_curStyle == "ukui-light") {
|
||||
+ color = Qt::black;
|
||||
+ } else {
|
||||
+ color = Qt::white;
|
||||
+ }
|
||||
+ color.setAlphaF(0.9);
|
||||
+ painter.setPen(color);
|
||||
+ painter.drawText(option.rect, Qt::AlignCenter, m_letter);
|
||||
+ painter.restore();
|
||||
+ }
|
||||
+
|
||||
if (m_fullscreen && (option.state & QStyle::State_On)) {
|
||||
painter.save();
|
||||
painter.setPen(Qt::NoPen);
|
||||
@@ -118,7 +149,7 @@ void LetterClassifyButton::enterEvent(QEvent *e)
|
||||
// this->setFixedSize(Style::LeftLetterBtnHeight*2,Style::LeftLetterBtnHeight*2);
|
||||
tooltip = new LetterToolTip();
|
||||
QPoint oPoint = this->mapToGlobal(QPoint(this->rect().x() + 35, this->rect().y() - 10));
|
||||
- tooltip->setText(this->text());
|
||||
+ tooltip->setText(m_letter);
|
||||
tooltip->raise();
|
||||
tooltip->move(oPoint);
|
||||
tooltip->show();
|
||||
diff --git a/src/UserInterface/Button/letter_classify_button.h b/src/UserInterface/Button/letter_classify_button.h
|
||||
index b6b2a3d..7235987 100755
|
||||
--- a/src/UserInterface/Button/letter_classify_button.h
|
||||
+++ b/src/UserInterface/Button/letter_classify_button.h
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
);
|
||||
|
||||
bool is_pressed = false;
|
||||
-
|
||||
+ QString m_letter = QString();
|
||||
private:
|
||||
bool m_fullscreen = false;
|
||||
LetterToolTip *tooltip = nullptr;
|
||||
diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp
|
||||
index c02f317..26d86b5 100755
|
||||
--- a/src/UserInterface/Widget/full_commonuse_widget.cpp
|
||||
+++ b/src/UserInterface/Widget/full_commonuse_widget.cpp
|
||||
@@ -119,13 +119,13 @@ void FullCommonUseWidget::initVerticalScrollBar()
|
||||
m_verticalScrollBar->show();
|
||||
}
|
||||
|
||||
- m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); "
|
||||
+ m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
|
||||
"margin: 0px,0px,0px,0px; border-radius: %3px;}"
|
||||
- "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);"
|
||||
+ "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
|
||||
"border-radius: %3px; min-height: %1;}"
|
||||
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
|
||||
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
|
||||
}
|
||||
|
||||
void FullCommonUseWidget::on_powerOffButton_clicked()
|
||||
@@ -219,11 +219,15 @@ bool FullCommonUseWidget::eventFilter(QObject *watched, QEvent *event)
|
||||
|
||||
if (watched == m_verticalScrollBar) {
|
||||
if (event->type() == QEvent::Enter) {
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
|
||||
}
|
||||
|
||||
if (event->type() == QEvent::Leave) {
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
|
||||
+ }
|
||||
+
|
||||
+ if(event->type() == QEvent::MouseButtonPress) {
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp
|
||||
index fd124e4..7cc8464 100755
|
||||
--- a/src/UserInterface/Widget/full_function_widget.cpp
|
||||
+++ b/src/UserInterface/Widget/full_function_widget.cpp
|
||||
@@ -139,13 +139,13 @@ void FullFunctionWidget::initVerticalScrollBar()
|
||||
m_verticalScrollBar->show();
|
||||
}
|
||||
|
||||
- m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); "
|
||||
+ m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
|
||||
"margin: 0px,0px,0px,0px; border-radius: %3px;}"
|
||||
- "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);"
|
||||
+ "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
|
||||
"border-radius: %3px; min-height: %1;}"
|
||||
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
|
||||
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
|
||||
}
|
||||
|
||||
void FullFunctionWidget::on_powerOffButton_clicked()
|
||||
@@ -505,11 +505,15 @@ bool FullFunctionWidget::eventFilter(QObject *watched, QEvent *event)
|
||||
if (watched == m_verticalScrollBar) {
|
||||
if (watched == m_verticalScrollBar) {
|
||||
if (event->type() == QEvent::Enter) {
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
|
||||
}
|
||||
|
||||
if (event->type() == QEvent::Leave) {
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
|
||||
+ }
|
||||
+
|
||||
+ if(event->type() == QEvent::MouseButtonPress) {
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp
|
||||
index 45fb165..1ebc2c5 100755
|
||||
--- a/src/UserInterface/Widget/full_letter_widget.cpp
|
||||
+++ b/src/UserInterface/Widget/full_letter_widget.cpp
|
||||
@@ -133,13 +133,13 @@ void FullLetterWidget::initVerticalScrollBar()
|
||||
m_verticalScrollBar->show();
|
||||
}
|
||||
|
||||
- m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); "
|
||||
+ m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
|
||||
"margin: 0px,0px,0px,0px; border-radius: %3px;}"
|
||||
- "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);"
|
||||
+ "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
|
||||
"border-radius: %3px; min-height: %1;}"
|
||||
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
|
||||
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
|
||||
}
|
||||
|
||||
void FullLetterWidget::on_powerOffButton_clicked()
|
||||
@@ -379,7 +379,7 @@ void FullLetterWidget::btnGroupClickedSlot(QAbstractButton *btn)
|
||||
if (m_btnGroup->id(btn) == m_buttonList.indexOf(button)) {
|
||||
letterbtn->setChecked(true);
|
||||
//此处需实现将被选定的字母包含的应用列表移动到applistWid界面最顶端
|
||||
- QString letterstr = letterbtn->text();
|
||||
+ QString letterstr = letterbtn->m_letter;
|
||||
int num = m_letterList.indexOf(letterstr);
|
||||
|
||||
if (num != -1) {
|
||||
@@ -531,11 +531,15 @@ bool FullLetterWidget::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (watched == m_verticalScrollBar) {
|
||||
if (event->type() == QEvent::Enter) {
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
|
||||
}
|
||||
|
||||
if (event->type() == QEvent::Leave) {
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
|
||||
+ }
|
||||
+
|
||||
+ if(event->type() == QEvent::MouseButtonPress) {
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
|
||||
}
|
||||
} else {
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp
|
||||
index be5dd6b..efdee49 100755
|
||||
--- a/src/UserInterface/Widget/full_searchresult_widget.cpp
|
||||
+++ b/src/UserInterface/Widget/full_searchresult_widget.cpp
|
||||
@@ -108,13 +108,13 @@ void FullSearchResultWidget::initVerticalScrollBar()
|
||||
m_verticalScrollBar->show();
|
||||
}
|
||||
|
||||
- m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); "
|
||||
+ m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
|
||||
"margin: 0px,0px,0px,0px; border-radius: %3px;}"
|
||||
- "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);"
|
||||
+ "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
|
||||
"border-radius: %3px; min-height: %1;}"
|
||||
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
|
||||
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
|
||||
}
|
||||
|
||||
void FullSearchResultWidget::on_powerOffButton_clicked()
|
||||
@@ -204,11 +204,15 @@ bool FullSearchResultWidget::eventFilter(QObject *watched, QEvent *event)
|
||||
|
||||
if (watched == m_verticalScrollBar) {
|
||||
if (event->type() == QEvent::Enter) {
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
|
||||
}
|
||||
|
||||
if (event->type() == QEvent::Leave) {
|
||||
- m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2));
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
|
||||
+ }
|
||||
+
|
||||
+ if(event->type() == QEvent::MouseButtonPress) {
|
||||
+ m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/UserInterface/Widget/function_button_widget.cpp b/src/UserInterface/Widget/function_button_widget.cpp
|
||||
index cd7b8f8..dbb116c 100755
|
||||
--- a/src/UserInterface/Widget/function_button_widget.cpp
|
||||
+++ b/src/UserInterface/Widget/function_button_widget.cpp
|
||||
@@ -76,7 +76,7 @@ void FunctionButtonWidget::initUi()
|
||||
Q_FOREACH (QAbstractButton *btn, m_buttonList)
|
||||
{
|
||||
FunctionClassifyButton *fbtn = qobject_cast<FunctionClassifyButton *>(btn);
|
||||
- fbtn->updateIconState();
|
||||
+ fbtn->updateBtnState();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -88,9 +88,7 @@ void FunctionButtonWidget::initUi()
|
||||
void FunctionButtonWidget::functionBtnClickedSlot()
|
||||
{
|
||||
FunctionClassifyButton *btn = dynamic_cast<FunctionClassifyButton *>(sender());
|
||||
- QWidget *wid = btn->layout()->itemAt(0)->widget();
|
||||
- QLabel *label = qobject_cast<QLabel *>(wid);
|
||||
- Q_EMIT sendFunctionBtnSignal(label->text());
|
||||
+ Q_EMIT sendFunctionBtnSignal(btn->m_category);
|
||||
}
|
||||
|
||||
void FunctionButtonWidget::hideEvent(QHideEvent *event)
|
||||
diff --git a/src/UserInterface/Widget/letter_button_widget.cpp b/src/UserInterface/Widget/letter_button_widget.cpp
|
||||
index 68e3a74..f110340 100755
|
||||
--- a/src/UserInterface/Widget/letter_button_widget.cpp
|
||||
+++ b/src/UserInterface/Widget/letter_button_widget.cpp
|
||||
@@ -47,7 +47,7 @@ void LetterButtonWidget::initUi()
|
||||
letterlist.append(QString(QChar(letter)));
|
||||
}
|
||||
|
||||
- letterlist.append("&&");
|
||||
+ letterlist.append("&");
|
||||
letterlist.append("#");
|
||||
|
||||
for (int row = 0; row < 6; row++) {
|
||||
@@ -78,7 +78,7 @@ void LetterButtonWidget::hideEvent(QHideEvent *event)
|
||||
void LetterButtonWidget::letterBtnClickedSlot()
|
||||
{
|
||||
LetterClassifyButton *btn = dynamic_cast<LetterClassifyButton *>(QObject::sender());
|
||||
- QString btnname = btn->text();
|
||||
+ QString btnname = btn->m_letter;
|
||||
Q_EMIT sendLetterBtnSignal(btnname);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ void LetterButtonWidget::recvLetterBtnList(QStringList list)
|
||||
for (int col = 0; col < 4; col++) {
|
||||
QLayoutItem *item = gridLayout->itemAt(row * 4 + col);
|
||||
LetterClassifyButton *btn = static_cast<LetterClassifyButton *>(item->widget());
|
||||
- QString letterstr = btn->text();
|
||||
+ QString letterstr = btn->m_letter;
|
||||
|
||||
if (list.indexOf(letterstr.at(0)) == -1) {
|
||||
btn->setEnabled(false);
|
||||
diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp
|
||||
index 3c77fd5..3ccb33f 100755
|
||||
--- a/src/UserInterface/full_mainwindow.cpp
|
||||
+++ b/src/UserInterface/full_mainwindow.cpp
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <QAction>
|
||||
#include <QTranslator>
|
||||
#include "utility.h"
|
||||
+#include <QPalette>
|
||||
|
||||
FullMainWindow::FullMainWindow(QWidget *parent) :
|
||||
QMainWindow(parent)
|
||||
@@ -290,12 +291,15 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (watched == m_lineEdit) {
|
||||
m_isSearching = true;
|
||||
- char style[200];
|
||||
+ QString style;
|
||||
|
||||
if (event->type() == QEvent::FocusIn) {
|
||||
- sprintf(style, "QLineEdit{border:2px solid %s;background-color:%s;border-radius:17px;color:#ffffff;}",
|
||||
- QueryLineEditClickedBorder, QueryLineEditClickedBackground);
|
||||
+ QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16);
|
||||
+ QString color = highLightColor.mid(2, 6);
|
||||
+ style = QString("QLineEdit{border:2px solid #%1;background-color:%2;border-radius:17px;color:#ffffff;}")
|
||||
+ .arg(color).arg(QueryLineEditClickedBackground);
|
||||
m_lineEdit->setStyleSheet(style);
|
||||
+ myDebug() <<color << style;
|
||||
|
||||
if (m_lineEdit->text().isEmpty()) {
|
||||
qDebug() << "bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)" << m_queryWid->layout()->count();
|
||||
@@ -310,8 +314,8 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)
|
||||
m_lineEdit->setTextMargins(26, 0, 0, 0);
|
||||
}
|
||||
} else if (event->type() == QEvent::FocusOut && m_lineEdit->text().isEmpty()) {
|
||||
- sprintf(style, "QLineEdit{border:1px solid %s;background-color:%s;border-radius:17px;color:#ffffff;}",
|
||||
- QueryLineEditClickedBorderDefault, QueryLineEditClickedBackground);
|
||||
+ style = QString("QLineEdit{border:1px solid %1;background-color:%2;border-radius:17px;color:#ffffff;}")
|
||||
+ .arg(QueryLineEditClickedBorderDefault).arg(QueryLineEditClickedBackground);
|
||||
m_lineEdit->setStyleSheet(style);
|
||||
resetEditline();
|
||||
}
|
||||
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
|
||||
index 1f09418..cc67dcb 100755
|
||||
--- a/src/UserInterface/mainwindow.cpp
|
||||
+++ b/src/UserInterface/mainwindow.cpp
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <QGroupBox>
|
||||
#include <QEventLoop>
|
||||
#include <QLabel>
|
||||
+#include <QPalette>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent)
|
||||
@@ -316,7 +317,10 @@ void MainWindow::initSearchUi()
|
||||
m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 0);
|
||||
m_lineEdit = new QLineEdit(m_minSearchPage);
|
||||
m_lineEdit->setMinimumSize(QSize(30, 26));
|
||||
- m_lineEdit->setStyleSheet(QString::fromUtf8("border-radius: 13px; border:1px solid rgba(5, 151, 255, 1); background: transparent;"));
|
||||
+ QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16);
|
||||
+ QString color = highLightColor.mid(2, 6);
|
||||
+ QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
|
||||
+ m_lineEdit->setStyleSheet(searchStyle);
|
||||
m_lineEdit->setFrame(false);
|
||||
m_lineEdit->setPlaceholderText(tr("Search"));
|
||||
m_lineEdit->installEventFilter(this);
|
||||
@@ -519,7 +523,7 @@ void MainWindow::windowOption()
|
||||
void MainWindow::initUi()
|
||||
{
|
||||
qDebug() << "init UI";
|
||||
- this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
|
||||
+ this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::BypassWindowManagerHint);
|
||||
this->setAttribute(Qt::WA_TranslucentBackground, true);
|
||||
this->setAutoFillBackground(false);
|
||||
this->setFocusPolicy(Qt::NoFocus);
|
||||
@@ -558,11 +562,10 @@ void MainWindow::initUi()
|
||||
m_dropDownMenu->addAction(m_letterAction);
|
||||
m_dropDownMenu->addAction(m_funcAction);
|
||||
m_allAction->setChecked(true);
|
||||
- m_collectPushButton->setStyleSheet("color:#3790FA;");
|
||||
- QColor textColor = this->palette().color(QPalette::Text);
|
||||
- QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue());
|
||||
- QString textColorDefault = "#" + QString::number(rgbDefault, 16);
|
||||
- m_recentPushButton->setStyleSheet(QString("color:%1;").arg(textColorDefault));
|
||||
+ QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6);
|
||||
+ m_collectPushButton->setStyleSheet(QString("color: #%1;").arg(textColorHightLight));
|
||||
+ QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6);
|
||||
+ m_recentPushButton->setStyleSheet(QString("color: #%1;").arg(textColorDefault));
|
||||
QAction *action = new QAction();
|
||||
action->setIcon(getCurIcon(":/data/img/mainviewwidget/DM-icon-search.svg", true));
|
||||
m_lineEdit->addAction(action, QLineEdit::LeadingPosition);
|
||||
@@ -1209,13 +1212,12 @@ void MainWindow::on_collectPushButton_clicked()
|
||||
{
|
||||
m_rightStackedWidget->setCurrentIndex(0);
|
||||
|
||||
- m_collectPushButton->setStyleSheet("color:#3790FA;");
|
||||
+ QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6);
|
||||
+ m_collectPushButton->setStyleSheet(QString("color:#%1;").arg(textColorHightLight));
|
||||
QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2);
|
||||
m_collectPushButton->setFont(collectFont);
|
||||
- QColor textColor = this->palette().color(QPalette::Text);
|
||||
- QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue());
|
||||
- QString textColorDefault = "#" + QString::number(rgbDefault, 16);
|
||||
- m_recentPushButton->setStyleSheet(QString("color:%1;").arg(textColorDefault));
|
||||
+ QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6);
|
||||
+ m_recentPushButton->setStyleSheet(QString("color:#%1;").arg(textColorDefault));
|
||||
QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize());
|
||||
m_recentPushButton->setFont(recentFont);
|
||||
}
|
||||
@@ -1223,13 +1225,12 @@ void MainWindow::on_collectPushButton_clicked()
|
||||
void MainWindow::on_recentPushButton_clicked()
|
||||
{
|
||||
m_rightStackedWidget->setCurrentIndex(1);
|
||||
- QColor textColor = this->palette().color(QPalette::Text);
|
||||
- QRgb rgbDefault = qRgb(textColor.red(), textColor.green(), textColor.blue());
|
||||
- QString textColorDefault = "#" + QString::number(rgbDefault, 16);
|
||||
- m_collectPushButton->setStyleSheet(QString("color:%1").arg(textColorDefault));
|
||||
+ QString textColorDefault = QString::number(this->palette().color(QPalette::Text).rgba(), 16).mid(2, 6);
|
||||
+ m_collectPushButton->setStyleSheet(QString("color:#%1").arg(textColorDefault));
|
||||
QFont collectFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize());
|
||||
m_collectPushButton->setFont(collectFont);
|
||||
- m_recentPushButton->setStyleSheet("color:#3790FA");
|
||||
+ QString textColorHightLight = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16).mid(2, 6);
|
||||
+ m_recentPushButton->setStyleSheet(QString("color:#%1").arg(textColorHightLight));
|
||||
|
||||
QFont recentFont(QGuiApplication::font().family(), QGuiApplication::font().pointSize() + 2);
|
||||
m_recentPushButton->setFont(recentFont);
|
||||
129
0008-changelog.patch
Normal file
129
0008-changelog.patch
Normal file
@ -0,0 +1,129 @@
|
||||
From: lixueman <lixueman@kylinos.cn>
|
||||
Date: Thu, 21 Jul 2022 15:36:44 +0800
|
||||
Subject: =?utf-8?b?5pu05pawY2hhbmdlbG9n5L+h5oGv?=
|
||||
|
||||
---
|
||||
src/UserInterface/Button/function_classify_button.cpp | 11 ++++++++---
|
||||
src/UserInterface/Button/letter_classify_button.cpp | 11 ++++++++---
|
||||
src/UserInterface/full_mainwindow.cpp | 9 ++++++++-
|
||||
src/UserInterface/mainwindow.cpp | 18 +++++++++++++++++-
|
||||
4 files changed, 41 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/UserInterface/Button/function_classify_button.cpp b/src/UserInterface/Button/function_classify_button.cpp
|
||||
index 8ddabe1..ffed89c 100755
|
||||
--- a/src/UserInterface/Button/function_classify_button.cpp
|
||||
+++ b/src/UserInterface/Button/function_classify_button.cpp
|
||||
@@ -117,11 +117,16 @@ void FunctionClassifyButton::paintEvent(QPaintEvent *e)
|
||||
painter.save();
|
||||
QColor color;
|
||||
|
||||
- if ( g_curStyle == "ukui-light") {
|
||||
- color = Qt::black;
|
||||
+ if (m_fullscreen) {
|
||||
+ color = Qt::white;
|
||||
} else {
|
||||
- color = Qt::white;
|
||||
+ if ( g_curStyle == "ukui-light") {
|
||||
+ color = Qt::black;
|
||||
+ } else {
|
||||
+ color = Qt::white;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
color.setAlphaF(0.9);
|
||||
painter.setPen(color);
|
||||
painter.drawText(option.rect, Qt::AlignCenter, m_category);
|
||||
diff --git a/src/UserInterface/Button/letter_classify_button.cpp b/src/UserInterface/Button/letter_classify_button.cpp
|
||||
index 624c38e..11073a8 100755
|
||||
--- a/src/UserInterface/Button/letter_classify_button.cpp
|
||||
+++ b/src/UserInterface/Button/letter_classify_button.cpp
|
||||
@@ -102,11 +102,16 @@ void LetterClassifyButton::paintEvent(QPaintEvent *e)
|
||||
painter.save();
|
||||
QColor color;
|
||||
|
||||
- if ( g_curStyle == "ukui-light") {
|
||||
- color = Qt::black;
|
||||
+ if (m_fullscreen) {
|
||||
+ color = Qt::white;
|
||||
} else {
|
||||
- color = Qt::white;
|
||||
+ if ( g_curStyle == "ukui-light") {
|
||||
+ color = Qt::black;
|
||||
+ } else {
|
||||
+ color = Qt::white;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
color.setAlphaF(0.9);
|
||||
painter.setPen(color);
|
||||
painter.drawText(option.rect, Qt::AlignCenter, m_letter);
|
||||
diff --git a/src/UserInterface/full_mainwindow.cpp b/src/UserInterface/full_mainwindow.cpp
|
||||
index 3ccb33f..555c6a6 100755
|
||||
--- a/src/UserInterface/full_mainwindow.cpp
|
||||
+++ b/src/UserInterface/full_mainwindow.cpp
|
||||
@@ -123,6 +123,13 @@ void FullMainWindow::initSearchUI()
|
||||
if (key.contains(QString("styleName"))) {
|
||||
changeStyle();
|
||||
}
|
||||
+
|
||||
+ if (key.contains(QString("theme-color"))) {
|
||||
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
|
||||
+ QString color = highLightColor.mid(2, 6);
|
||||
+ QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
|
||||
+ m_lineEdit->setStyleSheet(searchStyle);
|
||||
+ }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -294,7 +301,7 @@ bool FullMainWindow::eventFilter(QObject *watched, QEvent *event)
|
||||
QString style;
|
||||
|
||||
if (event->type() == QEvent::FocusIn) {
|
||||
- QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16);
|
||||
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
|
||||
QString color = highLightColor.mid(2, 6);
|
||||
style = QString("QLineEdit{border:2px solid #%1;background-color:%2;border-radius:17px;color:#ffffff;}")
|
||||
.arg(color).arg(QueryLineEditClickedBackground);
|
||||
diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp
|
||||
index cc67dcb..355a8bd 100755
|
||||
--- a/src/UserInterface/mainwindow.cpp
|
||||
+++ b/src/UserInterface/mainwindow.cpp
|
||||
@@ -275,6 +275,13 @@ void MainWindow::initGsettings()
|
||||
if (key.contains(QString("styleName"))) {
|
||||
changeStyle();
|
||||
}
|
||||
+
|
||||
+ if (key.contains(QString("theme-color"))) {
|
||||
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
|
||||
+ QString color = highLightColor.mid(2, 6);
|
||||
+ QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
|
||||
+ m_lineEdit->setStyleSheet(searchStyle);
|
||||
+ }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -317,7 +324,7 @@ void MainWindow::initSearchUi()
|
||||
m_leftTopSearchHorizontalLayout->setContentsMargins(8, 0, 8, 0);
|
||||
m_lineEdit = new QLineEdit(m_minSearchPage);
|
||||
m_lineEdit->setMinimumSize(QSize(30, 26));
|
||||
- QString highLightColor = QString::number(m_lineEdit->palette().color(QPalette::Highlight).rgba(), 16);
|
||||
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
|
||||
QString color = highLightColor.mid(2, 6);
|
||||
QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
|
||||
m_lineEdit->setStyleSheet(searchStyle);
|
||||
@@ -942,6 +949,15 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
+ if (target == m_lineEdit) {
|
||||
+ if (event->type() == QEvent::FocusIn) {
|
||||
+ QString highLightColor = QString::number(this->palette().color(QPalette::Highlight).rgba(), 16);
|
||||
+ QString color = highLightColor.mid(2, 6);
|
||||
+ QString searchStyle = QString("border-radius: 13px; border:1px solid #%1; background: transparent;").arg(color);
|
||||
+ m_lineEdit->setStyleSheet(searchStyle);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *ke = (QKeyEvent *)event;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: ukui-menu
|
||||
Version: 3.1.1
|
||||
Release: 9
|
||||
Release: 10
|
||||
Summary: Advanced ukui menu
|
||||
License: GPL-3.0-or-later
|
||||
URL: http://www.ukui.org
|
||||
@ -13,6 +13,9 @@ patch05: 0002-5-platformName-update-debian-changelog.-platformName.patch
|
||||
patch06: 0003-.patch
|
||||
patch07: 0004-7-close-cd-128489.patch
|
||||
patch08: 0005-8-wayland.patch
|
||||
patch09: 0006-changelog.patch
|
||||
patch10: 0007-changelog.patch
|
||||
patch11: 0008-changelog.patch
|
||||
|
||||
BuildRequires: qt5-qtbase-devel
|
||||
BuildRequires: libqtxdg-devel
|
||||
@ -65,6 +68,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_datadir}/ukui-menu/translations/
|
||||
|
||||
%changelog
|
||||
* Fri May 12 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-10
|
||||
- add 0006-changelog.patch 0007-changelog.patch 0008-changelog.patch
|
||||
|
||||
* Tue Feb 21 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.1-9
|
||||
- add 0005-8-wayland.patch
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user