mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix donate button being rendered as a blank when toolbar icons are turned off
This does mean that there will be one icon on the toolbar always (unless the donate button is removed).
This commit is contained in:
parent
874507efec
commit
3a152fe2b2
@ -704,6 +704,6 @@ class BarsManager(QObject):
|
||||
for bar in self.bars:
|
||||
bar.setIconSize(QSize(sz, sz))
|
||||
bar.setToolButtonStyle(style)
|
||||
if bar.showing_donate:
|
||||
if bar.donate_button:
|
||||
bar.donate_button.setIconSize(bar.iconSize())
|
||||
bar.donate_button.setToolButtonStyle(style)
|
||||
|
@ -56,6 +56,8 @@ class ThrobbingButton(QToolButton):
|
||||
if self.animation.state() != QAbstractAnimation.State.Stopped or not self.isVisible():
|
||||
return
|
||||
size = self.iconSize().width()
|
||||
if size < 1:
|
||||
size = max(0, self.width() - 4)
|
||||
smaller = int(0.7 * size)
|
||||
self.animation.setStartValue(smaller)
|
||||
self.animation.setEndValue(size)
|
||||
@ -67,6 +69,7 @@ class ThrobbingButton(QToolButton):
|
||||
|
||||
def paintEvent(self, ev):
|
||||
size = self._icon_size if self._icon_size > 10 else self.iconSize().width()
|
||||
size = size or max(0, self.width() - 4)
|
||||
p = QPainter(self)
|
||||
opt = QStyleOptionToolButton()
|
||||
self.initStyleOption(opt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user