Skip to content

Commit

Permalink
添加按钮禁用的样式
Browse files Browse the repository at this point in the history
更改选择启动器所在文件夹为选择启动器应用程序
  • Loading branch information
GengGode committed Sep 25, 2021
1 parent ac8451e commit 7cff8ae
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
5 changes: 4 additions & 1 deletion GenshinImpactNaturalLaw/QtWidgetsSetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,13 @@ void QtWidgetsSetting::CheckOptions_CheckGameLauncher()
{
FileDialogPath = setting->launcher_install_path;
}
QString GameLauncherPath = QFileDialog::getExistingDirectory(this, tr("Str_SelectGILauncherPath")/*"选择原神启动器所在目录"*/, FileDialogPath, QFileDialog::ShowDirsOnly);
QString GameLauncherPath = QFileDialog::getOpenFileName(this, tr("Str_SelectGILauncherPath")/*"选择原神所在目录"*/, FileDialogPath, tr("Str_ApplicationProgram") + " (*.exe);;"/* "应用程序 (*.exe);;"*/);

//QString GameLauncherPath = QFileDialog::getExistingDirectory(this, tr("Str_SelectGILauncherPath")/*"选择原神启动器所在目录"*/, FileDialogPath, QFileDialog::ShowDirsOnly);

if (!GameLauncherPath.isEmpty())
{
GameLauncherPath = GameLauncherPath.section("/", 0, -2);
QFileInfo file(GameLauncherPath+"/launcher.exe");
if (file.exists() == false)
{
Expand Down
32 changes: 30 additions & 2 deletions GenshinImpactNaturalLaw/QtWidgetsSetting.ui
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ height: 0px;
<property name="geometry">
<rect>
<x>0</x>
<y>-1127</y>
<y>-227</y>
<width>561</width>
<height>1465</height>
</rect>
Expand Down Expand Up @@ -875,6 +875,10 @@ background-color:rgb(251, 248, 239);
}
QPushButton:pressed {
background-color:rgb(236, 233, 224);
}

QPushButton:!enabled {
background-color:rgb(246, 245, 243);
}</string>
</property>
<property name="text">
Expand Down Expand Up @@ -950,7 +954,7 @@ border-radius: 0px;
<item>
<widget class="QPushButton" name="pushButton_Check_2">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
Expand Down Expand Up @@ -984,6 +988,10 @@ background-color:rgb(251, 248, 239);
}
QPushButton:pressed {
background-color:rgb(236, 233, 224);
}

QPushButton:!enabled {
background-color:rgb(246, 245, 243);
}</string>
</property>
<property name="text">
Expand Down Expand Up @@ -1107,6 +1115,10 @@ background-color:rgb(251, 248, 239);
}
QPushButton:pressed {
background-color:rgb(236, 233, 224);
}

QPushButton:!enabled {
background-color:rgb(246, 245, 243);
}</string>
</property>
<property name="text">
Expand Down Expand Up @@ -1190,6 +1202,10 @@ background-color:rgb(251, 248, 239);
}
QPushButton:pressed {
background-color:rgb(236, 233, 224);
}

QPushButton:!enabled {
background-color:rgb(246, 245, 243);
}</string>
</property>
<property name="text">
Expand Down Expand Up @@ -1316,6 +1332,10 @@ background-color:rgb(251, 248, 239);
}
QPushButton:pressed {
background-color:rgb(236, 233, 224);
}

QPushButton:!enabled {
background-color:rgb(246, 245, 243);
}</string>
</property>
<property name="text">
Expand Down Expand Up @@ -1403,6 +1423,10 @@ background-color:rgb(251, 248, 239);
}
QPushButton:pressed {
background-color:rgb(236, 233, 224);
}

QPushButton:!enabled {
background-color:rgb(246, 245, 243);
}</string>
</property>
<property name="text">
Expand Down Expand Up @@ -1490,6 +1514,10 @@ background-color:rgb(251, 248, 239);
}
QPushButton:pressed {
background-color:rgb(236, 233, 224);
}

QPushButton:!enabled {
background-color:rgb(246, 245, 243);
}</string>
</property>
<property name="text">
Expand Down

0 comments on commit 7cff8ae

Please sign in to comment.