diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-16 16:17:58 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-16 16:17:58 +0400 |
commit | 26a8c63eae9c398ad82122877f0ea3d9b167d66c (patch) | |
tree | 006a2d4025ecfc4275cf0aef05dabd7c8b7b6812 /source/blender/editors/space_text | |
parent | db7d0108c20332fc55c637e979c65cf55ca37428 (diff) |
UI:
* Don't call generic layout hints templates anymore, i.e.
TemplateRow becomes Row, etc.
* Added more general layout nesting, using uiLayoutSplit()
and uiLayoutBox() functions, for which the sublayouts
can then be accessed using uiLayoutSub(), to put items
in those sublayouts.
* Some steps to make the layout decisions, like which items
to put in which columns, independent of the width of the
window or the text in the buttons. We want the layout to
be stable under resizes and translations.
* Added an "expand" parameter to uiItemR, used now to expand
enums into a row instead of using a menu.
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/text_header.c | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 0a8f5e9be3c..be3a57afbf5 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -381,10 +381,10 @@ static void text_header_draw(const bContext *C, uiLayout *layout) } uiTemplateHeaderButtons(layout); - uiItemR(layout, "", ICON_LINENUMBERS_OFF, &spaceptr, "line_numbers"); - uiItemR(layout, "", ICON_WORDWRAP_OFF, &spaceptr, "word_wrap"); - uiItemR(layout, "", ICON_SYNTAX_OFF, &spaceptr, "syntax_highlight"); - // XXX uiItemR(layout, "", ICON_SCRIPTPLUGINS, &spaceptr, "do_python_plugins"); + uiItemR(layout, "", ICON_LINENUMBERS_OFF, &spaceptr, "line_numbers", 0); + uiItemR(layout, "", ICON_WORDWRAP_OFF, &spaceptr, "word_wrap", 0); + uiItemR(layout, "", ICON_SYNTAX_OFF, &spaceptr, "syntax_highlight", 0); + // XXX uiItemR(layout, "", ICON_SCRIPTPLUGINS, &spaceptr, "do_python_plugins", 0); uiTemplateHeaderID(layout, &spaceptr, "text", UI_ID_BROWSE|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_OPEN|UI_ID_DELETE, @@ -438,14 +438,14 @@ static void text_properties_panel_draw(const bContext *C, Panel *panel) RNA_pointer_create(&sc->id, &RNA_SpaceTextEditor, st, &spaceptr); - uiTemplateColumn(layout); - uiItemR(layout, NULL, ICON_LINENUMBERS_OFF, &spaceptr, "line_numbers"); - uiItemR(layout, NULL, ICON_WORDWRAP_OFF, &spaceptr, "word_wrap"); - uiItemR(layout, NULL, ICON_SYNTAX_OFF, &spaceptr, "syntax_highlight"); + uiLayoutColumn(layout); + uiItemR(layout, NULL, ICON_LINENUMBERS_OFF, &spaceptr, "line_numbers", 0); + uiItemR(layout, NULL, ICON_WORDWRAP_OFF, &spaceptr, "word_wrap", 0); + uiItemR(layout, NULL, ICON_SYNTAX_OFF, &spaceptr, "syntax_highlight", 0); - uiTemplateColumn(layout); - uiItemR(layout, NULL, 0, &spaceptr, "font_size"); - uiItemR(layout, NULL, 0, &spaceptr, "tab_width"); + uiLayoutColumn(layout); + uiItemR(layout, NULL, 0, &spaceptr, "font_size", 0); + uiItemR(layout, NULL, 0, &spaceptr, "tab_width", 0); } static void text_find_panel_draw(const bContext *C, Panel *panel) @@ -458,31 +458,27 @@ static void text_find_panel_draw(const bContext *C, Panel *panel) RNA_pointer_create(&sc->id, &RNA_SpaceTextEditor, st, &spaceptr); /* find */ - uiTemplateLeftRight(layout); - uiTemplateSlot(layout, UI_TSLOT_LR_LEFT); - uiItemR(layout, "", 0, &spaceptr, "find_text"); - uiTemplateSlot(layout, UI_TSLOT_LR_RIGHT); + uiLayoutRow(layout); + uiItemR(layout, "", 0, &spaceptr, "find_text", 0); uiItemO(layout, "", ICON_TEXT, "TEXT_OT_find_set_selected"); - uiTemplateColumn(layout); + uiLayoutColumn(layout); uiItemO(layout, NULL, 0, "TEXT_OT_find"); /* replace */ - uiTemplateLeftRight(layout); - uiTemplateSlot(layout, UI_TSLOT_LR_LEFT); - uiItemR(layout, "", 0, &spaceptr, "replace_text"); - uiTemplateSlot(layout, UI_TSLOT_LR_RIGHT); + uiLayoutRow(layout); + uiItemR(layout, "", 0, &spaceptr, "replace_text", 0); uiItemO(layout, "", ICON_TEXT, "TEXT_OT_replace_set_selected"); - uiTemplateColumn(layout); + uiLayoutColumn(layout); uiItemO(layout, NULL, 0, "TEXT_OT_replace"); /* mark */ - uiTemplateColumn(layout); + uiLayoutColumn(layout); uiItemO(layout, NULL, 0, "TEXT_OT_mark_all"); /* settings */ - uiTemplateColumnFlow(layout, 2); - uiItemR(layout, "Wrap", 0, &spaceptr, "find_wrap"); - uiItemR(layout, "All", 0, &spaceptr, "find_all"); + uiLayoutColumnFlow(layout, 0); + uiItemR(layout, "Wrap", 0, &spaceptr, "find_wrap", 0); + uiItemR(layout, "All", 0, &spaceptr, "find_all", 0); } void text_properties_register(ARegionType *art) |