comparison Framework/Widgets/LayoutWidget.cpp @ 232:7d3b2c4f9ba1 am

don't cache hasUpdate_ since its not updated when we update the underlying hierarchy (i.e: when the child of a layout is a layout without child when it is added but childs are added later ...)
author am@osimis.io
date Fri, 15 Jun 2018 11:23:04 +0200
parents 5412adf19980
children f21ba2468570
comparison
equal deleted inserted replaced
231:5027cb2feb51 232:7d3b2c4f9ba1
80 std::auto_ptr<IWidget> widget_; 80 std::auto_ptr<IWidget> widget_;
81 int left_; 81 int left_;
82 int top_; 82 int top_;
83 unsigned int width_; 83 unsigned int width_;
84 unsigned int height_; 84 unsigned int height_;
85 bool hasUpdate_;
86 85
87 public: 86 public:
88 ChildWidget(IWidget* widget) : 87 ChildWidget(IWidget* widget) :
89 widget_(widget), 88 widget_(widget)
90 hasUpdate_(widget->HasUpdateContent())
91 { 89 {
92 assert(widget != NULL); 90 assert(widget != NULL);
93 SetEmpty(); 91 SetEmpty();
94 } 92 }
95 93
96 void UpdateContent() 94 void UpdateContent()
97 { 95 {
98 if (hasUpdate_) 96 if (widget_->HasUpdateContent())
99 { 97 {
100 widget_->UpdateContent(); 98 widget_->UpdateContent();
101 } 99 }
102 } 100 }
103 101