diff options
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index f5962f36412..690d6c8055a 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1385,7 +1385,7 @@ static void region_rect_recursive( region->winrct = *remainder; BLI_rcti_init(remainder, 0, 0, 0, 0); } - else if (alignment == RGN_ALIGN_TOP || alignment == RGN_ALIGN_BOTTOM) { + else if (ELEM(alignment, RGN_ALIGN_TOP, RGN_ALIGN_BOTTOM)) { rcti *winrct = (region->overlap) ? overlap_remainder : remainder; if ((prefsizey == 0) || (rct_fits(winrct, 'v', prefsizey) < 0)) { @@ -1437,7 +1437,7 @@ static void region_rect_recursive( BLI_rcti_sanitize(winrct); } } - else if (alignment == RGN_ALIGN_VSPLIT || alignment == RGN_ALIGN_HSPLIT) { + else if (ELEM(alignment, RGN_ALIGN_VSPLIT, RGN_ALIGN_HSPLIT)) { /* percentage subdiv*/ region->winrct = *remainder; @@ -1738,6 +1738,10 @@ static void ed_default_handlers( wmKeyMap *keymap_general = WM_keymap_ensure(wm->defaultconf, "Grease Pencil", 0, 0); WM_event_add_keymap_handler(handlers, keymap_general); + wmKeyMap *keymap_curve_edit = WM_keymap_ensure( + wm->defaultconf, "Grease Pencil Stroke Curve Edit Mode", 0, 0); + WM_event_add_keymap_handler(handlers, keymap_curve_edit); + wmKeyMap *keymap_edit = WM_keymap_ensure( wm->defaultconf, "Grease Pencil Stroke Edit Mode", 0, 0); WM_event_add_keymap_handler(handlers, keymap_edit); @@ -1871,6 +1875,11 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar area->flag &= ~AREA_FLAG_REGION_SIZE_UPDATE; } +bool ED_area_has_shared_border(struct ScrArea *a, struct ScrArea *b) +{ + return area_getorientation(a, b) != -1; +} + /* called in screen_refresh, or screens_init, also area size changes */ void ED_area_init(wmWindowManager *wm, wmWindow *win, ScrArea *area) { @@ -2626,7 +2635,7 @@ static void ed_panel_draw(const bContext *C, int headerend = w - UI_UNIT_X; UI_panel_header_buttons_begin(panel); - if (pt->draw_header_preset && !(pt->flag & PNL_NO_HEADER)) { + if (pt->draw_header_preset && !(pt->flag & PANEL_TYPE_NO_HEADER)) { /* for preset menu */ panel->layout = UI_block_layout(block, UI_LAYOUT_HORIZONTAL, @@ -2646,12 +2655,12 @@ static void ed_panel_draw(const bContext *C, panel->layout = NULL; } - if (pt->draw_header && !(pt->flag & PNL_NO_HEADER)) { + if (pt->draw_header && !(pt->flag & PANEL_TYPE_NO_HEADER)) { int labelx, labely; UI_panel_label_offset(block, &labelx, &labely); /* Unusual case: Use expanding layout (buttons stretch to available width). */ - if (pt->flag & PNL_LAYOUT_HEADER_EXPAND) { + if (pt->flag & PANEL_TYPE_HEADER_EXPAND) { uiLayout *layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, @@ -2685,7 +2694,7 @@ static void ed_panel_draw(const bContext *C, short panelContext; /* panel context can either be toolbar region or normal panels region */ - if (pt->flag & PNL_LAYOUT_VERT_BAR) { + if (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) { panelContext = UI_LAYOUT_VERT_BAR; } else if (region->regiontype == RGN_TYPE_TOOLS) { @@ -2695,16 +2704,16 @@ static void ed_panel_draw(const bContext *C, panelContext = UI_LAYOUT_PANEL; } - panel->layout = UI_block_layout(block, - UI_LAYOUT_VERTICAL, - panelContext, - (pt->flag & PNL_LAYOUT_VERT_BAR) ? 0 : style->panelspace, - 0, - (pt->flag & PNL_LAYOUT_VERT_BAR) ? 0 : - w - 2 * style->panelspace, - em, - 0, - style); + panel->layout = UI_block_layout( + block, + UI_LAYOUT_VERTICAL, + panelContext, + (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : style->panelspace, + 0, + (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : w - 2 * style->panelspace, + em, + 0, + style); pt->draw(C, panel); @@ -2883,7 +2892,7 @@ void ED_region_panels_layout_ex(const bContext *C, for (LinkNode *pt_link = panel_types_stack; pt_link; pt_link = pt_link->next) { PanelType *pt = pt_link->link; - if (pt->flag & PNL_INSTANCED) { + if (pt->flag & PANEL_TYPE_INSTANCED) { has_instanced_panel = true; continue; } @@ -2905,7 +2914,7 @@ void ED_region_panels_layout_ex(const bContext *C, ®ion->panels, pt, panel, - (pt->flag & PNL_DRAW_BOX) ? w_box_panel : w, + (pt->flag & PANEL_TYPE_DRAW_BOX) ? w_box_panel : w, em, NULL, search_filter); @@ -2917,7 +2926,7 @@ void ED_region_panels_layout_ex(const bContext *C, if (panel->type == NULL) { continue; /* Some panels don't have a type. */ } - if (!(panel->type->flag & PNL_INSTANCED)) { + if (!(panel->type->flag & PANEL_TYPE_INSTANCED)) { continue; } if (use_category_tabs && panel->type->category[0] && @@ -2939,7 +2948,7 @@ void ED_region_panels_layout_ex(const bContext *C, ®ion->panels, panel->type, panel, - (panel->type->flag & PNL_DRAW_BOX) ? w_box_panel : w, + (panel->type->flag & PANEL_TYPE_DRAW_BOX) ? w_box_panel : w, em, unique_panel_str, search_filter); @@ -3160,7 +3169,7 @@ bool ED_region_property_search(const bContext *C, for (LinkNode *pt_link = panel_types_stack; pt_link; pt_link = pt_link->next) { PanelType *panel_type = pt_link->link; /* Note that these checks are duplicated from #ED_region_panels_layout_ex. */ - if (panel_type->flag & PNL_INSTANCED) { + if (panel_type->flag & PANEL_TYPE_INSTANCED) { has_instanced_panel = true; continue; } @@ -3183,7 +3192,7 @@ bool ED_region_property_search(const bContext *C, if (!has_result && has_instanced_panel) { LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { /* Note that these checks are duplicated from #ED_region_panels_layout_ex. */ - if (panel->type == NULL || !(panel->type->flag & PNL_INSTANCED)) { + if (panel->type == NULL || !(panel->type->flag & PANEL_TYPE_INSTANCED)) { continue; } if (use_category_tabs) { @@ -3577,7 +3586,7 @@ static void metadata_draw_imbuf(ImBuf *ibuf, const rctf *rect, int fontid, const ofs_y += vertical_offset; } } /* Strip */ - else if (i == 1 || i == 2) { + else if (ELEM(i, 1, 2)) { int len = BLI_snprintf_rlen(temp_str, MAX_METADATA_STR, "%s: ", meta_data_list[i + 1]); if (metadata_is_valid(ibuf, temp_str, i + 1, len)) { BLF_position(fontid, xmin, ymax - vertical_offset - ofs_y, 0.0f); |