[Bf-blender-cvs] [41b27a4def5] master: UI: add title to assign shortcut popup, tweak padding

Yevgeny Makarov noreply at git.blender.org
Tue Aug 27 12:50:39 CEST 2019


Commit: 41b27a4def57cb9b51671f381f499d6fcb448fb9
Author: Yevgeny Makarov
Date:   Tue Aug 27 12:44:13 2019 +0200
Branches: master
https://developer.blender.org/rB41b27a4def57cb9b51671f381f499d6fcb448fb9

UI: add title to assign shortcut popup, tweak padding

Differential Revision: https://developer.blender.org/D5576

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

M	source/blender/editors/interface/interface_context_menu.c

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

diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index 0884a9ea470..c284cfed816 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -176,11 +176,12 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg)
   UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT);
   UI_block_direction_set(block, UI_DIR_CENTER_Y);
 
-  layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, 0, style);
+  layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, U.widget_unit * 10, U.widget_unit * 2, 0, style);
 
+  uiItemL(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Change Shortcut"), ICON_HAND);
   uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
 
-  UI_block_bounds_set_popup(block, 6, (const int[2]){-50, 26});
+  UI_block_bounds_set_popup(block, 6 * U.dpi_fac, (const int[2]){-100 * U.dpi_fac, 36 * U.dpi_fac});
 
   shortcut_free_operator_property(prop);
 
@@ -227,11 +228,12 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
   UI_block_func_handle_set(block, but_shortcut_name_func, but);
   UI_block_direction_set(block, UI_DIR_CENTER_Y);
 
-  layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, 0, style);
+  layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, U.widget_unit * 10, U.widget_unit * 2, 0, style);
 
+  uiItemL(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Assign Shortcut"), ICON_HAND);
   uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
 
-  UI_block_bounds_set_popup(block, 6, (const int[2]){-50, 26});
+  UI_block_bounds_set_popup(block, 6 * U.dpi_fac, (const int[2]){-100 * U.dpi_fac, 36 * U.dpi_fac});
 
 #ifdef USE_KEYMAP_ADD_HACK
   g_kmi_id_hack = kmi_id;



More information about the Bf-blender-cvs mailing list