[Bf-blender-cvs] [0093f5b1ecd] userpref_redesign: Fix responsive Preference layout ignoring hiDPI

Severin noreply at git.blender.org
Sat Dec 29 19:22:35 CET 2018


Commit: 0093f5b1ecdcb3906f217f871c6775a94ea8c3b0
Author: Severin
Date:   Sat Dec 29 19:18:39 2018 +0100
Branches: userpref_redesign
https://developer.blender.org/rB0093f5b1ecdcb3906f217f871c6775a94ea8c3b0

Fix responsive Preference layout ignoring hiDPI

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

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 9b3f3829e04..0151c6c1114 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -86,12 +86,13 @@ class PreferencePanel(Panel):
     def draw(self, context):
         layout = self.layout
         width = context.region.width
+        pixel_size = context.preferences.system.pixel_size
 
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
         row = layout.row()
-        if width > 350: # No horizontal margin if region is rather small.
+        if width > (350 * pixel_size): # No horizontal margin if region is rather small.
             row.label() # Needed so col below is centered.
 
         col = row.column()
@@ -100,7 +101,7 @@ class PreferencePanel(Panel):
         # draw_props implemented by deriving classes.
         self.draw_props(context, col)
 
-        if width > 350: # No horizontal margin if region is rather small.
+        if width > (350 * pixel_size): # 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