19 bool result = ImGui::Button(label, size);
21 ImGui::PopStyleColor(3);
28 if (tooltip && ImGui::IsItemHovered()) {
30 ImGui::Text(
"%s", tooltip);
39 ImGui::PushStyleColor(ImGuiCol_ButtonHovered,
40 ImVec4(theme.accent.red * 1.2f, theme.accent.green * 1.2f,
41 theme.accent.blue * 1.2f, theme.accent.alpha));
42 ImGui::PushStyleColor(ImGuiCol_ButtonActive,
43 ImVec4(theme.accent.red * 0.8f, theme.accent.green * 0.8f,
44 theme.accent.blue * 0.8f, theme.accent.alpha));
46 bool result = ImGui::Button(label, size);
48 ImGui::PopStyleColor(3);
55 ImGui::PushStyleColor(ImGuiCol_ButtonHovered,
56 ImVec4(theme.error.red * 1.2f, theme.error.green * 1.2f,
57 theme.error.blue * 1.2f, theme.error.alpha));
58 ImGui::PushStyleColor(ImGuiCol_ButtonActive,
59 ImVec4(theme.error.red * 0.8f, theme.error.green * 0.8f,
60 theme.error.blue * 0.8f, theme.error.alpha));
62 bool result = ImGui::Button(label, size);
64 ImGui::PopStyleColor(3);
82 bool result = ImGui::CollapsingHeader(label, flags);
84 ImGui::PopStyleColor(3);
92void ThemedCard(
const char* label, std::function<
void()> content,
const ImVec2& size) {
102 ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, theme.window_rounding);
103 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,
107 ImGui::BeginChild(label, size,
true);
112 ImGui::PopStyleVar(2);
113 ImGui::PopStyleColor(1);
121 ImGuiInputTextFlags flags) {
128 bool result = ImGui::InputText(label, buf, buf_size, flags);
130 ImGui::PopStyleColor(3);
135 ImGuiInputTextFlags flags) {
142 bool result = ImGui::InputInt(label, v, step, step_fast, flags);
144 ImGui::PopStyleColor(3);
149 const char* format, ImGuiInputTextFlags flags) {
156 bool result = ImGui::InputFloat(label, v, step, step_fast, format, flags);
158 ImGui::PopStyleColor(3);
166 bool result = ImGui::Checkbox(label, v);
168 ImGui::PopStyleColor(1);
172bool ThemedCombo(
const char* label,
int* current_item,
const char*
const items[],
173 int items_count,
int popup_max_height_in_items) {
180 bool result = ImGui::Combo(label, current_item, items, items_count,
181 popup_max_height_in_items);
183 ImGui::PopStyleColor(3);
192 const ImVec2& outer_size,
float inner_width) {
211 ImGui::BeginTooltip();
216 ImGui::PopStyleColor(1);
242 ImGui::TextColored(color,
"%s", text);
249 ImGui::ProgressBar(fraction, size, overlay);
251 ImGui::PopStyleColor(1);
260 bool show_snes_format,
261 bool show_hex_format) {
262 auto col = color.
rgb();
263 int r =
static_cast<int>(col.x);
264 int g =
static_cast<int>(col.y);
265 int b =
static_cast<int>(col.z);
268 ImGui::Text(
"RGB (0-255):");
270 ImGui::Text(
"(%d, %d, %d)", r, g, b);
271 if (ImGui::IsItemClicked()) {
273 snprintf(buf,
sizeof(buf),
"(%d, %d, %d)", r, g, b);
274 ImGui::SetClipboardText(buf);
278 if (show_snes_format) {
279 ImGui::Text(
"SNES BGR555:");
281 ImGui::Text(
"$%04X", color.
snes());
282 if (ImGui::IsItemClicked()) {
284 snprintf(buf,
sizeof(buf),
"$%04X", color.
snes());
285 ImGui::SetClipboardText(buf);
290 if (show_hex_format) {
293 ImGui::Text(
"#%02X%02X%02X", r, g, b);
294 if (ImGui::IsItemClicked()) {
296 snprintf(buf,
sizeof(buf),
"#%02X%02X%02X", r, g, b);
297 ImGui::SetClipboardText(buf);
301 ImGui::TextDisabled(
"(Click any value to copy)");
305 if (!is_modified)
return;
311 ImGui::TextColored(color,
"%s", text);
313 ImGui::TextColored(color,
"Modified");
332 ImGui::PopStyleColor(6);
constexpr ImVec4 rgb() const
Get RGB values (WARNING: stored as 0-255 in ImVec4)
constexpr uint16_t snes() const
Get SNES 15-bit color.
static void SectionHeader(const char *label)
static float GetPanelPadding()
static void HelpMarker(const char *desc)
static float GetStandardInputWidth()
static float GetStandardWidgetHeight()
static bool BeginTableWithTheming(const char *str_id, int columns, ImGuiTableFlags flags=0, const ImVec2 &outer_size=ImVec2(0, 0), float inner_width=0.0f)
void ThemedHelpMarker(const char *desc)
Themed help marker with tooltip.
bool ThemedCheckbox(const char *label, bool *v)
Themed checkbox.
ImVec4 ConvertColorToImVec4(const Color &color)
bool ThemedButton(const char *label, const ImVec2 &size)
Theme-aware widget library.
void ThemedCard(const char *label, std::function< void()> content, const ImVec2 &size)
Themed card with rounded corners and shadow.
void ColorInfoPanel(const yaze::gfx::SnesColor &color, bool show_snes_format, bool show_hex_format)
Display color information with copy-to-clipboard functionality.
void BeginThemedPanel(const char *label, const ImVec2 &size)
Begin themed panel (manual version of ThemedCard)
void ModifiedBadge(bool is_modified, const char *text)
Modified indicator badge (displayed as text with icon)
bool BeginThemedTable(const char *str_id, int columns, ImGuiTableFlags flags, const ImVec2 &outer_size, float inner_width)
Begin themed table with automatic styling.
bool ThemedInputFloat(const char *label, float *v, float step, float step_fast, const char *format, ImGuiInputTextFlags flags)
Themed float input.
void ThemedStatusText(const char *text, StatusType type)
Themed status text (success, warning, error, info)
bool DangerButton(const char *label, const ImVec2 &size)
Danger/destructive action button (uses error color)
const EnhancedTheme & GetTheme()
Get current theme (shortcut)
void BeginThemedTooltip()
Begin themed tooltip.
void SectionHeader(const char *icon, const char *label, const ImVec4 &color)
void EndThemedTooltip()
End themed tooltip.
void PushThemedWidgetColors()
Apply theme colors to next widget.
bool PrimaryButton(const char *label, const ImVec2 &size)
Primary action button (uses accent color)
void PopThemedWidgetColors()
Restore previous colors.
bool ThemedCombo(const char *label, int *current_item, const char *const items[], int items_count, int popup_max_height_in_items)
Themed combo box.
bool ThemedInputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags)
Themed text input.
void EndThemedPanel()
End themed panel.
void ThemedProgressBar(float fraction, const ImVec2 &size, const char *overlay)
Themed progress bar.
void EndThemedTable()
End themed table.
bool ThemedCollapsingHeader(const char *label, ImGuiTreeNodeFlags flags)
Collapsible section with themed header.
bool ThemedIconButton(const char *icon, const char *tooltip)
Themed button with icon (Material Design Icons)
bool ThemedInputInt(const char *label, int *v, int step, int step_fast, ImGuiInputTextFlags flags)
Themed integer input.
Main namespace for the application.