mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix #842
This commit is contained in:
parent
0be7f76c12
commit
436f7fb0cb
@ -20,11 +20,20 @@ if iswindows:
|
||||
import warnings
|
||||
warnings.simplefilter('ignore', DeprecationWarning)
|
||||
|
||||
def available_heights():
|
||||
desktop = QCoreApplication.instance().desktop()
|
||||
return map(lambda x: x.height(), map(desktop.availableGeometry, range(desktop.numScreens())))
|
||||
|
||||
def available_height():
|
||||
desktop = QCoreApplication.instance().desktop()
|
||||
return desktop.availableGeometry().height()
|
||||
|
||||
def max_available_height():
|
||||
return max(available_heights())
|
||||
|
||||
def min_available_height():
|
||||
return min(available_heights())
|
||||
|
||||
def available_width():
|
||||
desktop = QCoreApplication.instance().desktop()
|
||||
return desktop.availableGeometry().width()
|
||||
|
@ -20,7 +20,7 @@ from calibre.gui2 import APP_UID, warning_dialog, choose_files, error_dialog, \
|
||||
initialize_file_icon_provider, question_dialog,\
|
||||
pixmap_to_data, choose_dir, ORG_NAME, \
|
||||
set_sidebar_directories, \
|
||||
SingleApplication, Application, available_height
|
||||
SingleApplication, Application, available_height, max_available_height
|
||||
from calibre.gui2.cover_flow import CoverFlow, DatabaseImages
|
||||
from calibre.library.database import LibraryDatabase
|
||||
from calibre.gui2.update import CheckForUpdates
|
||||
@ -46,8 +46,6 @@ from calibre.ebooks.metadata import MetaInformation
|
||||
from calibre.ebooks import BOOK_EXTENSIONS
|
||||
from calibre.ebooks.lrf import preferred_source_formats as LRF_PREFERRED_SOURCE_FORMATS
|
||||
|
||||
|
||||
|
||||
class Main(MainWindow, Ui_MainWindow):
|
||||
|
||||
def set_default_thumbnail(self, height):
|
||||
@ -233,7 +231,7 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
self.status_bar.cover_flow_button.disable(pictureflowerror)
|
||||
|
||||
|
||||
self.setMaximumHeight(available_height())
|
||||
self.setMaximumHeight(max_available_height())
|
||||
|
||||
####################### Setup device detection ########################
|
||||
self.detector = DeviceDetector(sleep_time=2000)
|
||||
|
Loading…
x
Reference in New Issue
Block a user