]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/widget.cpp
Don't rebuild on state change if there are no visual changes
[libs/gltk.git] / source / widget.cpp
index e5c58a25d4e3b2000c29e1a2c92f0b79cc9970b2..8b7f1cbd88b351305a83f6dd56b2c9d5e32ac69b 100644 (file)
@@ -182,8 +182,10 @@ void Widget::set_enabled(bool e)
 
 void Widget::set_state(State mask, State bits)
 {
+       State old_state = state;
        state = (state&~mask)|bits;
-       rebuild();
+       if(style && style->compare_states(old_state, state))
+               rebuild();
 }
 
 void Widget::rebuild()