mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
refactor(ui): add WinUI stylesheet for Windows
- Introduced WinToolWidget for custom window management on Windows. - Implemented backdrop type settings for Windows in SettingsManager. - Enhanced SettingsWidget to allow selection of backdrop type. - Improved status balloon and toolbox widget styles for Windows. - Refined tab widget animations and styles for better visual feedback. - Fixed issues with loading and error widgets in ZLoadingWidget. - Updated welcome widget to support custom hyperlink colors. - General code cleanup and style adjustments across multiple files.
This commit is contained in:
+28
-3
@@ -37,6 +37,10 @@
|
||||
#include <QMessageBox>
|
||||
#include <QStyle>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <QGraphicsOpacityEffect>
|
||||
#endif
|
||||
|
||||
struct iDescriptorToolWidget {
|
||||
iDescriptorTool tool;
|
||||
QString description;
|
||||
@@ -335,14 +339,35 @@ void ToolboxWidget::updateToolboxStates()
|
||||
bool enabled = !requiresDevice || hasDevice;
|
||||
toolbox->setEnabled(enabled);
|
||||
|
||||
// Opacity does not work because of the stylesheet on Windows
|
||||
#ifndef WIN32
|
||||
if (enabled) {
|
||||
toolbox->setStyleSheet("#toolboxFrame { "
|
||||
"border-radius: 5px; padding: 5px; }");
|
||||
toolbox->setStyleSheet("QWidget#toolboxFrame { "
|
||||
"padding: 5px; }");
|
||||
} else {
|
||||
toolbox->setStyleSheet("#toolboxFrame { border-radius: 5px; "
|
||||
toolbox->setStyleSheet("QWidget#toolboxFrame { "
|
||||
"padding: 5px;"
|
||||
"opacity: 0.45; }");
|
||||
}
|
||||
#else
|
||||
// base style
|
||||
// toolbox->setStyleSheet("QWidget#toolboxFrame{ padding: 5px; border: "
|
||||
// "none; outline: none; }");
|
||||
|
||||
if (enabled) {
|
||||
// normal look
|
||||
toolbox->setStyleSheet("QWidget#toolboxFrame { padding: 5px; "
|
||||
"border: none; outline: none; }");
|
||||
toolbox->setCursor(Qt::PointingHandCursor);
|
||||
} else {
|
||||
// disabled look: dull bg + border + muted text, no hand cursor
|
||||
toolbox->setStyleSheet("padding: 5px;"
|
||||
"border-radius: 8px;"
|
||||
"background-color: rgba(255,255,255,1);"
|
||||
"color: #666;");
|
||||
toolbox->setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user