main
zhuzihcu 2023-04-20 09:15:28 +08:00
parent 882606b2f6
commit d5744a39bd
4 changed files with 12 additions and 7 deletions

View File

@ -54,11 +54,12 @@ FluScrollablePage{
FluArea{
Layout.fillWidth: true
height: 68
height: 36+multiine_textbox.height
paddings: 10
Layout.topMargin: 20
FluMultilineTextBox{
id:multiine_textbox
Layout.topMargin: 20
placeholderText: "多行输入框"
Layout.preferredWidth: 300

View File

@ -58,7 +58,11 @@ FluScrollablePage{
Layout.topMargin: 5
selected: FluTheme.dark
clickFunc:function(){
FluTheme.dark = !FluTheme.dark
if(FluTheme.dark){
FluTheme.darkMode = FluDarkMode.Light
}else{
FluTheme.darkMode = FluDarkMode.Dark
}
}
}
FluText{

View File

@ -14,9 +14,9 @@ int main(int argc, char *argv[])
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
//6.4及以下监听系统深色模式变化
qputenv("QT_QPA_PLATFORM","windows:darkmode=2");
QCoreApplication::setOrganizationName("ZhuZiChu");
QCoreApplication::setOrganizationDomain("https://zhuzichu520.github.io");
QCoreApplication::setApplicationName("FluentUI");
QGuiApplication::setOrganizationName("ZhuZiChu");
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
QGuiApplication::setApplicationName("FluentUI");
// QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
QGuiApplication app(argc, argv);
app.setQuitOnLastWindowClosed(false);

View File

@ -26,7 +26,7 @@ FluTheme::FluTheme(QObject *parent)
nativeText(false);
frameless(true);
darkMode(Fluent_DarkMode::Fluent_DarkModeType::Light);
(qobject_cast<QGuiApplication *>(QCoreApplication::instance()))->installEventFilter(this);
qApp->installEventFilter(this);
}
bool FluTheme::eventFilter(QObject *obj, QEvent *event)
@ -43,7 +43,7 @@ bool FluTheme::eventFilter(QObject *obj, QEvent *event)
bool FluTheme::systemDark()
{
QPalette palette = (qobject_cast<QGuiApplication *>(QGuiApplication::instance()))->palette();
QPalette palette = qApp->palette();
QColor color = palette.color(QPalette::Window).rgb();
return !(color.red() * 0.2126 + color.green() * 0.7152 + color.blue() * 0.0722 > 255 / 2);
}