Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_splash_screen.c
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
| #include "BLF_api.h" | #include "BLF_api.h" | ||||
| #include "IMB_imbuf.h" | #include "IMB_imbuf.h" | ||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_interface_icons.h" | |||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "wm.h" | #include "wm.h" | ||||
| static void wm_block_close(bContext *C, void *arg_block, void *UNUSED(arg)) | static void wm_block_close(bContext *C, void *arg_block, void *UNUSED(arg)) | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| ot->description = "Open the splash screen with release info"; | ot->description = "Open the splash screen with release info"; | ||||
| ot->invoke = wm_splash_invoke; | ot->invoke = wm_splash_invoke; | ||||
| ot->poll = WM_operator_winactive; | ot->poll = WM_operator_winactive; | ||||
| } | } | ||||
| static uiBlock *wm_block_create_about(bContext *C, ARegion *region, void *UNUSED(arg)) | static uiBlock *wm_block_create_about(bContext *C, ARegion *region, void *UNUSED(arg)) | ||||
| { | { | ||||
| const uiStyle *style = UI_style_get_dpi(); | |||||
| const short logo_size = 128 * U.dpi_fac; | |||||
| const int text_points_max = MAX2(style->widget.points, style->widgetlabel.points); | |||||
| const int dialog_width = logo_size + (text_points_max * 32 * U.dpi_fac); | |||||
| /* Calculate icon column factor. */ | |||||
| const float split_factor = (float)logo_size / (float)(dialog_width - style->columnspace); | |||||
| uiBlock *block = UI_block_begin(C, region, "about", UI_EMBOSS); | uiBlock *block = UI_block_begin(C, region, "about", UI_EMBOSS); | ||||
| uiLayout *layout = uiLayoutAlertIconSplitWrapperCreate(block, 32, ALERT_ICON_BLENDER); | |||||
| UI_block_flag_enable( | |||||
| block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_LOOP | UI_BLOCK_NO_WIN_CLIP | UI_BLOCK_NUMSELECT); | |||||
| UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP); | |||||
| UI_block_emboss_set(block, UI_EMBOSS); | |||||
| uiLayout *block_layout = UI_block_layout( | |||||
| block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, dialog_width, 0, 0, style); | |||||
| /* Split layout to put Blender logo on left side. */ | |||||
| uiLayout *split_block = uiLayoutSplit(block_layout, split_factor, false); | |||||
| /* Blender Logo. */ | |||||
| uiLayout *layout = uiLayoutColumn(split_block, false); | |||||
| uiDefButAlert(block, ALERT_ICON_BLENDER, 0, 0, 0, logo_size); | |||||
| /* The rest of the content on the right. */ | |||||
| layout = uiLayoutColumn(split_block, false); | |||||
| uiLayoutSetScaleY(layout, 0.7f); | uiLayoutSetScaleY(layout, 0.7f); | ||||
| uiItemS_ex(layout, 1.0f); | uiItemS_ex(layout, 1.0f); | ||||
| /* Title. */ | /* Title. */ | ||||
| uiItemL_ex(layout, "Blender", ICON_NONE, true, false); | uiItemL_ex(layout, "Blender", ICON_NONE, true, false); | ||||
| ▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines | |||||