Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/area.c
| Show First 20 Lines • Show All 1,069 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void region_azone_scrollbar_init(ScrArea *area, | static void region_azone_scrollbar_init(ScrArea *area, | ||||
| ARegion *region, | ARegion *region, | ||||
| AZScrollDirection direction) | AZScrollDirection direction) | ||||
| { | { | ||||
| rcti scroller_vert = (direction == AZ_SCROLL_VERT) ? region->v2d.vert : region->v2d.hor; | rcti scroller_vert = (direction == AZ_SCROLL_VERT) ? region->v2d.vert : region->v2d.hor; | ||||
| AZone *az = MEM_callocN(sizeof(*az), __func__); | AZone *az = MEM_callocN(sizeof(*az), __func__); | ||||
| float hide_width; | |||||
| BLI_addtail(&area->actionzones, az); | BLI_addtail(&area->actionzones, az); | ||||
| az->type = AZONE_REGION_SCROLL; | az->type = AZONE_REGION_SCROLL; | ||||
| az->region = region; | az->region = region; | ||||
| az->direction = direction; | az->direction = direction; | ||||
| if (direction == AZ_SCROLL_VERT) { | if (direction == AZ_SCROLL_VERT) { | ||||
| az->region->v2d.alpha_vert = 0; | az->region->v2d.alpha_vert = 0; | ||||
| hide_width = V2D_SCROLL_HIDE_HEIGHT; | |||||
| } | } | ||||
| else if (direction == AZ_SCROLL_HOR) { | else if (direction == AZ_SCROLL_HOR) { | ||||
| az->region->v2d.alpha_hor = 0; | az->region->v2d.alpha_hor = 0; | ||||
| hide_width = V2D_SCROLL_HIDE_WIDTH; | |||||
| } | } | ||||
| BLI_rcti_translate(&scroller_vert, region->winrct.xmin, region->winrct.ymin); | BLI_rcti_translate(&scroller_vert, region->winrct.xmin, region->winrct.ymin); | ||||
| az->x1 = scroller_vert.xmin - AZONEFADEIN; | az->x1 = scroller_vert.xmin - ((direction == AZ_SCROLL_VERT) ? hide_width : 0); | ||||
| az->y1 = scroller_vert.ymin - AZONEFADEIN; | az->y1 = scroller_vert.ymin - ((direction == AZ_SCROLL_HOR) ? hide_width : 0); | ||||
| az->x2 = scroller_vert.xmax + AZONEFADEIN; | az->x2 = scroller_vert.xmax + ((direction == AZ_SCROLL_VERT) ? hide_width : 0); | ||||
| az->y2 = scroller_vert.ymax + AZONEFADEIN; | az->y2 = scroller_vert.ymax + ((direction == AZ_SCROLL_HOR) ? hide_width : 0); | ||||
| BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); | BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); | ||||
| } | } | ||||
| static void region_azones_scrollbars_init(ScrArea *area, ARegion *region) | static void region_azones_scrollbars_init(ScrArea *area, ARegion *region) | ||||
| { | { | ||||
| const View2D *v2d = ®ion->v2d; | const View2D *v2d = ®ion->v2d; | ||||
| ▲ Show 20 Lines • Show All 2,016 Lines • ▼ Show 20 Lines | void ED_region_panels_draw(const bContext *C, ARegion *region) | ||||
| bool use_mask = false; | bool use_mask = false; | ||||
| rcti mask; | rcti mask; | ||||
| if (region->runtime.category && | if (region->runtime.category && | ||||
| (RGN_ALIGN_ENUM_FROM_MASK(region->alignment) == RGN_ALIGN_RIGHT)) { | (RGN_ALIGN_ENUM_FROM_MASK(region->alignment) == RGN_ALIGN_RIGHT)) { | ||||
| use_mask = true; | use_mask = true; | ||||
| UI_view2d_mask_from_win(v2d, &mask); | UI_view2d_mask_from_win(v2d, &mask); | ||||
| mask.xmax -= UI_PANEL_CATEGORY_MARGIN_WIDTH; | mask.xmax -= UI_PANEL_CATEGORY_MARGIN_WIDTH; | ||||
| } | } | ||||
| UI_view2d_scrollers_draw(v2d, use_mask ? &mask : NULL); | bool use_full_hide = false; | ||||
| if (region->overlap) { | |||||
| /* Don't always show scrollbars for transparent regions as it's distracting. */ | |||||
| use_full_hide = true; | |||||
| } | |||||
| UI_view2d_scrollers_draw_ex(v2d, use_mask ? &mask : NULL, use_full_hide); | |||||
| } | } | ||||
| void ED_region_panels_ex(const bContext *C, ARegion *region, const char *contexts[]) | void ED_region_panels_ex(const bContext *C, ARegion *region, const char *contexts[]) | ||||
| { | { | ||||
| /* TODO: remove? */ | /* TODO: remove? */ | ||||
| ED_region_panels_layout_ex(C, region, ®ion->type->paneltypes, contexts, NULL); | ED_region_panels_layout_ex(C, region, ®ion->type->paneltypes, contexts, NULL); | ||||
| ED_region_panels_draw(C, region); | ED_region_panels_draw(C, region); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 748 Lines • Show Last 20 Lines | |||||