mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix hidden donate button not really being hidden
This commit is contained in:
parent
ca19c14dfb
commit
615008a650
@ -232,6 +232,7 @@ class ToolBar(QToolBar): # {{{
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def build_bar(self):
|
def build_bar(self):
|
||||||
|
self.showing_donate = False
|
||||||
showing_device = self.location_manager.has_device
|
showing_device = self.location_manager.has_device
|
||||||
actions = '-device' if showing_device else ''
|
actions = '-device' if showing_device else ''
|
||||||
actions = gprefs['action-layout-toolbar'+actions]
|
actions = gprefs['action-layout-toolbar'+actions]
|
||||||
@ -250,6 +251,7 @@ class ToolBar(QToolBar): # {{{
|
|||||||
self.d_widget.setLayout(QVBoxLayout())
|
self.d_widget.setLayout(QVBoxLayout())
|
||||||
self.d_widget.layout().addWidget(self.donate_button)
|
self.d_widget.layout().addWidget(self.donate_button)
|
||||||
self.addWidget(self.d_widget)
|
self.addWidget(self.d_widget)
|
||||||
|
self.showing_donate = True
|
||||||
elif what in self.gui.iactions:
|
elif what in self.gui.iactions:
|
||||||
action = self.gui.iactions[what]
|
action = self.gui.iactions[what]
|
||||||
self.addAction(action.qaction)
|
self.addAction(action.qaction)
|
||||||
@ -292,7 +294,7 @@ class MainWindowMixin(object): # {{{
|
|||||||
self._central_widget_layout = QVBoxLayout()
|
self._central_widget_layout = QVBoxLayout()
|
||||||
self.centralwidget.setLayout(self._central_widget_layout)
|
self.centralwidget.setLayout(self._central_widget_layout)
|
||||||
self.resize(1012, 740)
|
self.resize(1012, 740)
|
||||||
self.donate_button = ThrobbingButton(self.centralwidget)
|
self.donate_button = ThrobbingButton()
|
||||||
self.location_manager = LocationManager(self)
|
self.location_manager = LocationManager(self)
|
||||||
|
|
||||||
self.iactions['Fetch News'].init_scheduler(db)
|
self.iactions['Fetch News'].init_scheduler(db)
|
||||||
|
@ -252,7 +252,8 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, # {{{
|
|||||||
|
|
||||||
self.read_settings()
|
self.read_settings()
|
||||||
self.finalize_layout()
|
self.finalize_layout()
|
||||||
self.donate_button.start_animation()
|
if self.tool_bar.showing_donate:
|
||||||
|
self.donate_button.start_animation()
|
||||||
self.set_window_title()
|
self.set_window_title()
|
||||||
|
|
||||||
for ac in self.iactions.values():
|
for ac in self.iactions.values():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user