mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
93f7310100
commit
5012d9066c
@ -180,9 +180,9 @@ class ToolBar(QToolBar): # {{{
|
|||||||
aa = iac.qaction
|
aa = iac.qaction
|
||||||
w = self.widgetForAction(aa)
|
w = self.widgetForAction(aa)
|
||||||
m = aa.menu()
|
m = aa.menu()
|
||||||
if (((w is not None and w.geometry().contains(pos)) or
|
if (((w is not None and w.geometry().contains(pos)) or (
|
||||||
(m is not None and m.isVisible() and m.geometry().contains(pos))) and
|
m is not None and m.isVisible() and m.geometry().contains(pos))) and getattr(
|
||||||
getattr(iac, func)(event, md)):
|
iac, func)(event, md)):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -206,8 +206,9 @@ class ToolBar(QToolBar): # {{{
|
|||||||
for ac in self.location_manager.available_actions:
|
for ac in self.location_manager.available_actions:
|
||||||
w = self.widgetForAction(ac)
|
w = self.widgetForAction(ac)
|
||||||
if w is not None:
|
if w is not None:
|
||||||
if (md.hasFormat("application/calibre+from_library") or
|
if (md.hasFormat(
|
||||||
md.hasFormat("application/calibre+from_device")) and \
|
"application/calibre+from_library") or md.hasFormat(
|
||||||
|
"application/calibre+from_device")) and \
|
||||||
w.geometry().contains(event.pos()) and \
|
w.geometry().contains(event.pos()) and \
|
||||||
isinstance(w, QToolButton) and not w.isChecked():
|
isinstance(w, QToolButton) and not w.isChecked():
|
||||||
allowed = True
|
allowed = True
|
||||||
@ -549,12 +550,12 @@ class BarsManager(QObject):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def init_bars(self):
|
def init_bars(self):
|
||||||
self.bar_actions = tuple(
|
self.bar_actions = tuple([
|
||||||
[gprefs['action-layout-toolbar'+x] for x in ('', '-device')] +
|
gprefs['action-layout-toolbar'+x] for x in ('', '-device')] + [
|
||||||
[gprefs['action-layout-toolbar-child']] +
|
gprefs['action-layout-toolbar-child']] + [
|
||||||
[gprefs['action-layout-menubar'] or self.menubar_fallback] +
|
gprefs['action-layout-menubar'] or self.menubar_fallback] + [
|
||||||
[gprefs['action-layout-menubar-device'] or self.menubar_device_fallback]
|
gprefs['action-layout-menubar-device'] or self.menubar_device_fallback
|
||||||
)
|
])
|
||||||
|
|
||||||
for bar, actions in zip(self.bars, self.bar_actions[:3]):
|
for bar, actions in zip(self.bars, self.bar_actions[:3]):
|
||||||
bar.init_bar(actions)
|
bar.init_bar(actions)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user