diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-04 03:16:51 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-04 03:16:51 +0400 |
commit | a8f69a7f5cf59943b244126f428d1c12ca7e61af (patch) | |
tree | 349634e827419f180511f711e9da94775cdf0a1b /source/blender/editors/interface/interface_layout.c | |
parent | 34014df367d61bca0223eee25a9aa7b2c5a0e232 (diff) |
UI/RNA:
* Added an icon entry to RNA structs, instead of the UI_GetIconRNA
function, to keep code together a bit more and make the lookup
faster.
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index bb2be0da874..8ef1cd32f22 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -213,7 +213,7 @@ static int ui_item_fit(int item, int pos, int all, int available, int last, int static int ui_layout_vary_direction(uiLayout *layout) { - return (layout->root->type == UI_LAYOUT_HEADER)? UI_ITEM_VARY_X: UI_ITEM_VARY_Y; + return (layout->root->type == UI_LAYOUT_HEADER || layout->alignment != UI_LAYOUT_ALIGN_EXPAND)? UI_ITEM_VARY_X: UI_ITEM_VARY_Y; } /* estimated size of text + icon */ @@ -224,9 +224,9 @@ static int ui_text_icon_width(uiLayout *layout, char *name, int icon) if(icon && strcmp(name, "") == 0) return UI_UNIT_X; /* icon only */ else if(icon) - return (variable)? UI_GetStringWidth(name) + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */ + return (variable)? UI_GetStringWidth(name) + 4 + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */ else - return (variable)? UI_GetStringWidth(name) + UI_UNIT_X: 10*UI_UNIT_X; /* text only */ + return (variable)? UI_GetStringWidth(name) + 4 + UI_UNIT_X: 10*UI_UNIT_X; /* text only */ } static void ui_item_size(uiItem *item, int *r_w, int *r_h) |