]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/dropdown.cpp
Add protected functions for manipulating widget state
[libs/gltk.git] / source / dropdown.cpp
index cab6d918e536210190a256b67b7965c0851c2f1b..47496f4bc385121d7c5c2862cec06947427cb799 100644 (file)
@@ -97,14 +97,14 @@ void Dropdown::button_press(int x, int y, unsigned btn)
                if(!click_focus)
                {
                        dropped = false;
-                       state &= ~ACTIVE;
+                       clear_state(ACTIVE);
                        signal_ungrab_pointer.emit();
                }
        }
        else if(btn==1)
        {
                dropped = true;
-               state |= ACTIVE;
+               set_state(ACTIVE);
                signal_grab_pointer.emit();
        }
 }
@@ -160,7 +160,7 @@ void Dropdown::list_item_selected(unsigned index, const std::string &item)
        if(dropped)
        {
                dropped = false;
-               state &= ~ACTIVE;
+               clear_state(ACTIVE);
                signal_ungrab_pointer.emit();
        }