diff options
Diffstat (limited to 'source')
20 files changed, 30 insertions, 21 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d4fd70fbc6d..5fd6b1fe1a6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5062,7 +5062,7 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb) ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT); ar->v2d.keepofs = V2D_LOCKOFS_Y; ar->v2d.keeptot = 2; // this keeps the view in place when region size changes... - ar->v2d.align = V2D_ALIGN_NO_NEG_X; + ar->v2d.align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; } diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index d9d00702234..580c558cefb 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -72,7 +72,7 @@ void UI_view2d_header_default(View2D *v2d) v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT); v2d->keepofs = V2D_LOCKOFS_Y; v2d->keeptot = 2; // this keeps the view in place when region size changes... - v2d->align = V2D_ALIGN_NO_NEG_X; + v2d->align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; } diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index aa3e3c09962..beca0f07748 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -123,7 +123,7 @@ void action_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index 3f07b220b64..9ffcc107753 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -191,7 +191,7 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_file/file_header.c b/source/blender/editors/space_file/file_header.c index b4f2817d3cb..c1dd69de1be 100644 --- a/source/blender/editors/space_file/file_header.c +++ b/source/blender/editors/space_file/file_header.c @@ -124,7 +124,7 @@ void file_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c index 44b068cebc1..a9cf0e03fe8 100644 --- a/source/blender/editors/space_image/image_header.c +++ b/source/blender/editors/space_image/image_header.c @@ -123,7 +123,7 @@ void image_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_info/info_header.c b/source/blender/editors/space_info/info_header.c index 0ecb0c27b65..efaae1afb2e 100644 --- a/source/blender/editors/space_info/info_header.c +++ b/source/blender/editors/space_info/info_header.c @@ -146,7 +146,7 @@ void info_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_ipo/ipo_header.c b/source/blender/editors/space_ipo/ipo_header.c index 62b553991d6..61f7b80f703 100644 --- a/source/blender/editors/space_ipo/ipo_header.c +++ b/source/blender/editors/space_ipo/ipo_header.c @@ -122,7 +122,7 @@ void ipo_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 47860a71345..5fee33b8aa5 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -123,7 +123,7 @@ void nla_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index 11f8a38ce18..4252a36e4c9 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -122,7 +122,7 @@ void node_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_outliner/outliner_header.c b/source/blender/editors/space_outliner/outliner_header.c index 16b64e0a328..5a56e8ef0f1 100644 --- a/source/blender/editors/space_outliner/outliner_header.c +++ b/source/blender/editors/space_outliner/outliner_header.c @@ -133,7 +133,7 @@ void outliner_header_buttons(const bContext *C, ARegion *ar) } /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 84beb52e953..c98ec6de4e7 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -442,6 +442,11 @@ static void outliner_main_area_free(ARegion *ar) /* ************************ header outliner area region *********************** */ +/* add handlers, stuff you only do once or on area/region changes */ +static void outliner_header_area_init(wmWindowManager *wm, ARegion *ar) +{ + UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy); +} static void outliner_header_area_draw(const bContext *C, ARegion *ar) { @@ -455,6 +460,9 @@ static void outliner_header_area_draw(const bContext *C, ARegion *ar) glClearColor(col[0], col[1], col[2], 0.0); glClear(GL_COLOR_BUFFER_BIT); + /* set view2d view matrix for scrolling (without scrollers) */ + UI_view2d_view_ortho(C, &ar->v2d); + outliner_header_buttons(C, ar); } @@ -586,8 +594,9 @@ void ED_spacetype_outliner(void) art= MEM_callocN(sizeof(ARegionType), "spacetype time region"); art->regionid = RGN_TYPE_HEADER; art->minsizey= HEADERY; - art->keymapflag= ED_KEYMAP_UI; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; + art->init= outliner_header_area_init; art->draw= outliner_header_area_draw; art->free= outliner_header_area_free; BLI_addhead(&st->regiontypes, art); diff --git a/source/blender/editors/space_script/script_header.c b/source/blender/editors/space_script/script_header.c index c50fb58697c..8cc3966fdf1 100644 --- a/source/blender/editors/space_script/script_header.c +++ b/source/blender/editors/space_script/script_header.c @@ -123,7 +123,7 @@ void script_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_sequencer/sequencer_header.c b/source/blender/editors/space_sequencer/sequencer_header.c index d732a09ac8d..0787920670b 100644 --- a/source/blender/editors/space_sequencer/sequencer_header.c +++ b/source/blender/editors/space_sequencer/sequencer_header.c @@ -123,7 +123,7 @@ void sequencer_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_sound/sound_header.c b/source/blender/editors/space_sound/sound_header.c index a8121fdd179..8a566de4b5a 100644 --- a/source/blender/editors/space_sound/sound_header.c +++ b/source/blender/editors/space_sound/sound_header.c @@ -123,7 +123,7 @@ void sound_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 3ef7522d477..d43f33117df 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -123,7 +123,7 @@ void text_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_time/time_header.c b/source/blender/editors/space_time/time_header.c index e996c29d61c..c87f46760e0 100644 --- a/source/blender/editors/space_time/time_header.c +++ b/source/blender/editors/space_time/time_header.c @@ -570,7 +570,7 @@ void time_header_buttons(const bContext *C, ARegion *ar) /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index f85ecc468e3..337874074c3 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -123,7 +123,7 @@ void view3d_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon + UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(block); diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 73ee9cd9114..486d160aad7 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -101,7 +101,7 @@ typedef struct ScrArea { short winx, winy; /* size */ short headertype; /* OLD! 0=no header, 1= down, 2= up */ - short headbutlen, headbutofs; /* OLD! */ + int pad; short cursor, flag; ScriptLink scriptlink; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index e418110ce17..a083edf826a 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -549,8 +549,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) for(kmi= handler->keymap->first; kmi; kmi= kmi->next) { if(wm_eventmatch(event, kmi)) { - /* if(event->type!=MOUSEMOVE) - printf("handle evt %d win %d op %s\n", event->type, C->window->winid, kmi->idname); */ + if((G.f & G_DEBUG) && event->type!=MOUSEMOVE) + printf("handle evt %d win %d op %s\n", event->type, C->window->winid, kmi->idname); event->keymap_idname= kmi->idname; /* weak, but allows interactive callback to not use rawkey */ |