优化切换的使用体验

This commit is contained in:
gfdgd xi 2024-08-03 17:46:56 +08:00
parent bf18411f7a
commit bc5aca0fd7
34 changed files with 50 additions and 18 deletions

0
ConfigLanguareRunner-help.json Normal file → Executable file
View File

0
DefaultSetting.py Normal file → Executable file
View File

0
DisabledOpengl.reg Normal file → Executable file
View File

0
Download.py Normal file → Executable file
View File

0
EnabledOpengl.reg Normal file → Executable file
View File

0
IconList.json Normal file → Executable file
View File

0
InstallDeepinWine6OnUbuntu.sh Normal file → Executable file
View File

0
InstallDeepinWineOnUbuntu.sh Normal file → Executable file
View File

View File

@ -98,7 +98,7 @@ copy-files:
cp -rv InstallVisualCPlusPlus.py deb/opt/apps/deepin-wine-runner
cp -rv launch.sh deb/opt/apps/deepin-wine-runner
cp -rv LICENSE deb/opt/apps/deepin-wine-runner
cp -rv mainwindow.py deb/opt/apps/deepin-wine-runner/deepin-wine-runner
cp -rv mainwindow.py deb/opt/apps/deepin-wine-runner/
cp -rv package-script.zip deb/opt/apps/deepin-wine-runner
cp -rv Run.bat deb/opt/apps/deepin-wine-runner
cp -rv RunVM.sh deb/opt/apps/deepin-wine-runner
@ -139,6 +139,7 @@ copy-files:
cp -rv globalenv.py deb/opt/apps/deepin-wine-runner
cp -rv local deb/opt/apps/deepin-wine-runner
cp -rv WindowModule.py deb/opt/apps/deepin-wine-runner
cp -rv main.py deb/opt/apps/deepin-wine-runner/deepin-wine-runner
mkdir -pv deb/opt/apps/deepin-wine-runner/entries/
cp -rv deb/usr/share/applications deb/opt/apps/deepin-wine-runner/entries/applications
python3 UpdateTime.py

0
README_en.md Normal file → Executable file
View File

0
RunCommandWithTerminal.py Normal file → Executable file
View File

0
UpdateTime.py Normal file → Executable file
View File

0
WindowModule.py Normal file → Executable file
View File

View File

@ -750,13 +750,13 @@ try:
exePath.setText(sys.argv[1])
except:
pass
if (__name__ != "__main__"):
'''if (__name__ != "__main__"):
# 设置滚动条
areaScroll = QtWidgets.QScrollArea(window)
areaScroll.setWidgetResizable(True)
areaScroll.setWidget(widget)
areaScroll.setFrameShape(QtWidgets.QFrame.NoFrame)
window.setCentralWidget(areaScroll)
window.setCentralWidget(areaScroll)'''
if (__name__ == "__main__"):
window.resize(int(window.frameGeometry().width() * 1.2), int(window.frameGeometry().height() * 1.1))

View File

@ -1694,8 +1694,7 @@ SetFont(app)
window.setCentralWidget(widget)
# 判断是否为小屏幕,是则设置滚动条并全屏
if (window.frameGeometry().width() > app.primaryScreen().availableGeometry().size().width() * 0.8 or
window.frameGeometry().height() > app.primaryScreen().availableGeometry().size().height() * 0.9 or
__name__ != "__main__"):
window.frameGeometry().height() > app.primaryScreen().availableGeometry().size().height() * 0.9):
# 设置滚动条
areaScroll = QtWidgets.QScrollArea(window)
areaScroll.setWidgetResizable(True)

0
deepin-wine-runner_512x512.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
geek.exe Normal file → Executable file
View File

0
globalenv.py Normal file → Executable file
View File

0
information.json Normal file → Executable file
View File

50
main.py Normal file → Executable file
View File

@ -1,12 +1,27 @@
#!/usr/bin/env python3
# 库的引用
import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
import os
import json
import sys
import WindowModule
import welcome
# 读取文本文档
def readtxt(path):
f = open(path, "r") # 设置文件对象
str = f.read() # 获取内容
f.close() # 关闭文本对象
return str # 返回结果
def ProgramVersion():
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
information = json.loads(readtxt(f"{programPath}/information.json"))
return information["Version"]
# 创建界面
class Window(QtWidgets.QWidget):
moduleMapList = {}
@ -21,7 +36,7 @@ class Window(QtWidgets.QWidget):
def initUI(self):
self.setMinimumSize(800, 600)
self.setWindowTitle("增减测试")
self.setWindowTitle("Wine 运行器 {}".format(ProgramVersion()))
self.mainLayout = QtWidgets.QHBoxLayout()
self.setLayout(self.mainLayout)
@ -29,11 +44,12 @@ class Window(QtWidgets.QWidget):
self.leftWidget = LeftWidget()
self.mainLayout.addWidget(self.leftWidget)
time = 0
for i in WindowModule.moduleNameList.keys():
self.moduleMapList[self.leftWidget.actionList[i].text()] = [i, WindowModule.moduleNameList[i]["Name"]]
self.leftWidget.actionList[i].triggered.connect(lambda: self.add(self.sender().text()))
self.leftWidget.btn4.clicked.connect(self.delCurrent)
#self.leftWidget.btn4.clicked.connect(self.delCurrent)
self.leftWidget.list1.itemClicked.connect(self.switchWidget)
# 右侧区域
@ -42,6 +58,13 @@ class Window(QtWidgets.QWidget):
self.addWelcome()
# 判断运行器是否为第一次打开,如果不是则默认切换至 Wine 运行器主窗口
# 默认为列表里的第一个控件
if (os.path.exists(get_home() + "/.config/deepin-wine-runner")):
self.add(self.leftWidget.actionList[list(WindowModule.moduleNameList.keys())[0]].text())
self.ConfigureConfigFile()
# 新增欢迎界面
def addWelcome(self):
self.newTab = "欢迎页面"
@ -52,7 +75,7 @@ class Window(QtWidgets.QWidget):
self.rightWidget.addWidget(self.newWidget)
# 新增界面
def add(self, actionName):
def add(self, actionName: str):
self.newInfo = "{}#{}".format(self.moduleMapList[actionName][1], self.counter_a)
self.newTab = ItemWidget(self.newInfo)
self.newTab.btn.clicked.connect(self.delCurrent)
@ -103,6 +126,13 @@ class Window(QtWidgets.QWidget):
self.leftWidget.list1.item(i).btnDisable()
if self.row != 0:
self.leftWidget.list1.currentItem().btnEnable()
def ConfigureConfigFile(self):
if not os.path.exists(get_home() + "/.config/"): # 如果没有配置文件夹
os.mkdir(get_home() + "/.config/") # 创建配置文件夹
if not os.path.exists(get_home() + "/.config/deepin-wine-runner"): # 如果没有配置文件夹
os.mkdir(get_home() + "/.config/deepin-wine-runner") # 创建配置文件夹
# 左侧区域
class LeftWidget(QtWidgets.QWidget):
@ -118,8 +148,7 @@ class LeftWidget(QtWidgets.QWidget):
self.setLayout(self.mainLayout)
# 左侧标题
self.lab1 = QtWidgets.QLabel("页面导航区")
self.lab1.setStyleSheet("font-size:20px")
self.lab1 = QtWidgets.QLabel("<h3>页面导航区</h3>")
self.mainLayout.addWidget(self.lab1)
# 新建页面面按钮
@ -138,8 +167,8 @@ class LeftWidget(QtWidgets.QWidget):
self.mainLayout.addWidget(self.list1)
# 删_页面按钮
self.btn4 = QtWidgets.QPushButton("删除_本页面")
self.mainLayout.addWidget(self.btn4)
#self.btn4 = QtWidgets.QPushButton("删除本页面")
#self.mainLayout.addWidget(self.btn4)
# 列表项目组件
class ItemWidget(QtWidgets.QListWidgetItem):
@ -161,7 +190,7 @@ class ItemWidget(QtWidgets.QListWidgetItem):
# 关闭按钮
self.btn = QtWidgets.QPushButton("x")
self.btn.setMaximumWidth(20)
#self.btn.setMaximumWidth(20)
self.btn.setEnabled(False)
self.mainLayout.addWidget(self.btn)
@ -181,9 +210,14 @@ class RightWidget(QtWidgets.QStackedWidget):
#def initUI(self):
# 获取用户主目录
def get_home():
return os.path.expanduser('~')
# 运行程序
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
mainWindow = Window()
mainWindow.show()
mainWindow.resize(int(mainWindow.geometry().width() * 1.2), int(mainWindow.geometry().height() * 1.2))
sys.exit(app.exec())

View File

@ -3360,8 +3360,7 @@ window.setCentralWidget(widget)
# 判断是否为小屏幕,是则设置滚动条并全屏
# 获取为 import 为控件,也默认开启滚动条
if (window.frameGeometry().width() > app.primaryScreen().availableGeometry().size().width() * 0.8 or
window.frameGeometry().height() > app.primaryScreen().availableGeometry().size().height() * 0.9 or
__name__ != "__main__"):
window.frameGeometry().height() > app.primaryScreen().availableGeometry().size().height() * 0.9):
# 设置滚动条
areaScroll = QtWidgets.QScrollArea(window)
areaScroll.setWidgetResizable(True)

0
test.py Normal file → Executable file
View File

0
vkd3d-proton.7z Normal file → Executable file
View File

5
welcome.py Normal file → Executable file
View File

@ -17,8 +17,7 @@ class WinWelcome(QtWidgets.QWidget):
self.setLayout(self.mainLayout)
# 标签1
self.lab1 = QtWidgets.QLabel("欢迎使用Wine运行器")
self.lab1.setStyleSheet("font-size:20px")
self.lab1 = QtWidgets.QLabel("<h3>欢迎使用Wine运行器</h3>")
self.mainLayout.addWidget(self.lab1)
# 文本栏
@ -28,7 +27,7 @@ class WinWelcome(QtWidgets.QWidget):
self.mainLayout.addWidget(self.txt)
# 标签2
self.lab2 = QtWidgets.QLabel("请根据您的需求,在左下角打开相应页面")
self.lab2 = QtWidgets.QLabel("请根据您的需求,在左打开相应页面")
self.mainLayout.addWidget(self.lab2)
# 测试界面

0
wineautobuild-action-7z-aarch64-daily.sh Normal file → Executable file
View File

0
wineautobuild-action-7z-aarch64.sh Normal file → Executable file
View File

0
wineautobuild-action-7z-daily.sh Normal file → Executable file
View File

0
wineautobuild-action-7z-wow64-daily.sh Normal file → Executable file
View File

0
wineautobuild-action-7z-wow64.sh Normal file → Executable file
View File

0
wineautobuild-action-7z.sh Normal file → Executable file
View File

0
wineautobuild-action-debian9.sh Normal file → Executable file
View File

0
wineautobuild-action.sh Normal file → Executable file
View File

0
winelist.json Normal file → Executable file
View File

0
其他Windows无法正常创建虚拟机的问题 Normal file → Executable file
View File