| 133 | } |
| 134 | |
| 135 | void Desktop::Remove( std::shared_ptr<Widget> widget ) { |
| 136 | WidgetsList::iterator iter( std::find( m_children.begin(), m_children.end(), widget )); |
| 137 | |
| 138 | if( iter != m_children.end() ) { |
| 139 | m_children.erase( iter ); |
| 140 | } |
| 141 | |
| 142 | if( m_last_receiver.lock() == widget ) { |
| 143 | m_last_receiver.reset(); |
| 144 | } |
| 145 | |
| 146 | RecalculateWidgetLevels(); |
| 147 | |
| 148 | if( !m_children.empty() && m_children.front()->GetAllocation().contains( sf::Vector2f( m_last_mouse_pos ) ) ) { |
| 149 | SendFakeMouseMoveEvent( m_children.front(), m_last_mouse_pos.x, m_last_mouse_pos.y ); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | void Desktop::RemoveAll() { |
| 154 | m_children.clear(); |