Skip to content

Commit 8555e05

Browse files
committed
fix: 修复一些小问题;
1 parent 86740fe commit 8555e05

File tree

8 files changed

+41
-17
lines changed

8 files changed

+41
-17
lines changed

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Declare files that will always have LF line endings on checkout.
2+
*.cpp text eol=lf
3+
*.h text eol=lf
4+
*.c text eol=lf
5+
*.hpp text eol=lf
6+
*.cmake text eol=lf
7+
*.sh text eol=lf
8+
*.py text eol=lf
9+
*.ts text eol=lf
10+

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ if(WINGHEX_ANGEL_LSP)
785785
COMMAND ${CMAKE_COMMAND} -E echo
786786
"[3] packaging with pkg/npm exec/npx"
787787
COMMAND ${PKG_CMD}
788-
COMMENT "[4] Packaging with pkg"
788+
COMMAND ${CMAKE_COMMAND} -E echo "[4] Packaging with pkg"
789789
COMMAND ${CMAKE_COMMAND} -E copy "${NODE_ROOT_SUBDIR}/package.json"
790790
"${BUILD_BIN_DIR}"
791791
COMMAND ${CMAKE_COMMAND} -E copy "${NODE_SUBDIR}/modIcon_win.js"
@@ -795,7 +795,7 @@ if(WINGHEX_ANGEL_LSP)
795795
COMMAND ${NODE_EXE} "${BUILD_BIN_DIR}/modIcon_win.js"
796796
COMMAND ${CMAKE_COMMAND} -E remove "${BUILD_BIN_DIR}/modIcon_win.js"
797797
"${BUILD_BIN_DIR}/icon.ico" "${BUILD_BIN_DIR}/package.json"
798-
COMMENT "[5] Modifying exe icon"
798+
COMMAND ${CMAKE_COMMAND} -E echo "[5] Modifying exe icon"
799799
VERBATIM)
800800
else()
801801
add_custom_command(
@@ -807,7 +807,7 @@ if(WINGHEX_ANGEL_LSP)
807807
COMMAND ${CMAKE_COMMAND} -E echo
808808
"[3] packaging with pkg/npm exec/npx"
809809
COMMAND ${PKG_CMD}
810-
COMMENT "[4] Packaging with pkg"
810+
COMMAND ${CMAKE_COMMAND} -E echo "[4] Packaging with pkg"
811811
VERBATIM)
812812
endif()
813813

src/class/framelesshelper.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <QVBoxLayout>
2626
#include <QWKWidgets/widgetwindowagent.h>
2727

28+
#include "skinmanager.h"
29+
2830
FramelessHelper::FramelessHelper(QWidget *parent, bool isDialog)
2931
: QObject(parent) {
3032
Q_ASSERT(parent);
@@ -80,6 +82,12 @@ FramelessHelper::FramelessHelper(QWidget *parent, bool isDialog)
8082

8183
windowAgent->setHitTestVisible(m_windowBar, false);
8284

85+
#ifdef Q_OS_WIN
86+
windowAgent->setWindowAttribute(QStringLiteral("dark-mode"),
87+
SkinManager::instance().currentTheme() ==
88+
SkinManager::Theme::Dark);
89+
#endif
90+
8391
#ifndef Q_OS_MAC
8492
connect(m_windowBar, &QWK::WindowBar::minimizeRequested, parent,
8593
&QWidget::showMinimized);

src/control/toast.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void Toast::setToastPos(TOAST_POS pos) {
8787

8888
auto font = this->displayFont();
8989
auto metric = QFontMetricsF(font);
90-
auto ICON_PADDING = fontsize.height() + metric.horizontalAdvance(' ');
90+
auto ICON_PADDING = metric.height() + metric.horizontalAdvance(' ');
9191

9292
QSizeF windowSize;
9393
if (m_icon.isNull()) {
@@ -111,8 +111,8 @@ void Toast::setToastPos(TOAST_POS pos) {
111111

112112
m_pos = pos;
113113

114-
setGeometry(int(windowsX), int(windowsY), int(windowSize.width()),
115-
int(windowSize.height()));
114+
setGeometry(qRound(windowsX), qRound(windowsY), qCeil(windowSize.width()),
115+
qCeil(windowSize.height()));
116116
}
117117

118118
Toast::TOAST_POS Toast::lastToastPos() const { return m_pos; }
@@ -136,12 +136,11 @@ void Toast::paintEvent(QPaintEvent *) {
136136
auto ICON_PADDING = metric.horizontalAdvance(' ');
137137
if (m_icon.isNull()) {
138138
painter.setPen(textPen);
139-
QRectF rect(PADDING, PADDING,
140-
widgetSize.width() - PADDING - PADDING / 2,
139+
QRectF rect(PADDING, PADDING, widgetSize.width() - PADDING - PADDING,
141140
widgetSize.height() - PADDING - PADDING);
142141
painter.drawText(rect, metric.elidedText(m_strContent,
143142
Qt::TextElideMode::ElideRight,
144-
rect.width() + PADDING / 2));
143+
rect.width()));
145144
} else {
146145
painter.drawPixmap(QRectF(PADDING, PADDING, ICON_SIZE, ICON_SIZE),
147146
m_icon, {});

theme/dark/stylesheet.qss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,9 +2823,14 @@ QAbstractButton#qt_dockwidget_floatbutton
28232823
* ---------------
28242824
*/
28252825

2826-
QWK--WindowBar
2826+
QWK--WindowBar[bar-active=true]
28272827
{
2828-
background-color: rgb(29, 32, 35)
2828+
background-color: #15181A;
2829+
}
2830+
2831+
QWK--WindowBar[bar-active=false]
2832+
{
2833+
background-color: #1D2023;
28292834
}
28302835

28312836
QWK--WindowBar>QLabel#win-title-label {

theme/light/stylesheet.qss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,12 +2823,14 @@ QAbstractButton#qt_dockwidget_floatbutton
28232823
* ---------------
28242824
*/
28252825

2826-
QWK--WindowBar[bar-active=true] {
2827-
background-color: #195ABE;
2826+
QWK--WindowBar[bar-active=true]
2827+
{
2828+
background-color: #8DADDF;
28282829
}
28292830

2830-
QWK--WindowBar[bar-active=false] {
2831-
background-color: #195ABE;
2831+
QWK--WindowBar[bar-active=false]
2832+
{
2833+
background-color: #E2EAF6;
28322834
}
28332835

28342836
QWK--WindowBar>QLabel#win-title-label {

0 commit comments

Comments
 (0)