Skip to content

Commit 4b1d45a

Browse files
committed
v1.3.4
1 parent 49e3d24 commit 4b1d45a

File tree

13 files changed

+72
-36
lines changed

13 files changed

+72
-36
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelogs
22

3+
### 2022-08-31
4+
[v1.3.4](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.4)发布
5+
6+
1. 添加离线日译英模型Sugoi Translator(仅日译英, 作者[mingshiba](https://www.patreon.com/mingshiba), 已获得集成授权), 感谢[@Snowad14](https://github.com/Snowad14)提供CT2转换模型
7+
2. 来自[bropines](https://github.com/bropines)的俄语本地化支持
8+
3. 文本编辑支持字距调节
9+
4. 调整竖排符号及半角字符位置规则, 详见https://github.com/dmMaze/BallonsTranslator/pull/30
10+
311
### 2022-08-17
412
[v1.3.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.0)发布
513

CHANGELOG_EN.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelogs
22

3+
### 2022-08-31
4+
[v1.3.4](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.4) released
5+
6+
1. Add Sugoi Translator(Japanese-English only, created & authorized by [mingshiba](https://www.patreon.com/mingshiba)): download the [model](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm) converted by [@Snowad14](https://github.com/Snowad14) and put "sugoi_translator" in the "data" folder.
7+
2. Add support for russian, thanks to [bropines](https://github.com/bropines)
8+
3. Support letter spacing adjustment.
9+
4. Vertical type rework & text rendering bug fixes: https://github.com/dmMaze/BallonsTranslator/pull/30
10+
311
### 2022-08-17
412
[v1.3.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.0) released
513

ballontranslator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# 1. MAJOR version when you make incompatible API changes;
55
# 2. MINOR version when you add functionality in a backwards-compatible manner;
66
# 3. PATCH version when you make backwards-compatible bug fixes.
7-
__version__ = "1.3.0"
7+
__version__ = "1.3.4"

ballontranslator/__main__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ def main():
1616
else:
1717
os.environ['QT_API'] = args.qt_api
1818

19+
if sys.platform == 'win32':
20+
import ctypes
21+
myappid = u'BalloonsTranslator' # arbitrary string
22+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
23+
1924
import qtpy
2025
from qtpy.QtWidgets import QApplication
2126
from qtpy.QtCore import QTranslator, QLocale
2227
from qtpy.QtGui import QIcon
2328

24-
from ui.mainwindow import MainWindow
2529
from ui import constants
26-
27-
if sys.platform == 'win32':
28-
import ctypes
29-
myappid = u'BalloonsTranslator' # arbitrary string
30-
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
31-
3230
if qtpy.API_NAME[-1] == '6':
3331
constants.FLAG_QT6 = True
32+
33+
from ui.mainwindow import MainWindow
3434

3535
os.chdir(constants.PROGRAM_PATH)
3636
app = QApplication(sys.argv)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
nuitka --standalone --mingw64 --nofollow-imports --show-memory --show-progress ^
22
--enable-plugin=pyqt5 --include-qt-plugins=sensible,styles ^
33
--follow-import-to=dl,utils,ui --include-plugin-directory=ballontranslator/dl,ballontranslator/ui,ballontranslator/utils ^
4-
--windows-product-version=1.3.0.0 --windows-company-name=DUMMY_WINDOWS_COMPANY_NAME --windows-product-name=BallonTranslator ^
4+
--windows-product-version=1.3.4.0 --windows-company-name=DUMMY_WINDOWS_COMPANY_NAME --windows-product-name=BallonTranslator ^
55
--output-dir=release BallonTranslator

ballontranslator/ui/configpanel.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
import json
33

44
from qtpy.QtWidgets import QLayout, QHBoxLayout, QVBoxLayout, QTreeView, QWidget, QLabel, QSizePolicy, QSpacerItem, QCheckBox, QSplitter, QScrollArea, QGroupBox, QLineEdit
5-
from qtpy.QtCore import Qt, QModelIndex, Signal, QSize
5+
from qtpy.QtCore import Qt, QModelIndex, Signal, QSize, QEvent, QItemSelection
66
from qtpy.QtGui import QStandardItem, QStandardItemModel, QMouseEvent, QFont, QColor, QPalette
7-
from qtpy import QtCore
7+
8+
from . import constants as C
9+
10+
11+
# nuitka seems to require import QtCore explicitly
12+
if C.FLAG_QT6:
13+
from PyQt6 import QtCore
14+
else:
15+
from PyQt5 import QtCore
16+
817

918
from utils.logger import logger as LOGGER
1019
from .stylewidgets import Widget, ConfigComboBox
@@ -55,9 +64,9 @@ def setIdx(self, idx0: int, idx1: int) -> None:
5564
self.idx0 = idx0
5665
self.idx1 = idx1
5766

58-
def enterEvent(self, a0: QtCore.QEvent) -> None:
67+
def enterEvent(self, e: QEvent) -> None:
5968
self.pressed.emit(self.idx0, self.idx1)
60-
return super().enterEvent(a0)
69+
return super().enterEvent(e)
6170

6271

6372
class ConfigBlock(Widget):
@@ -224,7 +233,7 @@ def addHeader(self, header: str) -> TableItem:
224233
rootNode.appendRow(ti)
225234
return ti
226235

227-
def selectionChanged(self, selected: QtCore.QItemSelection, deselected: QtCore.QItemSelection) -> None:
236+
def selectionChanged(self, selected: QItemSelection, deselected: QItemSelection) -> None:
228237
dis = deselected.indexes()
229238
sel = selected.indexes()
230239
model = self.model()

ballontranslator/ui/dlconfig_parse_widgets.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@
55
from utils.logger import logger as LOGGER
66
from .stylewidgets import ConfigComboBox
77
from .constants import CONFIG_FONTSIZE_CONTENT, CONFIG_COMBOBOX_MIDEAN, CONFIG_COMBOBOX_SHORT
8-
from . import constants as c
98

109
from qtpy.QtWidgets import QHBoxLayout, QVBoxLayout, QWidget, QLabel, QComboBox, QListView, QToolBar, QMenu, QSpacerItem, QPushButton, QCheckBox, QToolButton, QSplitter, QStylePainter, QStyleOption, QStyle, QScrollArea, QLineEdit, QGroupBox, QGraphicsSimpleTextItem
1110
from qtpy.QtCore import Qt, Signal
1211
from qtpy.QtGui import QFontMetricsF
13-
if c.FLAG_QT6:
14-
from qtpy.QtGui import QAction
15-
else:
16-
from qtpy.QtWidgets import QAction
17-
18-
1912

2013

2114
class ParamNameLabel(QLabel):

ballontranslator/ui/drawingpanel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ def on_inpaint_failed(self):
575575
self.clearInpaintItems()
576576

577577
def on_canvasctrl_released(self):
578-
if self.currentTool == self.inpaintTool:
578+
if self.isVisible() and self.currentTool == self.inpaintTool:
579579
self.runInpaint()
580580

581581
def on_begin_scale_tool(self, pos: QPointF):

ballontranslator/ui/mainwindow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from qtpy.QtWidgets import QMainWindow, QHBoxLayout, QVBoxLayout, QApplication, QStackedWidget, QWidget, QSplitter, QListWidget, QShortcut, QListWidgetItem
66
from qtpy.QtCore import Qt, QPoint, QSize
7-
from qtpy.QtGui import QGuiApplication, QIcon, QCloseEvent, QKeySequence, QImage, QPainter, QFont
7+
from qtpy.QtGui import QKeyEvent, QGuiApplication, QIcon, QCloseEvent, QKeySequence, QImage, QPainter, QFont
88

99
from utils.logger import logger as LOGGER
1010
from utils.io_utils import json_dump_nested_obj

ballontranslator/ui/mainwindowbars.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
from .stylewidgets import Widget, PaintQSlider
66
from .constants import WINDOW_BORDER_WIDTH, BOTTOMBAR_HEIGHT, DRAG_DIR_NONE, DRAG_DIR_VER, DRAG_DIR_BDIAG, DRAG_DIR_FDIAG
7-
from . import constants as c
7+
88

99
from qtpy.QtWidgets import QMainWindow, QHBoxLayout, QVBoxLayout, QFileDialog, QLabel, QSizePolicy, QToolBar, QMenu, QSpacerItem, QPushButton, QCheckBox, QToolButton
1010
from qtpy.QtCore import Qt, Signal, QPoint
1111
from qtpy.QtGui import QMouseEvent, QKeySequence
12-
if c.FLAG_QT6:
12+
13+
from . import constants as C
14+
if C.FLAG_QT6:
1315
from qtpy.QtGui import QAction
1416
else:
1517
from qtpy.QtWidgets import QAction
@@ -297,7 +299,7 @@ def stateCheckerChanged(self, checker_type: str):
297299

298300
def mouseMoveEvent(self, e: QMouseEvent) -> None:
299301
if not self.mainwindow.isMaximized():
300-
if c.FLAG_QT6:
302+
if C.FLAG_QT6:
301303
g_pos = e.globalPosition().toPoint()
302304
else:
303305
g_pos = e.globalPos()
@@ -317,7 +319,7 @@ def mouseMoveEvent(self, e: QMouseEvent) -> None:
317319
return super().mouseMoveEvent(e)
318320

319321
def mousePressEvent(self, e: QMouseEvent) -> None:
320-
if c.FLAG_QT6:
322+
if C.FLAG_QT6:
321323
g_pos = e.globalPosition().toPoint()
322324
else:
323325
g_pos = e.globalPos()
@@ -346,7 +348,7 @@ def __init__(self, mainwindow: QMainWindow):
346348

347349
def mouseMoveEvent(self, e: QMouseEvent) -> None:
348350
if not self.mainwindow.isMaximized():
349-
if c.FLAG_QT6:
351+
if C.FLAG_QT6:
350352
g_pos = e.globalPosition().toPoint()
351353
else:
352354
g_pos = e.globalPos()
@@ -366,7 +368,7 @@ def mouseMoveEvent(self, e: QMouseEvent) -> None:
366368
return super().mouseMoveEvent(e)
367369

368370
def mousePressEvent(self, e: QMouseEvent) -> None:
369-
if c.FLAG_QT6:
371+
if C.FLAG_QT6:
370372
g_pos = e.globalPosition().toPoint()
371373
else:
372374
g_pos = e.globalPos()
@@ -436,7 +438,7 @@ def onMinBtnClicked(self):
436438
self.mainwindow.showMinimized()
437439

438440
def mousePressEvent(self, event: QMouseEvent) -> None:
439-
if c.FLAG_QT6:
441+
if C.FLAG_QT6:
440442
g_pos = event.globalPosition().toPoint()
441443
else:
442444
g_pos = event.globalPos()
@@ -466,7 +468,7 @@ def mouseReleaseEvent(self, event: QMouseEvent) -> None:
466468
return super().mouseReleaseEvent(event)
467469

468470
def mouseMoveEvent(self, event: QMouseEvent) -> None:
469-
if c.FLAG_QT6:
471+
if C.FLAG_QT6:
470472
g_pos = event.globalPosition().toPoint()
471473
else:
472474
g_pos = event.globalPos()
@@ -624,7 +626,7 @@ def transCheckerStateChanged(self):
624626

625627
def mouseMoveEvent(self, event: QMouseEvent) -> None:
626628
if not self.mainwindow.isMaximized():
627-
if c.FLAG_QT6:
629+
if C.FLAG_QT6:
628630
g_pos = event.globalPosition().toPoint()
629631
else:
630632
g_pos = event.globalPos()
@@ -661,7 +663,7 @@ def mouseMoveEvent(self, event: QMouseEvent) -> None:
661663
return super().mouseMoveEvent(event)
662664

663665
def mousePressEvent(self, e: QMouseEvent) -> None:
664-
if c.FLAG_QT6:
666+
if C.FLAG_QT6:
665667
g_pos = e.globalPosition().toPoint()
666668
else:
667669
g_pos = e.globalPos()

0 commit comments

Comments
 (0)