yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
icon_browser.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GUI_WIDGETS_ICON_BROWSER_H_
2#define YAZE_APP_GUI_WIDGETS_ICON_BROWSER_H_
3
4namespace yaze {
5namespace gui {
6
7// Grid of Material Design icon buttons with a search field at the top.
8// Draws the catalog from `kCommonIcons[]` (curated ~100-icon subset). A
9// full-header codegen is a follow-up.
10//
11// Returns the selected glyph as a C string (the `ICON_MD_*` UTF-8 literal)
12// when the user clicks a cell, or nullptr otherwise. Callers can paste the
13// returned string directly into ImGui label strings:
14//
15// if (const char* glyph = gui::IconBrowser("##icons")) {
16// selected_label_ = absl::StrCat(glyph, " Save");
17// }
18//
19// The returned pointer is valid for the lifetime of the process (it points
20// into a static icon table). `label` participates in ImGui ID scoping.
21const char* IconBrowser(const char* label);
22
23namespace icon_browser_internal {
24
25// Returns true when `search_key` matches every whitespace-separated term in
26// `query` (case-insensitive substring). An empty query matches everything.
27bool MatchesQuery(const char* search_key, const char* query);
28
29} // namespace icon_browser_internal
30
31} // namespace gui
32} // namespace yaze
33
34#endif // YAZE_APP_GUI_WIDGETS_ICON_BROWSER_H_
bool MatchesQuery(const char *search_key, const char *query)
const char * IconBrowser(const char *label)