Skip to content

Commit

Permalink
feat: Adjust ui style
Browse files Browse the repository at this point in the history
  • Loading branch information
Clauszy committed Nov 19, 2024
1 parent 7b9220a commit 9754faf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/grand-search/gui/entrance/entrancewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,17 @@ void EntranceWidget::initUI()

QPalette palette;
QColor colorText(0, 0, 0);
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType)
QColor colorBkg(0, 0, 0, 25);
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType) {
colorText = QColor(255, 255, 255);

palette.setColor(QPalette::Button, Qt::transparent);
colorBkg = QColor(255, 255, 255, 25);
}
palette.setColor(QPalette::Button, colorBkg); // 背景色
palette.setColor(QPalette::Text, colorText);
palette.setColor(QPalette::ButtonText, colorText);

d_p->m_lineEdit->setPalette(palette);
DStyle::setFocusRectVisible(d_p->m_lineEdit, true);
DStyle::setFocusRectVisible(d_p->m_lineEdit, false);

d_p->m_appIconLabel = new DLabel(d_p->m_searchEdit);
d_p->m_appIconLabel->setFixedSize(LabelSize, LabelSize);
Expand Down
5 changes: 5 additions & 0 deletions src/grand-search/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <DApplication>
#include <DLabel>
#include <DRegionMonitor>
#include <DPlatformHandle>

#include <QDebug>
#include <QTimer>
Expand Down Expand Up @@ -219,6 +220,10 @@ void MainWindow::initUI()
d_p->m_mainLayout->setMargin(0);

this->setLayout(d_p->m_mainLayout);

this->winId();
DPlatformHandle handle(this->windowHandle());
handle.setWindowRadius(18);
}

void MainWindow::initConnect()
Expand Down

0 comments on commit 9754faf

Please sign in to comment.