diff --git a/GuiLite.h b/GuiLite.h index c4fc88a..dab83f3 100644 --- a/GuiLite.h +++ b/GuiLite.h @@ -1688,10 +1688,10 @@ class c_button : public c_wnd switch (m_status) { case STATUS_NORMAL: - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_NORMAL), m_z_order); + m_surface->fill_rect(rect, m_bg_color ? m_bg_color : c_theme::get_color(COLOR_WND_NORMAL), m_z_order); if (m_str) { - c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_NORMAL), ALIGN_HCENTER | ALIGN_VCENTER); + c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font_type, m_font_color, m_bg_color ? m_bg_color : c_theme::get_color(COLOR_WND_NORMAL), ALIGN_HCENTER | ALIGN_VCENTER); } break; case STATUS_FOCUSED: diff --git a/src/widgets_include/button.h b/src/widgets_include/button.h index ab28f4e..dcdc0f4 100644 --- a/src/widgets_include/button.h +++ b/src/widgets_include/button.h @@ -20,10 +20,10 @@ class c_button : public c_wnd switch (m_status) { case STATUS_NORMAL: - m_surface->fill_rect(rect, c_theme::get_color(COLOR_WND_NORMAL), m_z_order); + m_surface->fill_rect(rect, m_bg_color ? m_bg_color : c_theme::get_color(COLOR_WND_NORMAL), m_z_order); if (m_str) { - c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font, m_font_color, c_theme::get_color(COLOR_WND_NORMAL), ALIGN_HCENTER | ALIGN_VCENTER); + c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font_type, m_font_color, m_bg_color ? m_bg_color : c_theme::get_color(COLOR_WND_NORMAL), ALIGN_HCENTER | ALIGN_VCENTER); } break; case STATUS_FOCUSED: