mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle resizinf of caover browser correctly
This commit is contained in:
parent
5979d46fd2
commit
589ea3b113
@ -78,7 +78,6 @@ if pictureflow is not None:
|
||||
def __init__(self, parent=None):
|
||||
pictureflow.PictureFlow.__init__(self, parent,
|
||||
config['cover_flow_queue_length']+1)
|
||||
self.setSlideSize(QSize(int(2/3. * 10), 10))
|
||||
self.setMinimumSize(QSize(10, 10))
|
||||
self.setFocusPolicy(Qt.WheelFocus)
|
||||
self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,
|
||||
@ -91,12 +90,6 @@ 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
|
||||
@ -213,8 +206,8 @@ if __name__ == '__main__':
|
||||
w.resize(cf.size()+QSize(30, 20))
|
||||
path = sys.argv[1]
|
||||
model = FileSystemImages(sys.argv[1])
|
||||
cf.setImages(model)
|
||||
cf.currentChanged[int].connect(model.currentChanged)
|
||||
cf.setImages(model)
|
||||
w.setCentralWidget(cf)
|
||||
|
||||
w.show()
|
||||
|
@ -540,6 +540,8 @@ void PictureFlowPrivate::showSlide(int index)
|
||||
|
||||
void PictureFlowPrivate::resize(int w, int h)
|
||||
{
|
||||
slideHeight = int(float(h)/2.);
|
||||
slideWidth = int(float(slideHeight) * 2/3.);
|
||||
recalc(w, h);
|
||||
resetSlides();
|
||||
triggerRender();
|
||||
|
Loading…
x
Reference in New Issue
Block a user