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

BUG: Fix sample data set labels not appearing on large desktop monitors #6731

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion Modules/Scripted/SampleData/SampleData.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@ def setCategoriesFromSampleDataSources(categoryLayout, dataSources, logic):
iconPath = os.path.join(os.path.dirname(__file__).replace('\\', '/'), 'Resources', 'Icons')
mainWindow = slicer.util.mainWindow()
if mainWindow:
iconSize = qt.QSize(int(mainWindow.width / 8), int(mainWindow.height / 6))
# Set thumbnail size from default icon size. This results in toolbutton size that makes
# two columns of buttons fit into the size of the Welcome module's minimum width
# on screens with a various resolution and scaling (see qt.QDesktopWidget().size,
# desktop.devicePixelRatioF(), qt.QDesktopWidget().physicalDpiX())
iconSize = qt.QSize(int(mainWindow.iconSize.width() * 6), int(mainWindow.iconSize.height() * 4))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this 👌🙏

Are the multipliers 6 and 4 required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the multipliers the thumbnails would be as small as the toolbar icons - too small to be useful:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand now. Thanks for clarifying.

else:
# There is no main window in the automated tests
desktop = qt.QDesktopWidget()
Expand Down