Cleanup: improve naming consistency, use doxy sections for splash screen
This commit is contained in:
@@ -52,7 +52,11 @@
|
||||
|
||||
#include "wm.hh"
|
||||
|
||||
static void wm_block_close(bContext *C, void *arg_block, void * /*arg*/)
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Splash Screen
|
||||
* \{ */
|
||||
|
||||
static void wm_block_splash_close(bContext *C, void *arg_block, void * /*arg*/)
|
||||
{
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
UI_popup_block_close(C, win, static_cast<uiBlock *>(arg_block));
|
||||
@@ -190,11 +194,11 @@ static void wm_block_splash_close_on_fileselect(bContext *C, void *arg1, void *
|
||||
}
|
||||
|
||||
if (has_fileselect) {
|
||||
wm_block_close(C, arg1, nullptr);
|
||||
wm_block_splash_close(C, arg1, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
static uiBlock *wm_block_create_splash(bContext *C, ARegion *region, void * /*arg*/)
|
||||
static uiBlock *wm_block_splash_create(bContext *C, ARegion *region, void * /*arg*/)
|
||||
{
|
||||
const uiStyle *style = UI_style_get_dpi();
|
||||
|
||||
@@ -219,7 +223,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *region, void * /*ar
|
||||
uiBut *but = uiDefButImage(
|
||||
block, ibuf, 0, 0.5f * U.widget_unit, splash_width, splash_height, nullptr);
|
||||
|
||||
UI_but_func_set(but, wm_block_close, block, nullptr);
|
||||
UI_but_func_set(but, wm_block_splash_close, block, nullptr);
|
||||
|
||||
wm_block_splash_add_label(block,
|
||||
BKE_blender_version_string(),
|
||||
@@ -271,7 +275,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *region, void * /*ar
|
||||
|
||||
static int wm_splash_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/)
|
||||
{
|
||||
UI_popup_block_invoke(C, wm_block_create_splash, nullptr, nullptr);
|
||||
UI_popup_block_invoke(C, wm_block_splash_create, nullptr, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -286,7 +290,13 @@ void WM_OT_splash(wmOperatorType *ot)
|
||||
ot->poll = WM_operator_winactive;
|
||||
}
|
||||
|
||||
static uiBlock *wm_block_create_about(bContext *C, ARegion *region, void * /*arg*/)
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Splash Screen: About
|
||||
* \{ */
|
||||
|
||||
static uiBlock *wm_block_about_create(bContext *C, ARegion *region, void * /*arg*/)
|
||||
{
|
||||
const uiStyle *style = UI_style_get_dpi();
|
||||
const int text_points_max = std::max(style->widget.points, style->widgetlabel.points);
|
||||
@@ -347,9 +357,9 @@ static uiBlock *wm_block_create_about(bContext *C, ARegion *region, void * /*arg
|
||||
return block;
|
||||
}
|
||||
|
||||
static int wm_about_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/)
|
||||
static int wm_splash_about_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/)
|
||||
{
|
||||
UI_popup_block_invoke(C, wm_block_create_about, nullptr, nullptr);
|
||||
UI_popup_block_invoke(C, wm_block_about_create, nullptr, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -360,6 +370,8 @@ void WM_OT_splash_about(wmOperatorType *ot)
|
||||
ot->idname = "WM_OT_splash_about";
|
||||
ot->description = "Open a window with information about Blender";
|
||||
|
||||
ot->invoke = wm_about_invoke;
|
||||
ot->invoke = wm_splash_about_invoke;
|
||||
ot->poll = WM_operator_winactive;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
Reference in New Issue
Block a user