X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdropdown.cpp;h=47496f4bc385121d7c5c2862cec06947427cb799;hb=2accd84fb2f8cc96efea8b3f27e381c2d2749160;hp=87ea5eece9cc7fcbe8341284a289fce8612ed434;hpb=2b70e8801c43875ed3f4135bdd0141265cff0312;p=libs%2Fgltk.git diff --git a/source/dropdown.cpp b/source/dropdown.cpp index 87ea5ee..47496f4 100644 --- a/source/dropdown.cpp +++ b/source/dropdown.cpp @@ -31,9 +31,9 @@ void Dropdown::autosize() if(const Part *text_part = style->get_part("text")) { const Sides &margin = text_part->get_margin(); - const GL::Font *font = style->get_font(); - float font_size = font->get_default_size(); - unsigned line_height = static_cast((font->get_ascent()-font->get_descent())*font_size); + const GL::Font &font = style->get_font(); + float font_size = style->get_font_size(); + unsigned line_height = static_cast((font.get_ascent()-font.get_descent())*font_size); geom.h = max(geom.h, line_height+margin.top+margin.bottom); } } @@ -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(); }