Fix the border width of the examples
Amends commit 3aba956d66
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
3aba956d66
commit
2fafa7a433
|
@ -142,7 +142,7 @@ void MainWindow::paintEvent(QPaintEvent *event)
|
|||
|| (area == ColorizationArea::All));
|
||||
const QColor borderColor = (isActiveWindow() ? (colorizedBorder ? Utilities::getColorizationColor() : Qt::black) : Qt::darkGray);
|
||||
const auto borderThickness = static_cast<qreal>(Utilities::getWindowVisibleFrameBorderThickness(winId()));
|
||||
painter.setPen({borderColor, qMax(borderThickness, devicePixelRatioF())});
|
||||
painter.setPen({borderColor, borderThickness});
|
||||
painter.drawLines(lines);
|
||||
painter.restore();
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ Window {
|
|||
title: qsTr("Hello, World!")
|
||||
color: "#f0f0f0"
|
||||
|
||||
property real _flh_margin: ((window.visibility === Window.Maximized) | (window.visibility === Window.FullScreen)) ? 0.0 : Math.max(1.0, Screen.devicePixelRatio)
|
||||
property real _flh_margin: ((window.visibility === Window.Maximized) | (window.visibility === Window.FullScreen)) ? 0.0 : 1.0
|
||||
property var _win_prev_state: null
|
||||
|
||||
FramelessHelper {
|
||||
|
|
|
@ -158,7 +158,7 @@ void Widget::paintEvent(QPaintEvent *event)
|
|||
|| (area == ColorizationArea::All));
|
||||
const QColor borderColor = (isActiveWindow() ? (colorizedBorder ? Utilities::getColorizationColor() : Qt::black) : Qt::darkGray);
|
||||
const auto borderThickness = static_cast<qreal>(Utilities::getWindowVisibleFrameBorderThickness(winId()));
|
||||
painter.setPen({borderColor, qMax(borderThickness, devicePixelRatioF())});
|
||||
painter.setPen({borderColor, borderThickness});
|
||||
painter.drawLines(lines);
|
||||
painter.restore();
|
||||
}
|
||||
|
|
|
@ -329,7 +329,7 @@ int Utilities::getWindowVisibleFrameBorderThickness(const WId winId)
|
|||
const HRESULT hr = DwmGetWindowAttribute(hWnd, _DWMWA_VISIBLE_FRAME_BORDER_THICKNESS, &value, sizeof(value));
|
||||
if (SUCCEEDED(hr)) {
|
||||
const QWindow *w = findWindow(winId);
|
||||
return static_cast<int>(qRound(static_cast<qreal>(value) * (w ? w->devicePixelRatio() : 1.0)));
|
||||
return static_cast<int>(qRound(static_cast<qreal>(value) / (w ? w->devicePixelRatio() : 1.0)));
|
||||
} else {
|
||||
// We just eat this error because this enum value was introduced in a very
|
||||
// late Windows 10 version, so querying it's value will always result in
|
||||
|
|
Loading…
Reference in New Issue