This commit is contained in:
恍兮惚兮 2024-05-08 17:50:28 +08:00
parent 586a808c81
commit 4f14460506
3 changed files with 5 additions and 15 deletions

View File

@ -50,20 +50,14 @@ class Settin(closeashidewindow):
setstylesheetsignal = pyqtSignal() setstylesheetsignal = pyqtSignal()
def resizefunction(self): def resizefunction(self):
ww = self.size().width() - self.window_width * 0.2 - 30
for w in self.needfitwidgets: for w in self.needfitwidgets:
w.setFixedWidth( w.setFixedWidth(int(ww))
int(self.size().width() - self.window_width * 0.2 - self.scrollwidth)
)
for grid, maxl in self.needfitcols: for grid, maxl in self.needfitcols:
for c in range(maxl): for c in range(maxl):
grid.setColumnMinimumWidth( grid.setColumnMinimumWidth(
c, c,
int( int(ww / maxl),
self.size().width()
- self.window_width * 0.2
- self.scrollwidth // maxl
),
) )
def resizeEvent(self, a0: QResizeEvent) -> None: def resizeEvent(self, a0: QResizeEvent) -> None:
@ -121,7 +115,6 @@ class Settin(closeashidewindow):
self.window_width = 900 if globalconfig["languageuse"] == 0 else 1200 self.window_width = 900 if globalconfig["languageuse"] == 0 else 1200
self.window_height = 500 self.window_height = 500
self.scrollwidth = 20
self.savelastrect = None self.savelastrect = None
self.hooks = [] self.hooks = []
@ -317,9 +310,6 @@ class Settin(closeashidewindow):
scroll = QScrollArea() scroll = QScrollArea()
scroll.setHorizontalScrollBarPolicy(1) scroll.setHorizontalScrollBarPolicy(1)
scroll.setStyleSheet("""QScrollArea{background-color:transparent;border:0px}""") scroll.setStyleSheet("""QScrollArea{background-color:transparent;border:0px}""")
scroll.verticalScrollBar().setStyleSheet(
"QScrollBar{width:%spx;}" % self.scrollwidth
)
self.needfitwidgets.append(widget) self.needfitwidgets.append(widget)
scroll.setWidget(widget) scroll.setWidget(widget)

View File

@ -87,7 +87,7 @@ def initsome11(self, l, label=None):
grids.append(line) grids.append(line)
line = [] line = []
else: else:
line += [] line += [""]
if len(line): if len(line):
grids.append(line) grids.append(line)
return grids return grids

View File

@ -66,7 +66,7 @@ def getocrgrid(self):
grids.append(line) grids.append(line)
line = [] line = []
else: else:
line += [] line += [""]
i += 1 i += 1
if len(line): if len(line):
grids.append(line) grids.append(line)