mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
fix
This commit is contained in:
parent
78c837253b
commit
1f097a6d27
@ -1,5 +1,6 @@
|
|||||||
from qtsymbols import *
|
from qtsymbols import *
|
||||||
from myutils.config import globalconfig
|
from myutils.config import globalconfig
|
||||||
|
import unicodedata
|
||||||
|
|
||||||
|
|
||||||
class base(QWidget):
|
class base(QWidget):
|
||||||
@ -55,13 +56,15 @@ class base(QWidget):
|
|||||||
self.movedy = 0
|
self.movedy = 0
|
||||||
dx, dy = self.moveoffset()
|
dx, dy = self.moveoffset()
|
||||||
text = self.text()
|
text = self.text()
|
||||||
isarabic = lambda char: (ord(char) >= 0x0600 and ord(char) <= 0x06E0)
|
al = False
|
||||||
isfirstara = lambda text: len(text) and (
|
for _ in text:
|
||||||
isarabic(text[0])
|
d = unicodedata.bidirectional(_)
|
||||||
or (any(isarabic(_) for _ in text))
|
if d == "AL" or d == "R":
|
||||||
and (isarabic(text[0]) or (ord(text[0]) in (32, 46)))
|
al = True
|
||||||
)
|
break
|
||||||
if isfirstara(text):
|
if d == "L":
|
||||||
|
break
|
||||||
|
if al:
|
||||||
self.movedx -= self.width()
|
self.movedx -= self.width()
|
||||||
self.movedx += dx
|
self.movedx += dx
|
||||||
else:
|
else:
|
||||||
|
@ -29,7 +29,7 @@ include(generate_product_version)
|
|||||||
|
|
||||||
set(VERSION_MAJOR 5)
|
set(VERSION_MAJOR 5)
|
||||||
set(VERSION_MINOR 38)
|
set(VERSION_MINOR 38)
|
||||||
set(VERSION_PATCH 13)
|
set(VERSION_PATCH 14)
|
||||||
|
|
||||||
add_library(pch pch.cpp)
|
add_library(pch pch.cpp)
|
||||||
target_precompile_headers(pch PUBLIC pch.h)
|
target_precompile_headers(pch PUBLIC pch.h)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user