Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_widgets.c
| Show First 20 Lines • Show All 2,137 Lines • ▼ Show 20 Lines | |||||
| #ifdef USE_UI_TOOLBAR_HACK | #ifdef USE_UI_TOOLBAR_HACK | ||||
| but->block->aspect = aspect_orig; | but->block->aspect = aspect_orig; | ||||
| #endif | #endif | ||||
| rect->xmin += icon_size + icon_padding; | rect->xmin += icon_size + icon_padding; | ||||
| } | } | ||||
| if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) { | int text_padding = (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect; | ||||
| rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect; | if (but->editstr) { | ||||
| rect->xmin += text_padding; | |||||
| } | |||||
| else if (but->flag & UI_BUT_DRAG_MULTI) { | |||||
| bool text_is_edited = ui_but_drag_multi_edit_get(but) != NULL; | |||||
| if (text_is_edited) { | |||||
| rect->xmin += text_padding; | |||||
| } | } | ||||
| else if ((but->drawflag & UI_BUT_TEXT_RIGHT)) { | } | ||||
| rect->xmax -= (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect; | else if (but->drawflag & UI_BUT_TEXT_LEFT) { | ||||
| rect->xmin += text_padding; | |||||
| } | |||||
| else if (but->drawflag & UI_BUT_TEXT_RIGHT) { | |||||
| rect->xmax -= text_padding; | |||||
| } | } | ||||
| /* Menu contains sub-menu items with triangle icon on their right. Shortcut | /* Menu contains sub-menu items with triangle icon on their right. Shortcut | ||||
| * strings should be drawn with some padding to the right then. */ | * strings should be drawn with some padding to the right then. */ | ||||
| if (ui_block_is_menu(but->block) && (but->block->content_hints & UI_BLOCK_CONTAINS_SUBMENU_BUT)) { | if (ui_block_is_menu(but->block) && (but->block->content_hints & UI_BLOCK_CONTAINS_SUBMENU_BUT)) { | ||||
| rect->xmax -= UI_MENU_SUBMENU_PADDING; | rect->xmax -= UI_MENU_SUBMENU_PADDING; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,644 Lines • Show Last 20 Lines | |||||