X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdropdown.cpp;h=ef0fa22f97c8f150009988b3487c716b1e576cf2;hb=HEAD;hp=f922001e2db0764c38000ec046bb9cd1c53150e4;hpb=7286d604956ddffcbfa2df6567de866f3d5df3a2;p=libs%2Fgltk.git diff --git a/source/dropdown.cpp b/source/dropdown.cpp index f922001..ab00c4c 100644 --- a/source/dropdown.cpp +++ b/source/dropdown.cpp @@ -27,8 +27,6 @@ void Dropdown::init() { input_type = INPUT_NAVIGATION; - dropped = false; - add(list); list.set_visible(false); list.set_view_all(); @@ -53,7 +51,7 @@ void Dropdown::autosize_special(const Part &part, Geometry &ageom) const unsigned max_w = 0; const ListData &data = list.get_data(); - for(unsigned i=0; i(font.get_string_width(data.get_string(i))*font_size); max_w = max(max_w, w); @@ -179,7 +177,7 @@ void Dropdown::resize_list() list.set_geometry(lgeom); } -void Dropdown::list_item_selected(unsigned index) +void Dropdown::list_item_selected(size_t index) { if(dropped) { @@ -191,7 +189,7 @@ void Dropdown::list_item_selected(unsigned index) text.set(list.get_data().get_string(index)); signal_item_selected.emit(index); - rebuild(); + mark_rebuild(); } void Dropdown::list_selection_cleared()