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:
authorTon Roosendaal <ton@blender.org>2011-01-08 21:37:11 +0300
committerTon Roosendaal <ton@blender.org>2011-01-08 21:37:11 +0300
commitac56fef2289a1beab58ee04a695bebb97c44056a (patch)
tree3f1df0e63d532bcbb1640b5e7e2850c772613689 /source/blender/editors/space_outliner/outliner.c
parent5e8b877268bda3aa6b3481615788fa85daf34307 (diff)
Todo items:
- Outliner: new scroll operator, PageUp PageDown scroll entire page now. - 2D views (like buttons) PageUp PageDown now also scroll entire page. (they used same step as scrollwheel before)
Diffstat (limited to 'source/blender/editors/space_outliner/outliner.c')
-rw-r--r--source/blender/editors/space_outliner/outliner.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index 354643b565c..24451912f89 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -1510,6 +1510,42 @@ static void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
/* **************** INTERACTIVE ************* */
+
+static int outliner_scroll_page_exec(bContext *C, wmOperator *op)
+{
+ ARegion *ar= CTX_wm_region(C);
+ int dy= ar->v2d.mask.ymax - ar->v2d.mask.ymin;
+ int up= 0;
+
+ if(RNA_boolean_get(op->ptr, "up"))
+ up= 1;
+
+ if(up == 0) dy= -dy;
+ ar->v2d.cur.ymin+= dy;
+ ar->v2d.cur.ymax+= dy;
+
+ ED_region_tag_redraw(ar);
+
+ return OPERATOR_FINISHED;
+}
+
+
+void OUTLINER_OT_scroll_page(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Scroll Page";
+ ot->idname= "OUTLINER_OT_scroll_page";
+ ot->description= "Scroll page up or down";
+
+ /* callbacks */
+ ot->exec= outliner_scroll_page_exec;
+ ot->poll= ED_operator_outliner_active;
+
+ /* properties */
+ RNA_def_boolean(ot->srna, "up", 0, "Up", "Scroll up one page.");
+}
+
+
static int outliner_count_levels(SpaceOops *soops, ListBase *lb, int curlevel)
{
TreeElement *te;