Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makes padding relative to window width. #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lector/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,18 @@ def resizeEvent(self, event=None):
default_size = 170 # This is size of the QIcon (160 by default) +
# minimum margin needed between thumbnails

# Making the padding relative to the width of the window
profile_index = self.bookToolBar.profileBox.currentIndex()
current_profile = self.bookToolBar.profileBox.itemData(profile_index, QtCore.Qt.UserRole)
if current_profile != None and event:
w = event.oldSize().width()
if w >= 0:
padding_ratio = current_profile['padding']/w
current_profile['padding'] = self.width()*padding_ratio
self.bookToolBar.profileBox.setItemData(profile_index, current_profile, QtCore.Qt.UserRole)
self.profile_functions.format_contentView()


# for n icons, the n + 1th icon will appear at > n +1.11875
# First, calculate the number of images per row
i = self.listView.viewport().width() / default_size
Expand Down