Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_view.c
| Show All 30 Lines | |||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_image.h" | #include "BKE_image.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BLT_translation.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "wm_window.h" | #include "wm_window.h" | ||||
| ▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| wmWindow *win = NULL; | wmWindow *win = NULL; | ||||
| ScrArea *sa = NULL; | ScrArea *sa = NULL; | ||||
| SpaceImage *sima; | SpaceImage *sima; | ||||
| bool area_was_image = false; | bool area_was_image = false; | ||||
| if (scene->r.displaymode == R_OUTPUT_NONE) { | if (U.render_display_type == USER_RENDER_DISPLAY_NONE) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| if (scene->r.displaymode == R_OUTPUT_WINDOW) { | if (U.render_display_type == USER_RENDER_DISPLAY_WINDOW) { | ||||
| int sizex = 30 * UI_DPI_FAC + (scene->r.xsch * scene->r.size) / 100; | int sizex = 30 * UI_DPI_FAC + (scene->r.xsch * scene->r.size) / 100; | ||||
| int sizey = 60 * UI_DPI_FAC + (scene->r.ysch * scene->r.size) / 100; | int sizey = 60 * UI_DPI_FAC + (scene->r.ysch * scene->r.size) / 100; | ||||
| /* arbitrary... miniature image window views don't make much sense */ | /* arbitrary... miniature image window views don't make much sense */ | ||||
| if (sizex < 320) { | if (sizex < 320) { | ||||
| sizex = 320; | sizex = 320; | ||||
| } | } | ||||
| if (sizey < 256) { | if (sizey < 256) { | ||||
| sizey = 256; | sizey = 256; | ||||
| } | } | ||||
| /* changes context! */ | /* changes context! */ | ||||
| if (WM_window_open_temp(C, mx, my, sizex, sizey, WM_WINDOW_RENDER) == NULL) { | if (WM_window_open_temp(C, IFACE_("Blender Render"), mx, my, sizex, sizey, SPACE_IMAGE) == | ||||
| NULL) { | |||||
Severin: We can just pass the string here and do `IFACE_()` when setting the title. Just a little… | |||||
Not Done Inline ActionsIFACE_() is used both to translate the string and detect translatable strings, so I think it needs to remain here? brecht: `IFACE_()` is used both to translate the string and detect translatable strings, so I think it… | |||||
| BKE_report(reports, RPT_ERROR, "Failed to open window!"); | BKE_report(reports, RPT_ERROR, "Failed to open window!"); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| sa = CTX_wm_area(C); | sa = CTX_wm_area(C); | ||||
| } | } | ||||
| else if (scene->r.displaymode == R_OUTPUT_SCREEN) { | else if (U.render_display_type == USER_RENDER_DISPLAY_SCREEN) { | ||||
| sa = CTX_wm_area(C); | sa = CTX_wm_area(C); | ||||
| /* if the active screen is already in fullscreen mode, skip this and | /* if the active screen is already in fullscreen mode, skip this and | ||||
| * unset the area, so that the fullscreen area is just changed later */ | * unset the area, so that the fullscreen area is just changed later */ | ||||
| if (sa && sa->full) { | if (sa && sa->full) { | ||||
| sa = NULL; | sa = NULL; | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 189 Lines • Show Last 20 Lines | |||||
We can just pass the string here and do IFACE_() when setting the title. Just a little oversight.