[Bf-blender-cvs] [18905b4359c] master: Fix preferences layout not shrinking properly on high DPI display.

Brecht Van Lommel noreply at git.blender.org
Thu Jan 17 11:45:12 CET 2019


Commit: 18905b4359c69c5d278f9f5ba142ac13ddf941f1
Author: Brecht Van Lommel
Date:   Thu Jan 17 02:01:58 2019 +0100
Branches: master
https://developer.blender.org/rB18905b4359c69c5d278f9f5ba142ac13ddf941f1

Fix preferences layout not shrinking properly on high DPI display.

===================================================================

M	release/scripts/startup/bl_ui/space_userpref.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index b01144dc3bd..2f2c85eeffc 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -82,13 +82,13 @@ class PreferencePanel(Panel):
     def draw(self, context):
         layout = self.layout
         width = context.region.width
-        pixel_size = context.preferences.system.pixel_size
+        ui_scale = context.preferences.system.ui_scale
 
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
         row = layout.row()
-        if width > (350 * pixel_size):  # No horizontal margin if region is rather small.
+        if width > (350 * ui_scale):  # No horizontal margin if region is rather small.
             row.label()  # Needed so col below is centered.
 
         col = row.column()
@@ -97,7 +97,7 @@ class PreferencePanel(Panel):
         # draw_props implemented by deriving classes.
         self.draw_props(context, col)
 
-        if width > (350 * pixel_size):  # No horizontal margin if region is rather small.
+        if width > (350 * ui_scale):  # No horizontal margin if region is rather small.
             row.label()  # Needed so col above is centered.



More information about the Bf-blender-cvs mailing list