Blender V5.3
file_banner.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "DNA_space_types.h"
10
11#include "BLI_function_ref.hh"
12
13#include "file_banner.hh"
14#include "file_intern.hh"
15
16namespace blender {
17
18static bool file_banners_any_visible(const SpaceFile &sfile)
19{
20 for (BannerType &banner : banner_types) {
21 if (banner.poll && banner.poll(sfile)) {
22 return true;
23 }
24 }
25 return false;
26}
27
29{
30 const bool any_visible = file_banners_any_visible(sfile);
31
32 if (sfile.runtime->banners_state.any_visible != any_visible) {
33 sfile.layout->dirty = true;
34 sfile.runtime->banners_state.any_visible = any_visible;
35 }
36}
37
39 FunctionRef<void(const BannerType &)> fn)
40{
41 for (BannerType &banner : banner_types) {
42 if (banner.poll && banner.poll(sfile)) {
44 fn(banner);
45 return;
46 }
47 }
48
50}
51
52} // namespace blender
BMesh Iterators.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
Array< BannerType > banner_types
static bool file_banners_any_visible(const SpaceFile &sfile)
void file_banners_for_first_visible(const SpaceFile &sfile, FunctionRef< void(const BannerType &)> fn)
void file_banners_update(const SpaceFile &sfile)
struct FileLayout * layout
SpaceFile_Runtime * runtime