Skip to content

Commit

Permalink
BUG: Fix sample data set labels not appearing on large desktop monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
lassoan authored and jcfr committed Dec 14, 2022
1 parent 3d62cbf commit 0ab9513
Showing 1 changed file with 5 additions and 1 deletion.
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))
else:
# There is no main window in the automated tests
desktop = qt.QDesktopWidget()
Expand Down

0 comments on commit 0ab9513

Please sign in to comment.