Example #1
0
void ToolBar_Impl::on_resized()
{
    Rect rect = toolbar->get_geometry();

    int rect_width = rect.get_width();
    int rect_height = rect.get_height();

    if ( (rect_width > 0) && (rect_height > 0) )	// Only update if the geometry is valid
    {
        bool old_horiz = toolbar->get_pseudo_class("horizontal");

        horizontal = (rect_width >= rect_height);

        if (old_horiz != horizontal)
        {
            if (horizontal)
                toolbar->set_pseudo_class("horizontal", true);
            else
                toolbar->set_pseudo_class("vertical", true);
        }

        need_layout_update = true;
    }
}