mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-12 23:23:54 +08:00
.
This commit is contained in:
parent
36517df494
commit
082fac5614
@ -52,7 +52,7 @@ class AttachProcessDialog(saveposwindow):
|
||||
qtawesome.icon(globalconfig["toolbutton"]["buttons"]["selectgame"]["icon"])
|
||||
)
|
||||
w = QWidget()
|
||||
self.layout1 = QVBoxLayout()
|
||||
self.layout1 = QVBoxLayout(w)
|
||||
self.label = LLabel(
|
||||
(
|
||||
"如果没看见想要附加的进程,可以尝试点击下方按钮后点击游戏窗口,或者尝试使用管理员权限运行本软件"
|
||||
@ -105,7 +105,6 @@ class AttachProcessDialog(saveposwindow):
|
||||
bottomlayout.addWidget(self.buttonBox)
|
||||
|
||||
self.layout1.addLayout(bottomlayout)
|
||||
w.setLayout(self.layout1)
|
||||
self.setCentralWidget(w)
|
||||
|
||||
self.buttonBox.accepted.connect(self.accept)
|
||||
|
@ -30,7 +30,8 @@ class dialog_memory(saveposwindow):
|
||||
)
|
||||
self.setWindowTitle("备忘录")
|
||||
self.setWindowIcon(qtawesome.icon(globalconfig["toolbutton"]["buttons"]["memory"]["icon"]))
|
||||
formLayout = QVBoxLayout() #
|
||||
_w = QWidget()
|
||||
formLayout = QVBoxLayout(_w) #
|
||||
self.showtext = QTextEdit()
|
||||
self.rwpath = gobject.getuserconfigdir(
|
||||
"memory/{}.html".format(gobject.baseobject.gameuid)
|
||||
@ -57,7 +58,5 @@ class dialog_memory(saveposwindow):
|
||||
self.showtext.textChanged.connect(self.save)
|
||||
x.addWidget(insertpicbtn)
|
||||
formLayout.addLayout(x)
|
||||
_w = QWidget()
|
||||
_w.setLayout(formLayout)
|
||||
self.setCentralWidget(_w)
|
||||
self.show()
|
||||
|
@ -113,11 +113,9 @@ class TagWidget(QWidget):
|
||||
def __init__(self, parent=None, exfoucus=True):
|
||||
super().__init__(parent)
|
||||
tagitem.setstyles(self)
|
||||
layout = QHBoxLayout()
|
||||
layout = QHBoxLayout(self)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
self.lineEdit = FocusCombo()
|
||||
if exfoucus:
|
||||
self.lineEdit.setLineEdit(FQLineEdit())
|
||||
@ -656,7 +654,7 @@ class dialog_savedgame_new(QWidget):
|
||||
self._parent = parent
|
||||
self.setstyle()
|
||||
gobject.global_dialog_savedgame_new = self
|
||||
formLayout = QVBoxLayout()
|
||||
formLayout = QVBoxLayout(self)
|
||||
layout = QHBoxLayout()
|
||||
self.setAcceptDrops(True)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
@ -682,7 +680,6 @@ class dialog_savedgame_new(QWidget):
|
||||
self.savebutton = []
|
||||
|
||||
self.idxsave = []
|
||||
self.setLayout(formLayout)
|
||||
self.activategamenum = 1
|
||||
self.itemfocuschanged(False, None)
|
||||
if globalconfig["hide_not_exists"]:
|
||||
|
@ -99,12 +99,11 @@ class tagitem(QFrame):
|
||||
border_color = "yellow"
|
||||
self.setObjectName(border_color)
|
||||
|
||||
tagLayout = QHBoxLayout()
|
||||
tagLayout = QHBoxLayout(self)
|
||||
tagLayout.setContentsMargins(0, 0, 0, 0)
|
||||
tagLayout.setSpacing(0)
|
||||
|
||||
key = (tag, _type, refdata)
|
||||
self.setLayout(tagLayout)
|
||||
lb = ClickableLabel()
|
||||
lb.setStyleSheet("background:transparent")
|
||||
lb.setText(tag)
|
||||
|
@ -211,7 +211,6 @@ class dialog_setting_game_internal(QWidget):
|
||||
vbox = QVBoxLayout(self)
|
||||
self.lauchpath = None
|
||||
formLayout = LFormLayout()
|
||||
self.setLayout(vbox)
|
||||
self.gameuid = gameuid
|
||||
formLayout.addRow(
|
||||
"路径",
|
||||
@ -272,23 +271,20 @@ class dialog_setting_game_internal(QWidget):
|
||||
|
||||
def ___tabf(self, function, gameuid):
|
||||
_w = QWidget()
|
||||
formLayout = LFormLayout()
|
||||
_w.setLayout(formLayout)
|
||||
formLayout = LFormLayout(_w)
|
||||
do = functools.partial(function, formLayout, gameuid)
|
||||
return _w, do
|
||||
|
||||
def ___tabf2(self, function, gameuid):
|
||||
_w = QWidget()
|
||||
formLayout = QVBoxLayout()
|
||||
_w.setLayout(formLayout)
|
||||
formLayout = QVBoxLayout(_w)
|
||||
do = functools.partial(function, formLayout, gameuid)
|
||||
return _w, do
|
||||
|
||||
def ___tabf3(self, function, gameuid):
|
||||
_w = QWidget()
|
||||
formLayout = QVBoxLayout()
|
||||
formLayout = QVBoxLayout(_w)
|
||||
formLayout.setContentsMargins(0, 0, 0, 0)
|
||||
_w.setLayout(formLayout)
|
||||
do = functools.partial(function, formLayout, gameuid)
|
||||
return _w, do
|
||||
|
||||
@ -453,8 +449,7 @@ class dialog_setting_game_internal(QWidget):
|
||||
|
||||
def starttab(self, formLayout: LFormLayout, gameuid):
|
||||
box = QGroupBox()
|
||||
settinglayout = LFormLayout()
|
||||
box.setLayout(settinglayout)
|
||||
settinglayout = LFormLayout(box)
|
||||
|
||||
def __(box, layout, config, uid):
|
||||
clearlayout(layout)
|
||||
@ -753,9 +748,8 @@ class dialog_setting_game_internal(QWidget):
|
||||
)
|
||||
__extraw.setEnabled(not dic[key])
|
||||
formLayout.addRow(__extraw)
|
||||
formLayout2 = klass()
|
||||
formLayout2 = klass(__extraw)
|
||||
formLayout2.setContentsMargins(0, 0, 0, 0)
|
||||
__extraw.setLayout(formLayout2)
|
||||
return formLayout2
|
||||
|
||||
def getttssetting(self, formLayout: LFormLayout, gameuid):
|
||||
@ -1103,8 +1097,7 @@ class dialog_setting_game_internal(QWidget):
|
||||
)
|
||||
box = LGroupBox()
|
||||
box.setTitle("额外的钩子")
|
||||
settinglayout = LFormLayout()
|
||||
box.setLayout(settinglayout)
|
||||
settinglayout = LFormLayout(box)
|
||||
formLayout.addRow(box)
|
||||
settinglayout.addRow(
|
||||
"Win32通用钩子",
|
||||
@ -1131,8 +1124,7 @@ class dialog_setting_game_internal(QWidget):
|
||||
),
|
||||
)
|
||||
box = QGroupBox()
|
||||
settinglayout = LFormLayout()
|
||||
box.setLayout(settinglayout)
|
||||
settinglayout = LFormLayout(box)
|
||||
formLayout.addRow(box)
|
||||
for k in [
|
||||
"codepage_index",
|
||||
@ -1213,7 +1205,6 @@ class dialog_setting_game(QDialog):
|
||||
_.methodtab.setCurrentIndex(setindexhook)
|
||||
_.setMinimumWidth(600)
|
||||
l = QHBoxLayout(self)
|
||||
self.setLayout(l)
|
||||
l.addWidget(_)
|
||||
l.setContentsMargins(0, 0, 0, 0)
|
||||
self.show()
|
||||
|
@ -93,7 +93,7 @@ class clickitem(QWidget):
|
||||
super().__init__()
|
||||
|
||||
self.uid = uid
|
||||
self.lay = QHBoxLayout()
|
||||
self.lay = QHBoxLayout(self)
|
||||
self.lay.setSpacing(0)
|
||||
lay1 = QHBoxLayout()
|
||||
self.lay1 = lay1
|
||||
@ -125,7 +125,6 @@ class clickitem(QWidget):
|
||||
self._2 = _
|
||||
_.setObjectName("savegame_textfont2")
|
||||
self.lay.addWidget(_)
|
||||
self.setLayout(self.lay)
|
||||
|
||||
|
||||
class fadeoutlabel(QLabel):
|
||||
@ -257,12 +256,11 @@ class previewimages(QWidget):
|
||||
|
||||
def __init__(self, p) -> None:
|
||||
super().__init__(p)
|
||||
self.lay = QHBoxLayout()
|
||||
self.lay = QHBoxLayout(self)
|
||||
self.lay.setContentsMargins(0, 0, 0, 0)
|
||||
self.list = MyQListWidget(self)
|
||||
self.list.currentRowChanged.connect(self._visidx)
|
||||
self.lay.addWidget(self.list)
|
||||
self.setLayout(self.lay)
|
||||
|
||||
def tolastnext(self, dx):
|
||||
if self.list.count() == 0:
|
||||
@ -362,11 +360,10 @@ class viewpixmap_x(QWidget):
|
||||
self.commentedit = QPlainTextEdit(self)
|
||||
self.commentedit.textChanged.connect(self.changecommit)
|
||||
self.centerwidget = QWidget(self)
|
||||
self.centerwidgetlayout = QVBoxLayout()
|
||||
self.centerwidgetlayout = QVBoxLayout(self.centerwidget)
|
||||
audio = QHBoxLayout()
|
||||
self.recordbtn = statusbutton(icons=["fa.microphone", "fa.stop"])
|
||||
self.recordbtn.clicked.connect(self.startorendrecord)
|
||||
self.centerwidget.setLayout(self.centerwidgetlayout)
|
||||
self.centerwidgetlayout.addWidget(self.commentedit)
|
||||
self.centerwidgetlayout.addLayout(audio)
|
||||
audio.addWidget(self.recordbtn)
|
||||
@ -530,7 +527,6 @@ class pixwrapper(QWidget):
|
||||
self.setrank(rank)
|
||||
self.sethor(hor)
|
||||
self.pixview.tolastnext.connect(self.previewimages.tolastnext)
|
||||
self.setLayout(self.vlayout)
|
||||
self.previewimages.changepixmappath.connect(self.changepixmappath)
|
||||
self.previewimages.removepath.connect(self.removepath)
|
||||
self.k = None
|
||||
@ -833,9 +829,8 @@ class dialog_savedgame_v3(QWidget):
|
||||
self.stack.bgclicked.connect(clickitem.clearfocus)
|
||||
self.setstyle()
|
||||
spl = QSplitter()
|
||||
_l = QHBoxLayout()
|
||||
_l = QHBoxLayout(self)
|
||||
_l.addWidget(spl)
|
||||
self.setLayout(_l)
|
||||
|
||||
spl.addWidget(self.stack)
|
||||
self.righttop = makesubtab_lazy()
|
||||
@ -846,9 +841,8 @@ class dialog_savedgame_v3(QWidget):
|
||||
)
|
||||
)
|
||||
_w = QWidget()
|
||||
rightlay = QVBoxLayout()
|
||||
rightlay = QVBoxLayout(_w)
|
||||
rightlay.setContentsMargins(0, 0, 0, 0)
|
||||
_w.setLayout(rightlay)
|
||||
self.righttop.addTab(_w, "画廊")
|
||||
spl.addWidget(self.righttop)
|
||||
|
||||
|
@ -34,10 +34,9 @@ class edittext(saveposwindow):
|
||||
self.textOutput.setUndoRedoEnabled(True)
|
||||
self.textOutput.setReadOnly(False)
|
||||
|
||||
qv = QHBoxLayout()
|
||||
w = QWidget()
|
||||
qv = QHBoxLayout(w)
|
||||
self.setCentralWidget(w)
|
||||
w.setLayout(qv)
|
||||
|
||||
bt1 = QPushButton(
|
||||
icon=qtawesome.icon("fa.rotate-right", color=globalconfig["buttoncolor"])
|
||||
@ -147,10 +146,9 @@ class edittrans(LMainWindow):
|
||||
self.setWindowIcon(qtawesome.icon("fa.edit"))
|
||||
|
||||
self.textOutput = ctrlenter(self)
|
||||
qv = QHBoxLayout()
|
||||
w = QWidget()
|
||||
qv = QHBoxLayout(w)
|
||||
self.setCentralWidget(w)
|
||||
w.setLayout(qv)
|
||||
self.textOutput.enterpressed.connect(self.submitfunction)
|
||||
submit = LPushButton("确定")
|
||||
inter, vis = loadvalidtss()
|
||||
|
@ -471,8 +471,7 @@ class autoinitdialog(LDialog):
|
||||
super().__init__(parent, Qt.WindowType.WindowCloseButtonHint)
|
||||
self.setWindowTitle(title)
|
||||
self.resize(QSize(width, 10))
|
||||
formLayout = VisLFormLayout()
|
||||
self.setLayout(formLayout)
|
||||
formLayout = VisLFormLayout(self)
|
||||
regist = {}
|
||||
|
||||
def save(callback=None):
|
||||
|
@ -47,7 +47,6 @@ def sqlite2json2(
|
||||
dialog.setWindowTitle("导出翻译记录为json文件")
|
||||
dialog.resize(QSize(800, 10))
|
||||
formLayout = LFormLayout(dialog) # 配置layout
|
||||
dialog.setLayout(formLayout)
|
||||
|
||||
combo = SuperCombo()
|
||||
combo.addItems([getannotatedapiname(_) for _ in _collect], _collect)
|
||||
|
@ -41,11 +41,10 @@ def getformlayoutw(w=None, cls=LFormLayout, hide=False):
|
||||
_w = QWidget()
|
||||
else:
|
||||
_w = w
|
||||
_l = cls()
|
||||
_l = cls(_w)
|
||||
if hide:
|
||||
_w.hide()
|
||||
_l.setContentsMargins(0, 0, 0, 0)
|
||||
_w.setLayout(_l)
|
||||
return _w, _l
|
||||
|
||||
|
||||
@ -209,10 +208,9 @@ class searchhookparam(LDialog):
|
||||
windows.SWP_NOACTIVATE | windows.SWP_NOSIZE | windows.SWP_NOMOVE,
|
||||
)
|
||||
self.setWindowTitle("搜索设置")
|
||||
mainlayout = QVBoxLayout()
|
||||
mainlayout = QVBoxLayout(self)
|
||||
checks = QButtonGroup_switch_widegt(self)
|
||||
self.searchmethod = checks
|
||||
self.setLayout(mainlayout)
|
||||
|
||||
layout1 = QHBoxLayout()
|
||||
layout1.addWidget(LLabel("代码页"))
|
||||
@ -556,8 +554,7 @@ class hookselect(closeashidewindow):
|
||||
self.setWindowIcon(
|
||||
qtawesome.icon(globalconfig["toolbutton"]["buttons"]["selecttext"]["icon"])
|
||||
)
|
||||
self.hboxlayout = QHBoxLayout()
|
||||
self.widget.setLayout(self.hboxlayout)
|
||||
self.hboxlayout = QHBoxLayout(self.widget)
|
||||
self.vboxlayout = QVBoxLayout()
|
||||
self.hboxlayout.addLayout(self.vboxlayout)
|
||||
self.ttCombomodelmodel = LStandardItemModel()
|
||||
|
@ -27,10 +27,9 @@ class TabWidget(QWidget):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(TabWidget, self).__init__(parent)
|
||||
layout = QHBoxLayout()
|
||||
layout = QHBoxLayout(self)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.setSpacing(0)
|
||||
self.setLayout(layout)
|
||||
self.splitter = QSplitter()
|
||||
layout.addWidget(self.splitter)
|
||||
self.list_widget = LListWidget(self)
|
||||
|
@ -27,8 +27,7 @@ class dialog_selecticon(LDialog):
|
||||
) as ff:
|
||||
js = json.load(ff)
|
||||
|
||||
layout = QGridLayout()
|
||||
self.setLayout(layout)
|
||||
layout = QGridLayout(self)
|
||||
for i, name in enumerate(js):
|
||||
layout.addWidget(
|
||||
getIconButton(
|
||||
|
@ -81,14 +81,13 @@ class extrahtml(saveposwindow):
|
||||
self.btn_apply = LPushButton("测试")
|
||||
self.btn_apply.clicked.connect(self.applyhtml)
|
||||
self.vistext = QPlainTextEdit()
|
||||
lay = QVBoxLayout()
|
||||
w = QWidget()
|
||||
lay = QVBoxLayout(w)
|
||||
hl = QHBoxLayout()
|
||||
hl.addWidget(self.btn_save)
|
||||
hl.addWidget(self.btn_apply)
|
||||
lay.addWidget(self.vistext)
|
||||
lay.addLayout(hl)
|
||||
w = QWidget()
|
||||
w.setLayout(lay)
|
||||
self.setCentralWidget(w)
|
||||
self.tryload()
|
||||
self.show()
|
||||
@ -233,8 +232,7 @@ def creategoodfontwid(self):
|
||||
self.goodfontsettingsWidget.setStyleSheet(
|
||||
"QGroupBox{ margin-top:0px;} QGroupBox:title {margin-top: 0px;}"
|
||||
)
|
||||
self.goodfontsettingsformlayout = LFormLayout()
|
||||
self.goodfontsettingsWidget.setLayout(self.goodfontsettingsformlayout)
|
||||
self.goodfontsettingsformlayout = LFormLayout(self.goodfontsettingsWidget)
|
||||
resetgroudswitchcallback(self, globalconfig["rendertext_using"])
|
||||
return self.goodfontsettingsWidget
|
||||
|
||||
|
@ -48,9 +48,8 @@ def createhorizontal_slider(self):
|
||||
functools.partial(changeHorizontal, self)
|
||||
)
|
||||
w = QWidget()
|
||||
hb = QHBoxLayout()
|
||||
hb = QHBoxLayout(w)
|
||||
hb.setContentsMargins(0, 0, 0, 0)
|
||||
w.setLayout(hb)
|
||||
|
||||
self.horizontal_slider_label = QLabel()
|
||||
self.horizontal_slider_label.setText("{}%".format(globalconfig["transparent"]))
|
||||
|
@ -242,7 +242,6 @@ def selectgameuid(self):
|
||||
dialog.setWindowTitle("选择游戏")
|
||||
dialog.resize(QSize(800, 10))
|
||||
formLayout = LFormLayout(dialog)
|
||||
dialog.setLayout(formLayout)
|
||||
_internal = []
|
||||
_vis = []
|
||||
for gameuid in savehook_new_list:
|
||||
|
@ -88,8 +88,7 @@ class triggereditor(LDialog):
|
||||
table.customContextMenuRequested.connect(self.showmenu)
|
||||
self.hctable = table
|
||||
self.internalrealname = []
|
||||
formLayout = QVBoxLayout()
|
||||
self.setLayout(formLayout)
|
||||
formLayout = QVBoxLayout(self)
|
||||
formLayout.addWidget(self.hctable)
|
||||
self.vkeys = list(vkcode_map.keys())
|
||||
for row, k in enumerate(self.list): # 2
|
||||
@ -282,8 +281,7 @@ def _ocrparam(self):
|
||||
self._ocrparam.setStyleSheet(
|
||||
"QGroupBox{ margin-top:0px;} QGroupBox:title {margin-top: 0px;}"
|
||||
)
|
||||
self._ocrparaml = LFormLayout()
|
||||
self._ocrparam.setLayout(self._ocrparaml)
|
||||
self._ocrparaml = LFormLayout(self._ocrparam)
|
||||
_ocrparam_create(self, globalconfig["ocr_auto_method"])
|
||||
return self._ocrparam
|
||||
|
||||
@ -334,10 +332,9 @@ class showocrimage(saveposwindow):
|
||||
self.setWindowTitle("查看")
|
||||
self.originlabel = pixmapviewer()
|
||||
qw = QWidget()
|
||||
self.layout1 = QVBoxLayout()
|
||||
self.layout1 = QVBoxLayout(qw)
|
||||
self.setAcceptDrops(True)
|
||||
self.setCentralWidget(qw)
|
||||
qw.setLayout(self.layout1)
|
||||
icon = getIconButton(callback=self.openff, icon="fa.folder-open")
|
||||
button = getIconButton(callback=self.retest, icon="fa.rotate-right")
|
||||
hb = QHBoxLayout()
|
||||
|
@ -314,10 +314,9 @@ def btndeccallback(self, countnum, btnplus):
|
||||
|
||||
|
||||
def createmanybtn(self, countnum, btnplus):
|
||||
hbox = QHBoxLayout()
|
||||
hbox.setContentsMargins(0, 0, 0, 0)
|
||||
w = Shit()
|
||||
w.setLayout(hbox)
|
||||
hbox = QHBoxLayout(w)
|
||||
hbox.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
btn = QPushButton(self)
|
||||
btn.setIcon(qtawesome.icon("fa.plus"))
|
||||
|
@ -36,7 +36,8 @@ def delaysetcomparetext(self, s, x):
|
||||
|
||||
def getcomparelayout(self):
|
||||
|
||||
layout = QHBoxLayout()
|
||||
w = QWidget()
|
||||
layout = QHBoxLayout(w)
|
||||
fromtext = QPlainTextEdit()
|
||||
totext = QPlainTextEdit()
|
||||
solvebutton = getIconButton(
|
||||
@ -47,8 +48,6 @@ def getcomparelayout(self):
|
||||
layout.addWidget(fromtext)
|
||||
layout.addWidget(solvebutton)
|
||||
layout.addWidget(totext)
|
||||
w = QWidget()
|
||||
w.setLayout(layout)
|
||||
self.__fromtext = fromtext
|
||||
self.__totext = totext
|
||||
try:
|
||||
|
@ -118,11 +118,10 @@ class AnkiWindow(QWidget):
|
||||
tabadd_lazy(self.tabs, "设置", self.creatsetdtab)
|
||||
tabadd_lazy(self.tabs, "模板", self.creattemplatetab)
|
||||
|
||||
l = QHBoxLayout()
|
||||
l = QHBoxLayout(self)
|
||||
l.setContentsMargins(0, 0, 0, 0)
|
||||
l.setSpacing(0)
|
||||
l.addWidget(self.tabs)
|
||||
self.setLayout(l)
|
||||
self.refreshhtml.connect(self.refreshhtmlfunction)
|
||||
self.tabs.currentChanged.connect(self.ifshowrefresh)
|
||||
|
||||
@ -325,10 +324,9 @@ class AnkiWindow(QWidget):
|
||||
) as ff:
|
||||
ff.write(model_css)
|
||||
|
||||
def creatsetdtab(self, baselay):
|
||||
layout = VisLFormLayout()
|
||||
def creatsetdtab(self, baselay: QVBoxLayout):
|
||||
wid = QWidget()
|
||||
wid.setLayout(layout)
|
||||
layout = VisLFormLayout(wid)
|
||||
baselay.addWidget(wid)
|
||||
layout.addRow(
|
||||
"端口号", getspinbox(0, 65536, globalconfig["ankiconnect"], "port")
|
||||
@ -460,9 +458,8 @@ class AnkiWindow(QWidget):
|
||||
|
||||
def createaddtab(self):
|
||||
self.recorders = {}
|
||||
layout = QVBoxLayout()
|
||||
wid = QWidget()
|
||||
wid.setLayout(layout)
|
||||
layout = QVBoxLayout(wid)
|
||||
soundbutton = QPushButton(qtawesome.icon("fa.music"), "")
|
||||
soundbutton.clicked.connect(self.langdu)
|
||||
|
||||
@ -1015,8 +1012,7 @@ class showdiction(QWidget):
|
||||
self.tree.setUniformRowHeights(True)
|
||||
self.tree.setHeaderHidden(True)
|
||||
self.tree.setEditTriggers(QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
__lay = QVBoxLayout()
|
||||
self.setLayout(__lay)
|
||||
__lay = QVBoxLayout(self)
|
||||
__lay.setSpacing(0)
|
||||
__lay.setContentsMargins(0, 0, 0, 0)
|
||||
__lay.addLayout(wordfilter)
|
||||
@ -1066,10 +1062,6 @@ class showdiction(QWidget):
|
||||
|
||||
|
||||
class showwordfastwebview(auto_select_webview):
|
||||
|
||||
def __init__(self, parent, dyna=False):
|
||||
super().__init__(parent, dyna)
|
||||
|
||||
def _createwebview(self):
|
||||
web = super()._createwebview()
|
||||
if isinstance(web, WebivewWidget):
|
||||
@ -1147,6 +1139,7 @@ class searchwordW(closeashidewindow):
|
||||
self.hasclicked = True
|
||||
|
||||
def tabclicked(self, idx):
|
||||
self.tab.setCurrentIndex(idx)
|
||||
self.hasclicked = True
|
||||
try:
|
||||
html = self.cache_results[self.tabks[idx]]
|
||||
@ -1189,8 +1182,7 @@ class searchwordW(closeashidewindow):
|
||||
self.thisps = {}
|
||||
self.hasclicked = False
|
||||
ww = QWidget(self)
|
||||
self.vboxlayout = QVBoxLayout()
|
||||
ww.setLayout(self.vboxlayout)
|
||||
self.vboxlayout = QVBoxLayout(ww)
|
||||
self.searchlayout = QHBoxLayout()
|
||||
self.vboxlayout.addLayout(self.searchlayout)
|
||||
self.searchtext = FQLineEdit()
|
||||
@ -1285,14 +1277,12 @@ class searchwordW(closeashidewindow):
|
||||
self.cache_results = {}
|
||||
|
||||
self.spliter = QSplitter()
|
||||
|
||||
tablayout = QVBoxLayout()
|
||||
w = QWidget()
|
||||
tablayout = QVBoxLayout(w)
|
||||
tablayout.setContentsMargins(0, 0, 0, 0)
|
||||
tablayout.setSpacing(0)
|
||||
tablayout.addWidget(self.tab)
|
||||
tablayout.addWidget(self.textOutput)
|
||||
w = QWidget()
|
||||
w.setLayout(tablayout)
|
||||
self.vboxlayout.addWidget(self.spliter)
|
||||
self.isfirstshowanki = True
|
||||
self.isfirstshowdictwidget = True
|
||||
|
@ -489,9 +489,8 @@ class shownumQPushButton(QPushButton):
|
||||
class shrinkableitem(QWidget):
|
||||
def __init__(self, p, shrinker: shownumQPushButton, opened):
|
||||
super().__init__(p)
|
||||
self.lay = QVBoxLayout()
|
||||
self.lay = QVBoxLayout(self)
|
||||
# self.setSizePolicy(QSizePolicy.Policy.Expanding,QSizePolicy.Policy.Fixed)
|
||||
self.setLayout(self.lay)
|
||||
self.lay.setContentsMargins(0, 0, 0, 0)
|
||||
self.lay.setSpacing(0)
|
||||
self.btn = shrinker
|
||||
@ -587,18 +586,16 @@ class stackedlist(ScrollArea):
|
||||
internal = QWidget()
|
||||
internal.setObjectName("shit")
|
||||
self.setWidget(internal)
|
||||
self.lay = QVBoxLayout()
|
||||
self.setWidgetResizable(True)
|
||||
self.lay = QVBoxLayout(internal)
|
||||
self.lay.setAlignment(Qt.AlignmentFlag.AlignTop)
|
||||
self.lay.setSpacing(0)
|
||||
self.lay.setContentsMargins(0, 0, 0, 0)
|
||||
internal.setLayout(self.lay)
|
||||
self.widgets = []
|
||||
self.fakegeos = []
|
||||
self._spacing = 6
|
||||
self._margin = self._spacing # 9
|
||||
self.lock = threading.Lock()
|
||||
self.setWidgetResizable(True)
|
||||
self.setWidget(internal)
|
||||
self.internal = internal
|
||||
self.scrolled.connect(lambda _: self.doshowlazywidget(True, _))
|
||||
self.saveregion = QRect()
|
||||
|
@ -97,21 +97,20 @@ class ButtonBar(QFrame):
|
||||
def __init__(self, *argc):
|
||||
super().__init__(*argc)
|
||||
|
||||
def __(p=None):
|
||||
_ = QHBoxLayout()
|
||||
def __(p=None, pp=None):
|
||||
_ = QHBoxLayout(pp)
|
||||
_.setContentsMargins(0, 0, 0, 0)
|
||||
_.setSpacing(0)
|
||||
if p is not None:
|
||||
p.addLayout(_)
|
||||
return _
|
||||
|
||||
self.threelayout = __()
|
||||
self.threelayout = __(pp=self)
|
||||
self._left = __(self.threelayout)
|
||||
self.threelayout.addStretch()
|
||||
self._center = __(self.threelayout)
|
||||
self.threelayout.addStretch()
|
||||
self._right = __(self.threelayout)
|
||||
self.setLayout(self.threelayout)
|
||||
self.cntbtn = 0
|
||||
self.buttons = {}
|
||||
self.stylebuttons = {}
|
||||
@ -893,8 +892,7 @@ class TranslatorWindow(resizableframeless):
|
||||
_self.setWindowTitle("打开链接")
|
||||
l = QLabel(makehtml(_link, show=_link))
|
||||
l.setOpenExternalLinks(True)
|
||||
la = QHBoxLayout()
|
||||
_self.setLayout(la)
|
||||
la = QHBoxLayout(_self)
|
||||
la.addWidget(l)
|
||||
_self.exec()
|
||||
|
||||
|
@ -253,8 +253,7 @@ class TableViewW(QTableView):
|
||||
if w is None:
|
||||
return
|
||||
__w = QWidget()
|
||||
__l = QHBoxLayout()
|
||||
__w.setLayout(__l)
|
||||
__l = QHBoxLayout(__w)
|
||||
__l.setContentsMargins(0, 0, 0, 0)
|
||||
__l.addWidget(w)
|
||||
super().setIndexWidget(index, __w)
|
||||
@ -1067,7 +1066,8 @@ def selectcolor(
|
||||
def getboxlayout(
|
||||
widgets, lc=QHBoxLayout, margin0=False, makewidget=False, delay=False, both=False
|
||||
):
|
||||
cp_layout = lc()
|
||||
w = QWidget() if makewidget else None
|
||||
cp_layout = lc(w)
|
||||
|
||||
def __do(cp_layout, widgets):
|
||||
for w in widgets:
|
||||
@ -1085,9 +1085,6 @@ def getboxlayout(
|
||||
cp_layout.setContentsMargins(0, 0, 0, 0)
|
||||
if not delay:
|
||||
_do()
|
||||
if makewidget:
|
||||
w = QWidget()
|
||||
w.setLayout(cp_layout)
|
||||
if delay:
|
||||
return w, _do
|
||||
if both:
|
||||
@ -1563,9 +1560,8 @@ class auto_select_webview(QWidget):
|
||||
self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
|
||||
self.internal = None
|
||||
self.saveurl = None
|
||||
layout = QHBoxLayout()
|
||||
layout = QHBoxLayout(self)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.setLayout(layout)
|
||||
self.internalsavedzoom = 1
|
||||
self._maybecreate_internal()
|
||||
if dyna:
|
||||
@ -1671,9 +1667,8 @@ class threebuttons(QWidget):
|
||||
|
||||
def __init__(self, texts=None):
|
||||
super().__init__()
|
||||
layout = QHBoxLayout()
|
||||
layout = QHBoxLayout(self)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.setLayout(layout)
|
||||
if len(texts) >= 1:
|
||||
button = LPushButton(self)
|
||||
button.setText(texts[0])
|
||||
@ -1704,8 +1699,7 @@ class threebuttons(QWidget):
|
||||
|
||||
def tabadd_lazy(tab, title, getrealwidgetfunction):
|
||||
q = QWidget()
|
||||
v = QVBoxLayout()
|
||||
q.setLayout(v)
|
||||
v = QVBoxLayout(q)
|
||||
v.setContentsMargins(0, 0, 0, 0)
|
||||
q.lazyfunction = functools.partial(getrealwidgetfunction, v)
|
||||
tab.addTab(q, title)
|
||||
@ -1774,14 +1768,12 @@ def makegroupingrid(args):
|
||||
group.setObjectName("notitle")
|
||||
|
||||
if _type == "grid":
|
||||
grid = QGridLayout()
|
||||
group.setLayout(grid)
|
||||
grid = QGridLayout(group)
|
||||
automakegrid(grid, lis)
|
||||
if internallayoutname:
|
||||
setattr(parent, internallayoutname, grid)
|
||||
elif _type == "form":
|
||||
lay = LFormLayout()
|
||||
group.setLayout(lay)
|
||||
lay = LFormLayout(group)
|
||||
makeforms(lay, lis)
|
||||
if internallayoutname:
|
||||
setattr(parent, internallayoutname, lay)
|
||||
@ -1861,9 +1853,8 @@ def makegrid(grid=None, save=False, savelist=None, savelay=None, delay=False):
|
||||
pass
|
||||
|
||||
gridlayoutwidget = gridwidget()
|
||||
gridlay = QGridLayout()
|
||||
gridlay = QGridLayout(gridlayoutwidget)
|
||||
gridlay.setAlignment(Qt.AlignmentFlag.AlignTop)
|
||||
gridlayoutwidget.setLayout(gridlay)
|
||||
gridlayoutwidget.setStyleSheet("gridwidget{background-color:transparent;}")
|
||||
|
||||
def do(gridlay, grid, save, savelist, savelay):
|
||||
@ -2021,8 +2012,7 @@ class listediter(LDialog):
|
||||
table.customContextMenuRequested.connect(self.showmenu)
|
||||
self.hctable = table
|
||||
self.internalrealname = []
|
||||
formLayout = QVBoxLayout()
|
||||
self.setLayout(formLayout)
|
||||
formLayout = QVBoxLayout(self)
|
||||
formLayout.addWidget(self.hctable)
|
||||
for row, k in enumerate(lst): # 2
|
||||
try:
|
||||
@ -2191,10 +2181,9 @@ class listediterline(QWidget):
|
||||
self.edit = ClickableLine()
|
||||
self.reflist = reflist
|
||||
self.setText("|".join(reflist))
|
||||
hbox = QHBoxLayout()
|
||||
hbox = QHBoxLayout(self)
|
||||
hbox.setContentsMargins(0, 0, 0, 0)
|
||||
hbox.addWidget(self.edit)
|
||||
self.setLayout(hbox)
|
||||
callback = functools.partial(
|
||||
listediter,
|
||||
self,
|
||||
@ -2640,7 +2629,6 @@ class CollapsibleBox(QGroupBox):
|
||||
lay = QVBoxLayout(self)
|
||||
if margin0:
|
||||
lay.setContentsMargins(0, 0, 0, 0)
|
||||
self.setLayout(lay)
|
||||
self.func = delayloadfunction
|
||||
self.toggle(False)
|
||||
|
||||
@ -2712,8 +2700,7 @@ class editswitchTextBrowser(QWidget):
|
||||
)
|
||||
stack.addWidget(self.browser)
|
||||
stack.addWidget(self.edit)
|
||||
l = QHBoxLayout()
|
||||
self.setLayout(l)
|
||||
l = QHBoxLayout(self)
|
||||
l.setContentsMargins(0, 0, 0, 0)
|
||||
l.addWidget(stack)
|
||||
self.switch = statusbutton(
|
||||
|
@ -235,10 +235,9 @@ class bgmsettings(QFormLayout):
|
||||
self.lbinfo = QLabel()
|
||||
s.textChanged.connect(self.checkvalid)
|
||||
s.setText(_ref.config["access-token"])
|
||||
fl2 = QFormLayout()
|
||||
fl2.setContentsMargins(0, 0, 0, 0)
|
||||
ww = QWidget()
|
||||
ww.setLayout(fl2)
|
||||
fl2 = QFormLayout(ww)
|
||||
fl2.setContentsMargins(0, 0, 0, 0)
|
||||
ww.hide()
|
||||
self.fl2 = ww
|
||||
self.showhide.connect(self.fl2.setVisible)
|
||||
|
@ -292,10 +292,9 @@ class vndbsettings(QFormLayout):
|
||||
self.lbinfo = QLabel()
|
||||
s.textChanged.connect(self.checkvalid)
|
||||
s.setText(_ref.config["Token"])
|
||||
fl2 = QFormLayout()
|
||||
fl2.setContentsMargins(0, 0, 0, 0)
|
||||
ww = QWidget()
|
||||
ww.setLayout(fl2)
|
||||
fl2 = QFormLayout(ww)
|
||||
fl2.setContentsMargins(0, 0, 0, 0)
|
||||
ww.hide()
|
||||
self.fl2 = ww
|
||||
self.showhide.connect(self.fl2.setVisible)
|
||||
|
@ -143,9 +143,8 @@ def doinstall(self, allsupports: list, parent, callback):
|
||||
|
||||
def question():
|
||||
dialog = QWidget()
|
||||
formLayout = LFormLayout()
|
||||
formLayout = LFormLayout(dialog)
|
||||
formLayout.setContentsMargins(0, 0, 0, 0)
|
||||
dialog.setLayout(formLayout)
|
||||
supportlang = LLabel()
|
||||
supportlang.setWordWrap(True)
|
||||
formLayout.addRow("当前支持的语言", supportlang)
|
||||
|
@ -67,9 +67,8 @@ def installx(combo: _SuperCombo, btninstall, supportlang):
|
||||
|
||||
def question():
|
||||
dialog = QWidget()
|
||||
formLayout = LFormLayout()
|
||||
formLayout = LFormLayout(dialog)
|
||||
formLayout.setContentsMargins(0, 0, 0, 0)
|
||||
dialog.setLayout(formLayout)
|
||||
supportlang = QLabel()
|
||||
supportlang.setText(", ".join([_[1] for _ in winrtutils.getlanguagelist()]))
|
||||
supportlang.setWordWrap(True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user