Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-28 00:59:05 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-28 01:13:58 +0300
commita009f2659fb627c62a3a2444e1f6d913ff63af2b (patch)
tree2871014b09aeaed15214c8b36918e9bd055f13ef /source/blender/editors/interface/interface_templates.c
parent8b2297847f84e88015863b0cc89f8496928ea0e3 (diff)
UI: keep statusbar keymap icons in same position, if there is enough space.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 041dc56cf92..43824c59af4 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -4309,22 +4309,23 @@ void uiTemplateInputStatus(uiLayout *layout, struct bContext *C)
/* Otherwise should cursor keymap status. */
for (int i = 0; i < 3; i++) {
- uiLayout *box = uiLayoutRow(layout, true);
+ uiLayout *box = uiLayoutRow(layout, false);
+ uiLayout *col = uiLayoutColumn(box, false);
+ uiLayout *row = uiLayoutRow(col, true);
+ uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_LEFT);
const char *msg = WM_window_cursor_keymap_status_get(win, i, 0);
const char *msg_drag = WM_window_cursor_keymap_status_get(win, i, 1);
- if (msg || msg_drag) {
- uiItemL(box, msg ? msg : "", (ICON_MOUSE_LMB + i));
+ uiItemL(row, msg ? msg : "", (ICON_MOUSE_LMB + i));
- if (msg_drag) {
- uiItemL(box, msg_drag, ICON_MOUSE_DRAG);
- }
-
- if (i != 2) {
- uiItemS(layout);
- }
+ if (msg_drag) {
+ uiItemL(row, msg_drag, ICON_MOUSE_DRAG);
}
+
+ /* Use trick with empty string to keep icons in same position. */
+ row = uiLayoutRow(col, false);
+ uiItemL(row, " ", ICON_NONE);
}
}