Ejemplo n.º 1
0
    def __init__(self, parent):
        orientation = Qt.Orientation.Vertical
        if config['gui_layout'] == 'narrow':
            orientation = Qt.Orientation.Horizontal if is_widescreen() else Qt.Orientation.Vertical
        idx = 0 if orientation == Qt.Orientation.Vertical else 1
        size = 300 if orientation == Qt.Orientation.Vertical else 550
        Splitter.__init__(self, 'cover_browser_splitter', _('Cover browser'),
                I('cover_flow.png'),
                orientation=orientation, parent=parent,
                connect_button=not config['separate_cover_flow'],
                side_index=idx, initial_side_size=size, initial_show=False,
                shortcut='Shift+Alt+B')

        quickview_widget = QWidget()
        parent.quickview_splitter = QuickviewSplitter(
                parent=self, orientation=Qt.Orientation.Vertical, qv_widget=quickview_widget)
        parent.library_view = BooksView(parent)
        parent.library_view.setObjectName('library_view')
        stack = QStackedWidget(self)
        av = parent.library_view.alternate_views
        parent.pin_container = av.set_stack(stack)
        parent.grid_view = GridView(parent)
        parent.grid_view.setObjectName('grid_view')
        av.add_view('grid', parent.grid_view)
        parent.quickview_splitter.addWidget(stack)

        l = QVBoxLayout()
        l.setContentsMargins(4, 0, 0, 0)
        quickview_widget.setLayout(l)
        parent.quickview_splitter.addWidget(quickview_widget)
        parent.quickview_splitter.hide_quickview_widget()

        self.addWidget(parent.quickview_splitter)
Ejemplo n.º 2
0
 def __init__(self, parent):
     orientation = Qt.Vertical
     if config['gui_layout'] == 'narrow':
         orientation = Qt.Horizontal if is_widescreen() else Qt.Vertical
     idx = 0 if orientation == Qt.Vertical else 1
     size = 300 if orientation == Qt.Vertical else 550
     Splitter.__init__(self,
                       'cover_browser_splitter',
                       _('Cover Browser'),
                       I('cover_flow.png'),
                       orientation=orientation,
                       parent=parent,
                       connect_button=not config['separate_cover_flow'],
                       side_index=idx,
                       initial_side_size=size,
                       initial_show=False,
                       shortcut='Shift+Alt+B')
     parent.library_view = BooksView(parent)
     parent.library_view.setObjectName('library_view')
     stack = QStackedWidget(self)
     av = parent.library_view.alternate_views
     av.set_stack(stack)
     parent.grid_view = GridView(parent)
     parent.grid_view.setObjectName('grid_view')
     av.add_view('grid', parent.grid_view)
     self.addWidget(stack)