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:
authorCampbell Barton <ideasman42@gmail.com>2011-11-04 05:15:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-04 05:15:04 +0400
commit2d787e6e015e54e760086266415d66cad5d1edec (patch)
tree61371a53d945e133aba83063e7f32f47b8637e89 /source/blender/editors/interface/interface_ops.c
parent29575c9ac8c08ae264f06b6ce34fa606bb09bdab (diff)
utility function to find the biggest area: BKE_screen_find_big_area(...), was being done with static functions that were copied about.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r--source/blender/editors/interface/interface_ops.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index d420b5c24c3..5803054caa7 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -43,6 +43,7 @@
#include "BLI_utildefines.h"
#include "BKE_context.h"
+#include "BKE_screen.h"
#include "BKE_global.h"
#include "BKE_text.h" /* for UI_OT_reports_to_text */
#include "BKE_report.h"
@@ -577,24 +578,6 @@ void UI_editsource_active_but_test(uiBut *but)
/* editsource operator component */
-static ScrArea *biggest_text_view(bContext *C)
-{
- bScreen *sc= CTX_wm_screen(C);
- ScrArea *sa, *big= NULL;
- int size, maxsize= 0;
-
- for(sa= sc->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_TEXT) {
- size= sa->winx * sa->winy;
- if(size > maxsize) {
- maxsize= size;
- big= sa;
- }
- }
- }
- return big;
-}
-
static int editsource_text_edit(bContext *C, wmOperator *op,
char filepath[240], int line)
{
@@ -619,7 +602,7 @@ static int editsource_text_edit(bContext *C, wmOperator *op,
else {
/* naughty!, find text area to set, not good behavior
* but since this is a dev tool lets allow it - campbell */
- ScrArea *sa= biggest_text_view(C);
+ ScrArea *sa= BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0);
if(sa) {
SpaceText *st= sa->spacedata.first;
st->text= text;