Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/screen_ops.c
| Show First 20 Lines • Show All 4,827 Lines • ▼ Show 20 Lines | |||||
| * \{ */ | * \{ */ | ||||
| static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) | static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| { | { | ||||
| int sizex = (500 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC; | int sizex = (500 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC; | ||||
| int sizey = 520 * UI_DPI_FAC; | int sizey = 520 * UI_DPI_FAC; | ||||
| /* changes context! */ | /* changes context! */ | ||||
| if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_USERPREFS) != NULL) { | if (WM_window_open_temp( | ||||
| C, IFACE_("Blender Preferences"), event->x, event->y, sizex, sizey, SPACE_USERPREF) != | |||||
| NULL) { | |||||
| /* The header only contains the editor switcher and looks empty. | /* The header only contains the editor switcher and looks empty. | ||||
| * So hiding in the temp window makes sense. */ | * So hiding in the temp window makes sense. */ | ||||
| ScrArea *area = CTX_wm_area(C); | ScrArea *area = CTX_wm_area(C); | ||||
| ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER); | ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER); | ||||
| region->flag |= RGN_FLAG_HIDDEN; | region->flag |= RGN_FLAG_HIDDEN; | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| else { | else { | ||||
| Show All 32 Lines | static int drivers_editor_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| /* Get active property to show driver for | /* Get active property to show driver for | ||||
| * - Need to grab it first, or else this info disappears | * - Need to grab it first, or else this info disappears | ||||
| * after we've created the window | * after we've created the window | ||||
| */ | */ | ||||
| but = UI_context_active_but_prop_get(C, &ptr, &prop, &index); | but = UI_context_active_but_prop_get(C, &ptr, &prop, &index); | ||||
| /* changes context! */ | /* changes context! */ | ||||
| if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_DRIVERS) != NULL) { | if (WM_window_open_temp( | ||||
| C, IFACE_("Blender Drivers Editor"), event->x, event->y, sizex, sizey, SPACE_GRAPH) != | |||||
| NULL) { | |||||
| ED_drivers_editor_init(C, CTX_wm_area(C)); | |||||
| /* activate driver F-Curve for the property under the cursor */ | /* activate driver F-Curve for the property under the cursor */ | ||||
| if (but) { | if (but) { | ||||
| FCurve *fcu; | FCurve *fcu; | ||||
| bool driven, special; | bool driven, special; | ||||
| fcu = rna_get_fcurve_context_ui(C, &ptr, prop, index, NULL, NULL, &driven, &special); | fcu = rna_get_fcurve_context_ui(C, &ptr, prop, index, NULL, NULL, &driven, &special); | ||||
| if (fcu) { | if (fcu) { | ||||
| /* Isolate this F-Curve... */ | /* Isolate this F-Curve... */ | ||||
| Show All 39 Lines | |||||
| static int info_log_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) | static int info_log_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| { | { | ||||
| int sizex = 900 * UI_DPI_FAC; | int sizex = 900 * UI_DPI_FAC; | ||||
| int sizey = 580 * UI_DPI_FAC; | int sizey = 580 * UI_DPI_FAC; | ||||
| int shift_y = 480; | int shift_y = 480; | ||||
| /* changes context! */ | /* changes context! */ | ||||
| if (WM_window_open_temp(C, event->x, event->y + shift_y, sizex, sizey, WM_WINDOW_INFO) != NULL) { | if (WM_window_open_temp( | ||||
| C, IFACE_("Blender Info Log"), event->x, event->y + shift_y, sizex, sizey, SPACE_INFO) != | |||||
| NULL) { | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_report(op->reports, RPT_ERROR, "Failed to open window!"); | BKE_report(op->reports, RPT_ERROR, "Failed to open window!"); | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 583 Lines • Show Last 20 Lines | |||||