6 #ifndef TB_IMAGE_WIDGET_H
7 #define TB_IMAGE_WIDGET_H
9 #include "tb_widgets.h"
13 #include "image/tb_image_manager.h"
21 class TBImageWidget :
public TBWidget
25 TBOBJECT_SUBCLASS(TBImageWidget, TBWidget);
29 void SetImage(
const TBImage &image) { m_image = image; }
30 void SetImage(
const char *filename) { m_image = g_image_manager->GetImage(filename); }
32 void SetAdaptTextColor(
bool adapt) { m_adapt_text_color = adapt; }
33 virtual PreferredSize OnCalculatePreferredContentSize(
const SizeConstraints &constraints);
35 virtual void OnInflate(
const INFLATE_INFO &info);
36 virtual void OnPaint(
const PaintProps &paint_props);
39 bool m_adapt_text_color;
45 #endif // TB_IMAGE_WIDGET_H