This commit is contained in:
恍兮惚兮 2024-08-02 23:08:57 +08:00
parent c99880272a
commit 491dfb3739

View File

@ -94,7 +94,7 @@ class ButtonBar(QFrame):
self.threelayout.addStretch() self.threelayout.addStretch()
self._right = __(self.threelayout) self._right = __(self.threelayout)
self.setLayout(self.threelayout) self.setLayout(self.threelayout)
self.cntbtn = 0
self.buttons = {} self.buttons = {}
self.stylebuttons = {} self.stylebuttons = {}
self.iconstate = {} self.iconstate = {}
@ -211,8 +211,13 @@ class ButtonBar(QFrame):
globalconfig["toolbutton"]["buttons"][name]["align"] globalconfig["toolbutton"]["buttons"][name]["align"]
] ]
button.showinlayout(layout) button.showinlayout(layout)
cnt += button.width() cnt += 1
self.parent().setMinimumWidth(cnt) self.cntbtn = cnt
self.adjustminwidth()
def adjustminwidth(self):
w = self.cntbtn * self.height() * 2 / 1.5
self.parent().setMinimumWidth(int(w))
class QUnFrameWindow(resizableframeless): class QUnFrameWindow(resizableframeless):
@ -443,6 +448,7 @@ class QUnFrameWindow(resizableframeless):
def refreshtoolicon(self): def refreshtoolicon(self):
self.titlebar.setFixedHeight(int(globalconfig["buttonsize"] * 1.5)) self.titlebar.setFixedHeight(int(globalconfig["buttonsize"] * 1.5))
self.titlebar.adjustminwidth()
self.titlebar.refreshtoolicon() self.titlebar.refreshtoolicon()
self.setMinimumHeight(self.titlebar.height() * 2) self.setMinimumHeight(self.titlebar.height() * 2)
self.set_color_transparency() self.set_color_transparency()