This commit is contained in:
Kovid Goyal 2010-06-09 00:02:37 -06:00
parent 8a88c2a620
commit 5979d46fd2
3 changed files with 15 additions and 7 deletions

View File

@ -91,6 +91,12 @@ if pictureflow is not None:
elif ev.delta() > 0:
self.showPrevious()
def resizeEvent(self, *args):
ans = pictureflow.PictureFlow.resizeEvent(self, *args)
height = self.height()/2.
self.setSlideSize(QSize(int(2/3. * height), height))
return ans
else:
CoverFlow = None
@ -126,7 +132,7 @@ class CoverFlowMixin(object):
if show:
d = QDialog(self)
ah, aw = available_height(), available_width()
d.resize(int(aw/2.), ah-60)
d.resize(int(aw/1.5), ah-60)
d._layout = QStackedLayout()
d.setLayout(d._layout)
d.setWindowTitle(_('Browse by covers'))
@ -203,8 +209,8 @@ if __name__ == '__main__':
app = QApplication([])
w = QMainWindow()
cf = CoverFlow()
cf.resize(cf.minimumSize())
w.resize(cf.minimumSize()+QSize(30, 20))
cf.resize(int(available_width()/1.5), available_height()-60)
w.resize(cf.size()+QSize(30, 20))
path = sys.argv[1]
model = FileSystemImages(sys.argv[1])
cf.setImages(model)

View File

@ -242,6 +242,12 @@ class LibraryViewMixin(object): # {{{
self.library_view.model().set_book_on_device_func(self.book_on_device)
prefs['library_path'] = self.library_path
for view in ('library', 'memory', 'card_a', 'card_b'):
view = getattr(self, view+'_view')
view.verticalHeader().sectionDoubleClicked.connect(self.view_specific_book)
def show_similar_books(self, type, *args):
search, join = [], ' '
idx = self.library_view.currentIndex()

View File

@ -355,10 +355,6 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI, ToolbarMixin,
SIGNAL('start_recipe_fetch(PyQt_PyObject)'),
self.download_scheduled_recipe, Qt.QueuedConnection)
for view in ('library', 'memory', 'card_a', 'card_b'):
view = getattr(self, view+'_view')
view.verticalHeader().sectionDoubleClicked.connect(self.view_specific_book)
self.location_view.setCurrentIndex(self.location_view.model().index(0))
self._add_filesystem_book = Dispatcher(self.__add_filesystem_book)