[Bf-blender-cvs] [05c57dc563b] master: UI: Use property split in UV editor panels

Hans Goudey noreply at git.blender.org
Fri Sep 18 21:37:41 CEST 2020


Commit: 05c57dc563b81d7ec22ceb46cda1422f55c69c95
Author: Hans Goudey
Date:   Fri Sep 18 14:37:33 2020 -0500
Branches: master
https://developer.blender.org/rB05c57dc563b81d7ec22ceb46cda1422f55c69c95

UI: Use property split in UV editor panels

This is not an exhaustive change, just for the 2D cursor and
UDIM grid properties. Also vertically align the "UV Vertex"
buttons like in the 3D view panels.

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

M	release/scripts/startup/bl_ui/space_image.py
M	source/blender/editors/uvedit/uvedit_buttons.c

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

diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index fa71bc1d14d..2519b5a2f40 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -1480,10 +1480,11 @@ class IMAGE_PT_uv_cursor(Panel):
 
         sima = context.space_data
 
-        col = layout.column()
+        layout.use_property_split = True
+        layout.use_property_decorate = False
 
         col = layout.column()
-        col.prop(sima, "cursor_location", text="Cursor Location")
+        col.prop(sima, "cursor_location", text="Location")
 
 
 class IMAGE_PT_udim_grid(Panel):
@@ -1504,6 +1505,9 @@ class IMAGE_PT_udim_grid(Panel):
         sima = context.space_data
         uvedit = sima.uv_editor
 
+        layout.use_property_split = True
+        layout.use_property_decorate = False
+
         col = layout.column()
         col.prop(uvedit, "tile_grid_shape", text="Grid Shape")
 
diff --git a/source/blender/editors/uvedit/uvedit_buttons.c b/source/blender/editors/uvedit/uvedit_buttons.c
index f9949f6b671..5ed75a1004c 100644
--- a/source/blender/editors/uvedit/uvedit_buttons.c
+++ b/source/blender/editors/uvedit/uvedit_buttons.c
@@ -137,7 +137,6 @@ static void uvedit_vertex_buttons(const bContext *C, uiBlock *block)
   Scene *scene = CTX_data_scene(C);
   float center[2];
   int imx, imy, step, digits;
-  float width = 8 * UI_UNIT_X;
   uint objects_len = 0;
   Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(
       CTX_data_view_layer(C), CTX_wm_view3d(C), &objects_len);
@@ -177,14 +176,15 @@ static void uvedit_vertex_buttons(const bContext *C, uiBlock *block)
 
     uiBut *but;
 
+    int y = 0;
     UI_block_align_begin(block);
     but = uiDefButF(block,
                     UI_BTYPE_NUM,
                     B_UVEDIT_VERTEX,
                     IFACE_("X:"),
                     0,
-                    0,
-                    width,
+                    y -= UI_UNIT_Y,
+                    200,
                     UI_UNIT_Y,
                     &uvedit_old_center[0],
                     UNPACK2(range_xy[0]),
@@ -197,9 +197,9 @@ static void uvedit_vertex_buttons(const bContext *C, uiBlock *block)
                     UI_BTYPE_NUM,
                     B_UVEDIT_VERTEX,
                     IFACE_("Y:"),
-                    width,
                     0,
-                    width,
+                    y -= UI_UNIT_Y,
+                    200,
                     UI_UNIT_Y,
                     &uvedit_old_center[1],
                     UNPACK2(range_xy[1]),



More information about the Bf-blender-cvs mailing list