1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html 2 3 #ifndef SPECTMORPH_FRAME_HH 4 #define SPECTMORPH_FRAME_HH 5 6 #include "smdrawutils.hh" 7 8 namespace SpectMorph 9 { 10 11 class Frame : public Widget 12 { 13 protected: 14 Color m_frame_color = ThemeColor::FRAME; 15 16 public: Frame(Widget * parent)17 Frame (Widget *parent) 18 : Widget (parent) 19 { 20 } 21 void draw(const DrawEvent & devent)22 draw (const DrawEvent& devent) override 23 { 24 const double radius = 10; 25 const double line_width = 1.5; 26 27 DrawUtils du (devent.cr); 28 du.round_box (0, 0, width(), height(), line_width, radius, m_frame_color, ThemeColor::OPERATOR_BG); 29 } 30 void set_frame_color(Color color)31 set_frame_color (Color color) 32 { 33 if (color == m_frame_color) 34 return; 35 36 m_frame_color = color; 37 update(); 38 } 39 }; 40 41 } 42 43 #endif 44 45