yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
themed_widgets.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GUI_WIDGETS_THEMED_WIDGETS_H_
2#define YAZE_APP_GUI_WIDGETS_THEMED_WIDGETS_H_
3
4#include <functional>
5#include <string>
6
8#include "imgui/imgui.h"
9
10namespace yaze {
11namespace gui {
12
13// Standardized themed widgets that automatically respect the current theme.
14// These abstract away the repetitive PushStyleColor/PopStyleColor calls.
15
16// ============================================================================
17// Icon Size Presets
18// ============================================================================
19
20namespace IconSize {
36} // namespace IconSize
37
48bool RippleButton(const char* label, const ImVec2& size = ImVec2(0, 0),
49 const ImVec4& ripple_color = ImVec4(1.0f, 1.0f, 1.0f, 0.3f),
50 const char* panel_id = nullptr,
51 const char* anim_id = nullptr);
52
62bool BouncyButton(const char* label, const ImVec2& size = ImVec2(0, 0),
63 const char* panel_id = nullptr,
64 const char* anim_id = nullptr);
65
78bool ThemedIconButton(const char* icon, const char* tooltip = nullptr,
79 const ImVec2& size = ImVec2(0, 0), bool is_active = false,
80 bool is_disabled = false, const char* panel_id = nullptr,
81 const char* anim_id = nullptr);
82
96bool TransparentIconButton(const char* icon, const ImVec2& size,
97 const char* tooltip = nullptr,
98 bool is_active = false,
99 const ImVec4& active_color = ImVec4(0, 0, 0, 0),
100 const char* panel_id = nullptr,
101 const char* anim_id = nullptr);
102
111bool ThemedButton(const char* label, const ImVec2& size = ImVec2(0, 0),
112 const char* panel_id = nullptr,
113 const char* anim_id = nullptr);
114
123bool PrimaryButton(const char* label, const ImVec2& size = ImVec2(0, 0),
124 const char* panel_id = nullptr,
125 const char* anim_id = nullptr);
126
135bool DangerButton(const char* label, const ImVec2& size = ImVec2(0, 0),
136 const char* panel_id = nullptr,
137 const char* anim_id = nullptr);
138
147bool SuccessButton(const char* label, const ImVec2& size = ImVec2(0, 0),
148 const char* panel_id = nullptr,
149 const char* anim_id = nullptr);
150
161bool ToolbarIconButton(const char* icon, const char* tooltip = nullptr,
162 bool is_active = false);
163
175bool InlineIconButton(const char* icon, const char* tooltip = nullptr,
176 bool is_active = false);
177
181void SectionHeader(const char* label);
182
186bool BeginThemedTabBar(const char* id, ImGuiTabBarFlags flags = 0);
187void EndThemedTabBar();
188
198void ValueChangeFlash(bool changed, const char* id);
199
211void DrawCanvasHUD(const char* label, const ImVec2& pos, const ImVec2& size,
212 std::function<void()> draw_content);
213
225bool PaletteColorButton(const char* id, const struct SnesColor& color,
226 bool is_selected, bool is_modified, const ImVec2& size,
227 const char* panel_id = nullptr,
228 const char* anim_id = nullptr);
229
235void PanelHeader(const char* title, const char* icon = nullptr,
236 bool* p_open = nullptr, const char* panel_id = nullptr);
237
241void ThemedTooltip(const char* text);
242
243} // namespace gui
244} // namespace yaze
245
246#endif // YAZE_APP_GUI_WIDGETS_THEMED_WIDGETS_H_
bool TransparentIconButton(const char *icon, const ImVec2 &size, const char *tooltip, bool is_active, const ImVec4 &active_color, const char *panel_id, const char *anim_id)
Draw a transparent icon button (hover effect only).
bool ThemedIconButton(const char *icon, const char *tooltip, const ImVec2 &size, bool is_active, bool is_disabled, const char *panel_id, const char *anim_id)
Draw a standard icon button with theme-aware colors.
bool PrimaryButton(const char *label, const ImVec2 &size, const char *panel_id, const char *anim_id)
Draw a primary action button (accented color).
void ValueChangeFlash(bool changed, const char *id)
Provide visual "flash" feedback when a value changes.
void ThemedTooltip(const char *text)
Draw a tooltip with theme-aware background and borders.
bool BouncyButton(const char *label, const ImVec2 &size, const char *panel_id, const char *anim_id)
Draw a bouncy animated button that scales on press.
bool BeginThemedTabBar(const char *id, ImGuiTabBarFlags flags)
A stylized tab bar with "Mission Control" branding.
bool SuccessButton(const char *label, const ImVec2 &size, const char *panel_id, const char *anim_id)
Draw a success action button (green color).
void DrawCanvasHUD(const char *label, const ImVec2 &pos, const ImVec2 &size, std::function< void()> draw_content)
Draw a stylized Heads-Up Display (HUD) for canvas status.
void EndThemedTabBar()
bool ThemedButton(const char *label, const ImVec2 &size, const char *panel_id, const char *anim_id)
Draw a standard text button with theme colors.
bool DangerButton(const char *label, const ImVec2 &size, const char *panel_id, const char *anim_id)
Draw a danger action button (error color).
void SectionHeader(const char *icon, const char *label, const ImVec4 &color)
bool RippleButton(const char *label, const ImVec2 &size, const ImVec4 &ripple_color, const char *panel_id, const char *anim_id)
Draw a button with animated click ripple effect.
IMGUI_API bool PaletteColorButton(const char *id, const gfx::SnesColor &color, bool is_selected, bool is_modified, const ImVec2 &size, ImGuiColorEditFlags flags)
Definition color.cc:452
void PanelHeader(const char *title, const char *icon, bool *p_open, const char *panel_id)
Draw a panel header with consistent styling.
bool ToolbarIconButton(const char *icon, const char *tooltip, bool is_active)
Convenience wrapper for toolbar-sized icon buttons.
bool InlineIconButton(const char *icon, const char *tooltip, bool is_active)
Convenience wrapper for small inline icon buttons.
static constexpr float kIconButtonLarge
Definition ui_config.h:63
static constexpr float kIconButtonSmall
Definition ui_config.h:61
static constexpr float kActivityBarIconWidth
Definition ui_config.h:67
static constexpr float kIconButtonMedium
Definition ui_config.h:62
static constexpr float kIconButtonToolbar
Definition ui_config.h:64
static constexpr float kActivityBarIconHeight
Definition ui_config.h:68