Skip to content

Commit

Permalink
更新1.3.1版本
Browse files Browse the repository at this point in the history
  • Loading branch information
tonquer committed Dec 20, 2021
1 parent dc6ee50 commit 324c668
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 36 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# update log file.
# tonquer<tonquer@qq.com>
######################################################################################
# Version: v1.3.1
# 2021/12/20
# 1)修复菜单按钮关闭后无法打开
# 2)修复下载章节出现.时无法正常下载
# 3)新增搜索历史记录,搜索空白时显示
# 4)尝试修复聊天室消息卡顿
# 5)标题栏美化,如果显示异常,请在设置中打开使用默认标题栏

# Version: v1.3.0
# 2021/12/05
# 1)修复Win7无法运行
Expand Down
3 changes: 2 additions & 1 deletion src/component/widget/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

from PySide6.QtCore import Qt

from config.setting import Setting
from tools.log import Log

MainType = 1

Main = None

if sys.platform == "win32":
if sys.platform == "win32" and not Setting.IsNotUseTitleBar.value:
try:
from interface.ui_main_windows import Ui_MainWindows
from .windows.frame_less_widget import FrameLessWidget
Expand Down
24 changes: 24 additions & 0 deletions src/component/widget/title_bar_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,27 @@ def _Close(self):

def _ShowMinimized(self):
return self.window().showMinimized()

def mousePressEvent(self, event):
""" 移动窗口 """
# 判断鼠标点击位置是否允许拖动
from win32.win32gui import ReleaseCapture
from win32.win32api import SendMessage
from win32.lib import win32con
if self.__isPointInDragRegion(event.pos()):
ReleaseCapture()
SendMessage(
self.window().winId(),
win32con.WM_SYSCOMMAND,
win32con.SC_MOVE + win32con.HTCAPTION,
0,
)
event.ignore()

def __isPointInDragRegion(self, pos) -> bool:
""" 检查鼠标按下的点是否属于允许拖动的区域 """
x = pos.x()
left = 0
# 如果最小化按钮看不见也意味着最大化按钮看不见
right = self.width() - 57
return left < x < right
30 changes: 4 additions & 26 deletions src/component/widget/windows/frame_less_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from PySide6.QtGui import QPainter, QBrush, QColor, QPainterPath
from PySide6.QtWidgets import QWidget, QStyleOption, QStyle
from win32 import win32api, win32gui
from win32.win32gui import ReleaseCapture
from win32.win32api import SendMessage
from win32.lib import win32con

from config.setting import Setting
Expand Down Expand Up @@ -164,10 +162,10 @@ def __monitorNCCALCSIZE(self, msg: MSG):
self.__monitorInfo = win32api.GetMonitorInfo(monitor)
# 调整窗口大小
params = cast(msg.lParam, POINTER(NCCALCSIZE_PARAMS)).contents
params.rgrc[0].left = self.__monitorInfo['Work'][0]
params.rgrc[0].top = self.__monitorInfo['Work'][1]
params.rgrc[0].right = self.__monitorInfo['Work'][2]
params.rgrc[0].bottom = self.__monitorInfo['Work'][3]
# params.rgrc[0].left = self.__monitorInfo['Work'][0]
# params.rgrc[0].top = self.__monitorInfo['Work'][1]
# params.rgrc[0].right = self.__monitorInfo['Work'][2]
# params.rgrc[0].bottom = self.__monitorInfo['Work'][3]

# def moveArea(self, pos: QPointF):
# if pos.y() < self.m_nBorder:
Expand Down Expand Up @@ -272,23 +270,3 @@ def __monitorNCCALCSIZE(self, msg: MSG):
# self.m_bPress = False
# self.setCursor(Qt.ArrowCursor)

def mousePressEvent(self, event):
""" 移动窗口 """
# 判断鼠标点击位置是否允许拖动
if self.__isPointInDragRegion(event.pos()):
ReleaseCapture()
SendMessage(
self.window().winId(),
win32con.WM_SYSCOMMAND,
win32con.SC_MOVE + win32con.HTCAPTION,
0,
)
event.ignore()

def __isPointInDragRegion(self, pos) -> bool:
""" 检查鼠标按下的点是否属于允许拖动的区域 """
x = pos.x()
left = 0
# 如果最小化按钮看不见也意味着最大化按钮看不见
right = self.width() - 57
return left < x < right
4 changes: 2 additions & 2 deletions src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

DatabaseUpdate2 = "https://gitee.com/bika-robot/picacg-database/raw/main/version.txt"
DatabaseDownload2 = "https://gitee.com/bika-robot/picacg-database/raw/main/data/"
UpdateVersion = "v1.3.0"
RealVersion = "v1.3.0"
UpdateVersion = "v1.3.1"
RealVersion = "v1.3.1"

Waifu2xVersion = "1.0.9"

Expand Down
1 change: 1 addition & 0 deletions src/config/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Setting:
CoverSize = SettingValue("GeneraSetting", 100, False) #
CategorySize = SettingValue("GeneraSetting", 80, False) #
ScaleLevel = SettingValue("GeneraSetting", 0, True, ["Auto", 100, 125, 150, 175, 200])
IsNotUseTitleBar = SettingValue("GeneraSetting", 0, True)

# 代理设置
IsHttpProxy = SettingValue("ProxySetting", 0, False)
Expand Down
Binary file modified src/data/book.db
Binary file not shown.
24 changes: 23 additions & 1 deletion src/interface/ui_setting_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def setupUi(self, SettingNew):
self.scrollArea.setWidgetResizable(True)
self.scrollAreaWidgetContents = QWidget()
self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents")
self.scrollAreaWidgetContents.setGeometry(QRect(0, -372, 661, 2209))
self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 661, 2284))
self.scrollAreaWidgetContents.setStyleSheet(u"")
self.verticalLayout_4 = QVBoxLayout(self.scrollAreaWidgetContents)
self.verticalLayout_4.setObjectName(u"verticalLayout_4")
Expand Down Expand Up @@ -244,6 +244,26 @@ def setupUi(self, SettingNew):

self.verticalLayout_4.addWidget(self.frame_13)

self.frame = QFrame(self.scrollAreaWidgetContents)
self.frame.setObjectName(u"frame")
self.frame.setFrameShape(QFrame.StyledPanel)
self.frame.setFrameShadow(QFrame.Raised)
self.verticalLayout_14 = QVBoxLayout(self.frame)
self.verticalLayout_14.setObjectName(u"verticalLayout_14")
self.label_30 = QLabel(self.frame)
self.label_30.setObjectName(u"label_30")
self.label_30.setFont(font1)

self.verticalLayout_14.addWidget(self.label_30)

self.titleBox = QCheckBox(self.frame)
self.titleBox.setObjectName(u"titleBox")

self.verticalLayout_14.addWidget(self.titleBox)


self.verticalLayout_4.addWidget(self.frame)

self.frame_14 = QFrame(self.scrollAreaWidgetContents)
self.frame_14.setObjectName(u"frame_14")
self.frame_14.setFont(font1)
Expand Down Expand Up @@ -1034,6 +1054,8 @@ def retranslateUi(self, SettingNew):
self.mainScaleButton3.setText(QCoreApplication.translate("SettingNew", u"150%", None))
self.mainScaleButton4.setText(QCoreApplication.translate("SettingNew", u"175%", None))
self.mainScaleButton5.setText(QCoreApplication.translate("SettingNew", u"200%", None))
self.label_30.setText(QCoreApplication.translate("SettingNew", u"\u6807\u9898\u680f\u8bbe\u7f6e\uff08\u9700\u91cd\u542f\uff09", None))
self.titleBox.setText(QCoreApplication.translate("SettingNew", u"\u4f7f\u7528\u9ed8\u8ba4\u6807\u9898\u680f\uff08\u5982\u679c\u6807\u9898\u680f\u51fa\u73b0\u663e\u793a\u5f02\u5e38\uff0c\u8bf7\u52fe\u9009\uff09", None))
self.label_2.setText(QCoreApplication.translate("SettingNew", u"\u5c01\u9762\u663e\u793a\u5927\u5c0f\uff08\u9ed8\u8ba4\u4e3a100%\uff09\uff1a", None))
self.label_29.setText(QCoreApplication.translate("SettingNew", u"\u5206\u7c7b\u5c01\u9762\u5927\u5c0f\uff1a", None))
self.label_10.setText(QCoreApplication.translate("SettingNew", u"\u65e5\u5fd7\u7b49\u7ea7\uff1a", None))
Expand Down
2 changes: 1 addition & 1 deletion src/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from qt_owner import QtOwner
from tools.log import Log
from tools.str import Str
from view.main.main_view import MainView

if sys.platform == 'darwin':
# 确保工作区为当前可执行文件所在目录
Expand Down Expand Up @@ -62,6 +61,7 @@
Log.Warn("init scene ratio: {}".format(app.devicePixelRatio()))
try:
QtOwner().SetApp(app)
from view.main.main_view import MainView
main = MainView()
except Exception as es:
Log.Error(es)
Expand Down
2 changes: 2 additions & 0 deletions src/view/setting/setting_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(self, parent=None):
self.readCheckBox.clicked.connect(partial(self.CheckButtonEvent, Setting.IsOpenWaifu, self.readCheckBox))
self.coverCheckBox.clicked.connect(partial(self.CheckButtonEvent, Setting.CoverIsOpenWaifu, self.coverCheckBox))
self.downAuto.clicked.connect(partial(self.CheckButtonEvent, Setting.DownloadAuto, self.downAuto))
self.titleBox.clicked.connect(partial(self.CheckButtonEvent, Setting.IsNotUseTitleBar, self.titleBox))

# LineEdit:
self.httpEdit.editingFinished.connect(partial(self.LineEditEvent, Setting.HttpProxy, self.httpEdit))
Expand Down Expand Up @@ -176,6 +177,7 @@ def InitSetting(self):
self.httpProxy.setChecked(Setting.IsHttpProxy.value)
self.httpEdit.setText(Setting.HttpProxy.value)
self.chatProxy.setChecked(Setting.ChatProxy.value)
self.titleBox.setChecked(Setting.IsNotUseTitleBar.value)
for index in range(self.encodeSelect.count()):
if Setting.SelectEncodeGpu.value == self.encodeSelect.itemText(index):
self.encodeSelect.setCurrentIndex(index)
Expand Down
41 changes: 36 additions & 5 deletions ui/ui_setting_new.ui
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-372</y>
<y>0</y>
<width>661</width>
<height>2209</height>
<height>2284</height>
</rect>
</property>
<property name="styleSheet">
Expand Down Expand Up @@ -378,6 +378,37 @@
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_14">
<item>
<widget class="QLabel" name="label_30">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>标题栏设置(需重启)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="titleBox">
<property name="text">
<string>使用默认标题栏(如果标题栏出现显示异常,请勾选)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_14">
<property name="font">
Expand Down Expand Up @@ -1979,9 +2010,9 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="mainScaleGroup"/>
<buttongroup name="themeGroup"/>
<buttongroup name="languageGroup"/>
<buttongroup name="logGroup"/>
<buttongroup name="languageGroup"/>
<buttongroup name="themeGroup"/>
<buttongroup name="mainScaleGroup"/>
</buttongroups>
</ui>

0 comments on commit 324c668

Please sign in to comment.