diff options
author | Ton Roosendaal <ton@blender.org> | 2013-03-24 17:43:40 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2013-03-24 17:43:40 +0400 |
commit | 1165236f69f0ca792df05919a48ae4058746d9bd (patch) | |
tree | 80bbebc880ca7bea68b0239672c3debde0ce0628 /source/blender/editors/space_text/space_text.c | |
parent | c4ae6f2c3653faed47644713382ae78a49ef074e (diff) |
Usablity:
In text editor, the CTRL+F find now opens property region (or keeps it) and
activates the search button for input.
That's already nice! But next step should be to do a search on exit of
the button (or while typing). That's stuff I need Campbell to help with though.
Notes:
- Probably Py api for property buttons could get an "operator=" arg?
- The warning menu "not found" should go away
- I also suggest to make "wrap" search default for new editors
Diffstat (limited to 'source/blender/editors/space_text/space_text.c')
-rw-r--r-- | source/blender/editors/space_text/space_text.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 58e45bc766f..600cbdb326b 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -220,6 +220,8 @@ static void text_operatortypes(void) WM_operatortype_append(TEXT_OT_replace); WM_operatortype_append(TEXT_OT_replace_set_selected); + WM_operatortype_append(TEXT_OT_start_find); + WM_operatortype_append(TEXT_OT_to_3d_object); WM_operatortype_append(TEXT_OT_resolve_conflict); @@ -233,9 +235,9 @@ static void text_keymap(struct wmKeyConfig *keyconf) wmKeyMapItem *kmi; keymap = WM_keymap_find(keyconf, "Text Generic", SPACE_TEXT, 0); - WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "TEXT_OT_start_find", FKEY, KM_PRESS, KM_CTRL, 0); #ifdef __APPLE__ - WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "TEXT_OT_start_find", FKEY, KM_PRESS, KM_OSKEY, 0); #endif keymap = WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0); @@ -515,7 +517,16 @@ static void text_properties_area_init(wmWindowManager *wm, ARegion *ar) static void text_properties_area_draw(const bContext *C, ARegion *ar) { + SpaceText *st = CTX_wm_space_text(C); + ED_region_panels(C, ar, 1, NULL, -1); + + /* this flag trick is make sure buttons have been added already */ + if (st->flags & ST_FIND_ACTIVATE) { + + UI_textbutton_activate_event(C, ar, st, "find_text"); + st->flags &= ~ST_FIND_ACTIVATE; + } } /********************* registration ********************/ |