diff options
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 4fb5e0c1af3..885cd1ee77d 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -696,21 +696,9 @@ static bool actionzone_area_poll(bContext *C) /* the debug drawing of the click_rect is in area_draw_azone_fullscreen, keep both in sync */ static void fullscreen_click_rcti_init( - rcti *rect, const short x1, const short y1, const short x2, const short y2) + rcti *rect, const short UNUSED(x1), const short UNUSED(y1), const short x2, const short y2) { - int x = x2 - ((float)x2 - x1) * 0.5f / UI_DPI_FAC; - int y = y2 - ((float)y2 - y1) * 0.5f / UI_DPI_FAC; - float icon_size = UI_DPI_ICON_SIZE + 7 * UI_DPI_FAC; - - /* adjust the icon distance from the corner */ - x += 36.0f / UI_DPI_FAC; - y += 36.0f / UI_DPI_FAC; - - /* draws from the left bottom corner of the icon */ - x -= UI_DPI_ICON_SIZE; - y -= UI_DPI_ICON_SIZE; - - BLI_rcti_init(rect, x, x + icon_size, y, y + icon_size); + BLI_rcti_init(rect, x2 - U.widget_unit, x2, y2 - U.widget_unit, y2); } static bool azone_clipped_rect_calc(const AZone *az, rcti *r_rect_clip) @@ -3754,7 +3742,7 @@ static int region_quadview_exec(bContext *C, wmOperator *op) rv3d->viewlock = 0; rv3d->rflag &= ~RV3D_CLIPPING; - /* accumulate locks, incase they're mixed */ + /* Accumulate locks, in case they're mixed. */ for (ar_iter = sa->regionbase.first; ar_iter; ar_iter = ar_iter->next) { if (ar_iter->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d_iter = ar_iter->regiondata; @@ -4787,6 +4775,40 @@ static void SCREEN_OT_drivers_editor_show(struct wmOperatorType *ot) /** \} */ /* -------------------------------------------------------------------- */ +/** \name Show Info Log Operator + * \{ */ + +static int info_log_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) +{ + int sizex = 900 * UI_DPI_FAC; + int sizey = 580 * UI_DPI_FAC; + int shift_y = 480; + + /* changes context! */ + if (WM_window_open_temp(C, event->x, event->y + shift_y, sizex, sizey, WM_WINDOW_INFO) != NULL) { + return OPERATOR_FINISHED; + } + else { + BKE_report(op->reports, RPT_ERROR, "Failed to open window!"); + return OPERATOR_CANCELLED; + } +} + +static void SCREEN_OT_info_log_show(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Show Info Log"; + ot->description = "Show info log in a separate window"; + ot->idname = "SCREEN_OT_info_log_show"; + + /* api callbacks */ + ot->invoke = info_log_show_invoke; + ot->poll = ED_operator_screenactive; +} + +/** \} */ + +/* -------------------------------------------------------------------- */ /** \name New Screen Operator * \{ */ @@ -5253,6 +5275,7 @@ void ED_operatortypes_screen(void) WM_operatortype_append(SCREEN_OT_screenshot); WM_operatortype_append(SCREEN_OT_userpref_show); WM_operatortype_append(SCREEN_OT_drivers_editor_show); + WM_operatortype_append(SCREEN_OT_info_log_show); WM_operatortype_append(SCREEN_OT_region_blend); WM_operatortype_append(SCREEN_OT_space_type_set_or_cycle); WM_operatortype_append(SCREEN_OT_space_context_cycle); |