11 const ImVec2& size,
bool is_active,
21 ImGui::PushStyleColor(ImGuiCol_Button, bg_color);
24 ImGui::PushStyleColor(ImGuiCol_Text, text_color);
26 bool clicked = ImGui::Button(icon, size);
28 ImGui::PopStyleColor(4);
30 if (tooltip && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
31 ImGui::SetTooltip(
"%s", tooltip);
38 const char* tooltip,
bool is_active,
39 const ImVec4& active_color) {
43 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
51 if (active_color.w > 0.0f) {
52 text_color = active_color;
59 ImGui::PushStyleColor(ImGuiCol_Text, text_color);
61 bool clicked = ImGui::Button(icon, size);
63 ImGui::PopStyleColor(4);
65 if (tooltip && ImGui::IsItemHovered()) {
66 ImGui::SetTooltip(
"%s", tooltip);
74 return ImGui::Button(label, size);
85 bool clicked = ImGui::Button(label, size);
87 ImGui::PopStyleColor(4);
99 bool clicked = ImGui::Button(label, size);
101 ImGui::PopStyleColor(4);
108 ImGui::Text(
"%s", label);
109 ImGui::PopStyleColor();
118 bool is_selected,
bool is_modified,
119 const ImVec2& size) {
121 bool clicked = ImGui::ColorButton(
id, col, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoPicker, size);
124 ImGui::GetWindowDrawList()->AddRect(
125 ImGui::GetItemRectMin(), ImGui::GetItemRectMax(),
126 IM_COL32(255, 255, 255, 255), 0.0f, 0, 2.0f);
134void PanelHeader(
const char* title,
const char* icon,
bool* p_open) {
136 const float header_height = 44.0f;
137 const float padding = 12.0f;
140 ImVec2 header_min = ImGui::GetCursorScreenPos();
141 ImVec2 header_max = ImVec2(header_min.x + ImGui::GetWindowWidth(),
142 header_min.y + header_height);
144 ImDrawList* draw_list = ImGui::GetWindowDrawList();
145 draw_list->AddRectFilled(header_min, header_max,
149 draw_list->AddLine(ImVec2(header_min.x, header_max.y),
150 ImVec2(header_max.x, header_max.y),
154 ImGui::SetCursorPosX(padding);
155 ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (header_height - ImGui::GetTextLineHeight()) * 0.5f);
160 ImGui::Text(
"%s", icon);
161 ImGui::PopStyleColor();
167 ImGui::Text(
"%s", title);
168 ImGui::PopStyleColor();
172 const float button_size = 28.0f;
173 ImGui::SameLine(ImGui::GetWindowWidth() - button_size - padding);
174 ImGui::SetCursorPosY(ImGui::GetCursorPosY() - 4.0f);
182 ImGui::SetCursorPosY(header_height + 8.0f);
const Theme & GetCurrentTheme() const
static ThemeManager & Get()
ImVec4 ConvertColorToImVec4(const Color &color)
bool ThemedButton(const char *label, const ImVec2 &size)
Draw a standard text button with theme colors.
bool TransparentIconButton(const char *icon, const ImVec2 &size, const char *tooltip, bool is_active, const ImVec4 &active_color)
Draw a transparent icon button (hover effect only).
void PanelHeader(const char *title, const char *icon, bool *p_open)
Draw a panel header with consistent styling.
bool DangerButton(const char *label, const ImVec2 &size)
Draw a danger action button (error color).
void SectionHeader(const char *icon, const char *label, const ImVec4 &color)
bool ThemedIconButton(const char *icon, const char *tooltip, const ImVec2 &size, bool is_active, bool is_disabled)
Draw a standard icon button with theme-aware colors.
IMGUI_API bool PaletteColorButton(const char *id, const gfx::SnesColor &color, bool is_selected, bool is_modified, const ImVec2 &size, ImGuiColorEditFlags flags)
ImVec4 ConvertSnesColorToImVec4(const gfx::SnesColor &color)
Convert SnesColor to standard ImVec4 for display.
bool PrimaryButton(const char *label, const ImVec2 &size)
Draw a primary action button (accented color).