UI: Improved Area Icon Using a SpaceType Callback #124556
@ -129,7 +129,7 @@ struct SpaceType {
|
||||
/* Return a custom name, based on subtype or other reason. */
|
||||
blender::StringRefNull (*space_name_get)(ScrArea *area);
|
||||
/* Return a custom icon, based on subtype or other reason. */
|
||||
int (*space_icon_get)(ScrArea *area);
|
||||
int (*space_icon_get)(const ScrArea *area);
|
||||
|
||||
/**
|
||||
* Update pointers for all structs directly owned by this space.
|
||||
|
@ -916,7 +916,7 @@ blender::StringRefNull ED_area_name(ScrArea *area)
|
||||
return item.name;
|
||||
}
|
||||
|
||||
int ED_area_icon(ScrArea *area)
|
||||
int ED_area_icon(const ScrArea *area)
|
||||
{
|
||||
if (area->type->space_icon_get) {
|
||||
return area->type->space_icon_get(area);
|
||||
|
@ -874,7 +874,7 @@ static blender::StringRefNull action_space_name_get(ScrArea *area)
|
||||
return item.name;
|
||||
}
|
||||
|
||||
static int action_space_icon_get(ScrArea *area)
|
||||
static int action_space_icon_get(const ScrArea *area)
|
||||
{
|
||||
SpaceAction *sact = static_cast<SpaceAction *>(area->spacedata.first);
|
||||
const int index = RNA_enum_from_value(rna_enum_space_action_mode_items, sact->mode);
|
||||
|
@ -839,7 +839,7 @@ static blender::StringRefNull file_space_name_get(ScrArea *area)
|
||||
return item.name;
|
||||
}
|
||||
|
||||
static int file_space_icon_get(ScrArea *area)
|
||||
static int file_space_icon_get(const ScrArea *area)
|
||||
{
|
||||
SpaceFile *sfile = static_cast<SpaceFile *>(area->spacedata.first);
|
||||
const int index = RNA_enum_from_value(rna_enum_space_file_browse_mode_items, sfile->browse_mode);
|
||||
|
@ -876,7 +876,7 @@ static blender::StringRefNull graph_space_name_get(ScrArea *area)
|
||||
return item.name;
|
||||
}
|
||||
|
||||
static int graph_space_icon_get(ScrArea *area)
|
||||
static int graph_space_icon_get(const ScrArea *area)
|
||||
{
|
||||
SpaceGraph *sgraph = static_cast<SpaceGraph *>(area->spacedata.first);
|
||||
const int index = RNA_enum_from_value(rna_enum_space_graph_mode_items, sgraph->mode);
|
||||
|
@ -1085,7 +1085,7 @@ static blender::StringRefNull image_space_name_get(ScrArea *area)
|
||||
return item.name;
|
||||
}
|
||||
|
||||
static int image_space_icon_get(ScrArea *area)
|
||||
static int image_space_icon_get(const ScrArea *area)
|
||||
{
|
||||
SpaceImage *sima = static_cast<SpaceImage *>(area->spacedata.first);
|
||||
const int index = RNA_enum_from_value(rna_enum_space_image_mode_items, sima->mode);
|
||||
|
@ -1341,7 +1341,7 @@ static blender::StringRefNull node_space_name_get(ScrArea *area)
|
||||
return tree_type->ui_name;
|
||||
}
|
||||
|
||||
static int node_space_icon_get(ScrArea *area)
|
||||
static int node_space_icon_get(const ScrArea *area)
|
||||
{
|
||||
SpaceNode *snode = static_cast<SpaceNode *>(area->spacedata.first);
|
||||
Harley marked this conversation as resolved
Outdated
|
||||
bke::bNodeTreeType *tree_type = bke::ntreeTypeFind(snode->tree_idname);
|
||||
|
Loading…
Reference in New Issue
Block a user
static_cast
Will post a separate PR changing to static_cast for node_space_name_get and other places in the same file.