Compare commits
No commits in common. "3bb8f8000bf3300097ad54030a755e87ce12f8f0" and "cf52b345dcd0c8395b0ed3a4dd69acde9ee13b1e" have entirely different histories.
3bb8f8000b
...
cf52b345dc
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,7 +5,5 @@ thirdparty/
|
|||||||
tritoin/
|
tritoin/
|
||||||
CMakeFiles/
|
CMakeFiles/
|
||||||
logs/
|
logs/
|
||||||
doc/data/
|
|
||||||
doc/images/
|
|
||||||
QWEN.md
|
QWEN.md
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
|
|||||||
@ -27,8 +27,7 @@ namespace Gdiplus
|
|||||||
#pragma comment (lib,"Dwmapi.lib") // Adds missing library, fixes error LNK2019: unresolved external symbol __imp__DwmExtendFrameIntoClientArea
|
#pragma comment (lib,"Dwmapi.lib") // Adds missing library, fixes error LNK2019: unresolved external symbol __imp__DwmExtendFrameIntoClientArea
|
||||||
#pragma comment (lib,"user32.lib")
|
#pragma comment (lib,"user32.lib")
|
||||||
|
|
||||||
// 无边框样式:不使用 CAPTION 与系统按钮,避免在 Win7 显示原生按钮
|
constexpr unsigned long BorderlessFlag = WS_POPUP | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX;
|
||||||
constexpr unsigned long BorderlessFlag = WS_POPUP | WS_THICKFRAME | WS_SYSMENU;
|
|
||||||
|
|
||||||
inline bool IsCompositionEnabled() {
|
inline bool IsCompositionEnabled() {
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
@ -103,11 +102,8 @@ bool FramelessDelegateWin::nativeEvent(const QByteArray & eventType, void* messa
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
NCCALCSIZE_PARAMS* ncParam = reinterpret_cast<NCCALCSIZE_PARAMS*>(msg->lParam);
|
NCCALCSIZE_PARAMS* ncParam = reinterpret_cast<NCCALCSIZE_PARAMS*>(msg->lParam);
|
||||||
// 最大化时将客户区严格对齐到工作区,避免左右空隙
|
|
||||||
ncParam->rgrc[0].left = rc->left();
|
|
||||||
ncParam->rgrc[0].top = rc->top();
|
ncParam->rgrc[0].top = rc->top();
|
||||||
ncParam->rgrc[0].right = rc->right();
|
ncParam->rgrc[0].bottom = rc->bottom() + 1;
|
||||||
ncParam->rgrc[0].bottom = rc->bottom();
|
|
||||||
*result = 0;
|
*result = 0;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@ -169,13 +165,15 @@ bool FramelessDelegateWin::nativeEvent(const QByteArray & eventType, void* messa
|
|||||||
AdjustWindowRectEx(&frame, WS_OVERLAPPEDWINDOW, FALSE, 0);
|
AdjustWindowRectEx(&frame, WS_OVERLAPPEDWINDOW, FALSE, 0);
|
||||||
double dpr = mainWidget_->devicePixelRatioF();
|
double dpr = mainWidget_->devicePixelRatioF();
|
||||||
|
|
||||||
// 最大化时不叠加系统边框内边距,避免左右出现可见空隙
|
frames_.setLeft(abs(frame.left) / dpr + 0.5);
|
||||||
frames_.setLeft(0);
|
frames_.setTop(abs(frame.bottom) / dpr + 0.5);
|
||||||
frames_.setTop(0);
|
frames_.setRight(abs(frame.right) / dpr + 0.5);
|
||||||
frames_.setRight(0);
|
frames_.setBottom(abs(frame.bottom) / dpr + 0.5);
|
||||||
frames_.setBottom(0);
|
|
||||||
|
|
||||||
mainWidget_->setContentsMargins(margins_);
|
mainWidget_->setContentsMargins(frames_.left() + margins_.left(), \
|
||||||
|
frames_.top() + margins_.top(), \
|
||||||
|
frames_.right() + margins_.right(), \
|
||||||
|
frames_.bottom() + margins_.bottom());
|
||||||
justMaximized_ = true;
|
justMaximized_ = true;
|
||||||
} else {
|
} else {
|
||||||
if (justMaximized_) {
|
if (justMaximized_) {
|
||||||
@ -363,11 +361,6 @@ void FramelessDelegateWin::SetNativeWindowLong() {
|
|||||||
// 避免父窗口与子窗口重叠绘制导致闪烁,启用剪裁样式
|
// 避免父窗口与子窗口重叠绘制导致闪烁,启用剪裁样式
|
||||||
style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
||||||
|
|
||||||
// 显式清理可能由 Qt 或系统设置的标题栏与系统按钮标志,确保不显示原生按钮
|
|
||||||
style &= ~WS_CAPTION;
|
|
||||||
style &= ~WS_MINIMIZEBOX;
|
|
||||||
style &= ~WS_MAXIMIZEBOX;
|
|
||||||
|
|
||||||
if (!mainWidget_->windowFlags().testFlag(Qt::WindowMinimizeButtonHint) ||
|
if (!mainWidget_->windowFlags().testFlag(Qt::WindowMinimizeButtonHint) ||
|
||||||
mainWidget_->maximumSize() != QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)) {
|
mainWidget_->maximumSize() != QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)) {
|
||||||
style &= ~WS_MINIMIZEBOX;
|
style &= ~WS_MINIMIZEBOX;
|
||||||
|
|||||||
@ -95,7 +95,11 @@ void Timestep::Start() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
workSpace_->Begin();
|
workSpace_->Begin();
|
||||||
// 保持当前倍速,不在开始时重置为 1x
|
// 重置速度为 1x 并通知 UI
|
||||||
|
auto it = std::find(speedLevels_.begin(), speedLevels_.end(), 1.0);
|
||||||
|
speedIndex_ = it != speedLevels_.end() ? int(std::distance(speedLevels_.begin(), it)) : speedIndex_;
|
||||||
|
currentStep_ = speedLevels_[speedIndex_];
|
||||||
|
emit StepChanged(currentStep_);
|
||||||
emit StatusChanged((int)playStatus_);
|
emit StatusChanged((int)playStatus_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user