Skip to content

Commit

Permalink
更新1.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tonquer committed Jan 30, 2022
1 parent b2da377 commit b357cbc
Show file tree
Hide file tree
Showing 20 changed files with 2,724 additions and 2,580 deletions.
53 changes: 45 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
--hidden-import tools \
--hidden-import view \
--strip --windowed -i Icon.icns \
start.py --strip
start.py
rm -rf dist/PicACG
cp Icon.icns dist/
ln -s /Applications/ dist/Applications
Expand Down Expand Up @@ -79,17 +79,15 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller==4.5.1
pip install pyinstaller==4.8
pip install pywin32==302
pip install -r src\requirements.txt
- name: Build
run: |
cd src
cp ..\res\icon\icon.ico .\
Invoke-WebRequest -Uri https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win64.zip -OutFile upx-3.96-win64.zip
7z x -aoa .\upx-3.96-win64.zip -oupx
pyinstaller -F -w -i icon.ico start.py --upx-dir=upx\upx-3.96-win64
pyinstaller -F -w -i icon.ico start.py
mv dist bika
Copy-Item -Verbose -Recurse -Path data -Destination bika/
cp ..\LICENSE bika\
Expand Down Expand Up @@ -131,9 +129,7 @@ jobs:
run: |
cd src
cp ..\res\icon\icon.ico .\
Invoke-WebRequest -Uri https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win64.zip -OutFile upx-3.96-win64.zip
7z x -aoa .\upx-3.96-win64.zip -oupx
pyinstaller -F -w -i icon.ico start.py --upx-dir=upx\upx-3.96-win64
pyinstaller -F -w -i icon.ico start.py
mv dist bika
Copy-Item -Verbose -Recurse -Path data -Destination bika/
cp ..\LICENSE bika\
Expand All @@ -147,4 +143,45 @@ jobs:
with:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}
retention-days: 7

ubuntu:
runs-on: ubuntu-18.04
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_linux
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller==4.8
pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.1/waifu2x_vulkan-1.1.1-cp37-cp37m-linux_x86_64.whl
pip install -r src/requirements.txt
- name: Build
run: |
cd src
pyinstaller -w start.py
cd dist
mkdir -p picacg.AppRun/usr/bin
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
cp -r ../../res/appimage/* picacg.AppRun/
cp -r ../../res/icon/logo_round.png picacg.AppRun/PicACG.png
cp -r start/* picacg.AppRun/usr/bin/
cp -r ../data picacg.AppRun/
mv picacg.AppRun/usr/bin/start picacg.AppRun/usr/bin/PicACG
chmod +x picacg.AppRun/AppRun
chmod +x picacg.AppRun/usr/bin/PicACG
./appimagetool-x86_64.AppImage picacg.AppRun
mv PicACG-x86_64.AppImage ../../${{ env.PACKAGENAME }}-x86_64.AppImage
cd ../..
- name: Upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}-x86_64.AppImage
retention-days: 7
56 changes: 48 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
--hidden-import tools \
--hidden-import view \
--strip --windowed -i Icon.icns \
start.py --strip
start.py
rm -rf dist/PicACG
cp Icon.icns dist/
ln -s /Applications/ dist/Applications
Expand Down Expand Up @@ -121,16 +121,14 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller==4.5.1
pip install pyinstaller==4.8
pip install pywin32==302
pip install -r src\requirements.txt
- name: Build
run: |
cd src
cp ..\res\icon\icon.ico .\
Invoke-WebRequest -Uri https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win64.zip -OutFile upx-3.96-win64.zip
7z x -aoa .\upx-3.96-win64.zip -oupx
pyinstaller -F -w -i icon.ico start.py --upx-dir=upx\upx-3.96-win64
pyinstaller -F -w -i icon.ico start.py
mv dist bika
Copy-Item -Verbose -Recurse -Path data -Destination bika/
cp ..\LICENSE bika\
Expand Down Expand Up @@ -182,9 +180,7 @@ jobs:
run: |
cd src
cp ..\res\icon\icon.ico .\
Invoke-WebRequest -Uri https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win64.zip -OutFile upx-3.96-win64.zip
7z x -aoa .\upx-3.96-win64.zip -oupx
pyinstaller -F -w -i icon.ico start.py --upx-dir=upx\upx-3.96-win64
pyinstaller -F -w -i icon.ico start.py
mv dist bika
Copy-Item -Verbose -Recurse -Path data -Destination bika/
cp ..\LICENSE bika\
Expand All @@ -206,4 +202,48 @@ jobs:
upload_url: ${{ needs.release.outputs.Up_Url }}
asset_path: ${{ env.PACKAGENAME }}.7z
asset_name: ${{ env.PACKAGENAME }}.7z
asset_content_type: application/zip

ubuntu:
runs-on: ubuntu-18.04
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_linux
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller==4.8
pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.1/waifu2x_vulkan-1.1.1-cp37-cp37m-linux_x86_64.whl
pip install -r src/requirements.txt
- name: Build
run: |
cd src
pyinstaller -w start.py
cd dist
mkdir -p picacg.AppRun/usr/bin
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
cp -r ../../res/appimage/* picacg.AppRun/
cp -r ../../res/icon/logo_round.png picacg.AppRun/PicACG.png
cp -r start/* picacg.AppRun/usr/bin/
cp -r ../data picacg.AppRun/
mv picacg.AppRun/usr/bin/start picacg.AppRun/usr/bin/PicACG
chmod +x picacg.AppRun/AppRun
chmod +x picacg.AppRun/usr/bin/PicACG
./appimagetool-x86_64.AppImage picacg.AppRun
mv PicACG-x86_64.AppImage ../../${{ env.PACKAGENAME }}-x86_64.AppImage
cd ../..
- name: upload-linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.Up_Url }}
asset_path: ${{ env.PACKAGENAME }}-x86_64.AppImage
asset_name: ${{ env.PACKAGENAME }}-x86_64.AppImage
asset_content_type: application/zip
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
# tonquer<[email protected]>
# https://github.com/tonquer/picacg-qt
######################################################################################
# Version: v1.3.5
# 2022/1/30
# 1) 修复sock5出错
# 2) 修改win字体为微软雅黑
# 3) 修复分类搜索切换界面后,翻页时显示不相关的内容
# 4) 修复全屏后看图,退出时没有还原原窗口大小
# 5) 优化linux打包大小
# 6) 优化分类搜索没有显示分类过滤数量

# Version: v1.3.4
# 2022/1/17
# 1) 添加自动登录
Expand Down
4 changes: 2 additions & 2 deletions res/appimage/AppRun
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ if [ ! -f ~/.picacg/data/version ];then
echo "mkdir version"
fi

if [ ! -f ~/.picacg/data/book.db ] || [ "`cat ~/.picacg/data/version`" != "v1.3.1" ] ; then
if [ ! -f ~/.picacg/data/book.db ] || [ "`cat ~/.picacg/data/version`" != "v1.3.5" ] ; then
cp ${HERE}/data/book.db ~/.picacg/data/
echo "v1.3.1" > ~/.picacg/data/version
echo "v1.3.5" > ~/.picacg/data/version
echo "copy data"
fi

Expand Down
Binary file modified res/tr/tr_hk.qm
Binary file not shown.
Empty file removed src/__init__.py
Empty file.
1 change: 1 addition & 0 deletions src/component/list/user_list_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def AddUserKindItem(self, info, floor):

index = self.count()
iwidget = CommentItemWidget(self)
iwidget.nameLabel.installEventFilter(iwidget)
iwidget.setFocusPolicy(Qt.NoFocus)
iwidget.killButton.hide()
iwidget.nameLabel.setCursor(Qt.PointingHandCursor)
Expand Down
12 changes: 8 additions & 4 deletions src/component/widget/animation_stack_widget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from enum import Enum

from PySide6.QtCore import QPropertyAnimation, QRectF, Property
from PySide6.QtCore import QPropertyAnimation, QRectF, Property, Qt
from PySide6.QtGui import QPaintEvent, QPainter, QPixmap
from PySide6.QtWidgets import QStackedWidget

Expand Down Expand Up @@ -46,11 +46,12 @@ def Finished(self):
def PaintPrevious(self, paint, index):
w = self.widget(index)
pixmap = QPixmap(w.size())
# pixmap.setDevicePixelRatio(self.devicePixelRatio())
w.render(pixmap)
r = w.geometry()
value = self.currentValue
r1 = QRectF(0.0, 0.0, value, r.height())
r2 = QRectF(r.width()-value, 0, value, r.height())
r2 = QRectF((r.width()-value), 0, value, r.height())
paint.drawPixmap(r1, pixmap, r2)

def SwitchWidgetByIndex(self, index, **kwargs):
Expand Down Expand Up @@ -83,17 +84,20 @@ def PaintNext(self, paint, index):
w = self.widget(index)
r = w.geometry()
w.resize(r.width(), r.height())
radio = self.devicePixelRatioF()
pixmap = QPixmap(w.size())
# pixmap.setDevicePixelRatio(radio)
w.render(pixmap)

value = self.currentValue
r1 = QRectF(value, 0.0, r.width()-value, r.height())
r2 = QRectF(0.0, 0.0, r.width()-value, r.height())
r1 = QRectF(value, 0.0, (r.width()-value), r.height())
r2 = QRectF(0.0, 0.0, (r.width()-value), r.height())
paint.drawPixmap(r1, pixmap, r2)

def paintEvent(self, event: QPaintEvent) -> None:
if self.animation.state() == QPropertyAnimation.State.Running:
paint = QPainter(self)
paint.setRenderHints(QPainter.Antialiasing | QPainter.SmoothPixmapTransform)
if self.animationType == AnimationEnum.LeftToRight:
self.PaintPrevious(paint, self.currentIndex())
self.PaintNext(paint, self.nextIndex)
Expand Down
2 changes: 2 additions & 0 deletions src/component/widget/comment_item_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def eventFilter(self, obj, event):
QtOwner().OpenGameInfo(self.linkId)
else:
QtOwner().OpenBookInfo(self.linkId)
elif obj == self.nameLabel:
QtOwner().OpenSearchByCreate(self.nameLabel.text())
return True
else:
return False
Expand Down
3 changes: 3 additions & 0 deletions src/component/widget/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ def __init__(self):

def showFullScreen(self):
self.widget.setVisible(False)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
return FrameLessWidget.showFullScreen(self)

def showNormal(self):
self.widget.setVisible(True)
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
return FrameLessWidget.showNormal(self)

def showMaximized(self):
self.widget.setVisible(True)
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
return FrameLessWidget.showMaximized(self)

def setSubTitle(self, text):
Expand Down
2 changes: 2 additions & 0 deletions src/component/widget/windows/frame_less_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def __init__(self, parent=None):
# self.setMouseTracking(True)

def paintEvent(self, event):
if self.window().isFullScreen():
return
QWidget.paintEvent(self, event)
painter = QPainter(self)
painter.setPen(Qt.transparent)
Expand Down
6 changes: 3 additions & 3 deletions src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

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.4"
RealVersion = "v1.3.4"
TimeVersion = "2022-1-17"
UpdateVersion = "v1.3.5"
RealVersion = "v1.3.5"
TimeVersion = "2022-1-30"

Waifu2xVersion = "1.1.1"

Expand Down
Binary file modified src/data/book.db
Binary file not shown.
Loading

0 comments on commit b357cbc

Please sign in to comment.