| 386 | } |
| 387 | |
| 388 | bool |
| 389 | MoveService::handle_click (const db::DPoint &p, unsigned int buttons, bool drag_transient, db::Transaction *transaction) |
| 390 | { |
| 391 | std::unique_ptr<db::Transaction> trans_holder (transaction); |
| 392 | |
| 393 | if (! m_dragging) { |
| 394 | |
| 395 | mp_transaction.reset (trans_holder.release ()); |
| 396 | ui ()->drag_cancel (); |
| 397 | |
| 398 | if (mp_editables->begin_move (p, ac_from_buttons (buttons))) { |
| 399 | |
| 400 | ui ()->hover_reset (); |
| 401 | |
| 402 | mp_editables->clear_transient_selection (); |
| 403 | |
| 404 | m_dragging = true; |
| 405 | m_dragging_transient = drag_transient; |
| 406 | |
| 407 | show_toolbox (true); |
| 408 | ui ()->grab_mouse (this, false); |
| 409 | |
| 410 | m_shift = db::DPoint (); |
| 411 | |
| 412 | return true; |
| 413 | |
| 414 | } |
| 415 | |
| 416 | } else { |
| 417 | |
| 418 | m_dragging = false; |
| 419 | |
| 420 | show_toolbox (false); |
| 421 | ui ()->ungrab_mouse (this); |
| 422 | |
| 423 | mp_editables->end_move (p, ac_from_buttons (buttons), mp_transaction.release ()); |
| 424 | |
| 425 | if (m_dragging_transient) { |
| 426 | mp_editables->clear_selection (); |
| 427 | } |
| 428 | |
| 429 | return true; |
| 430 | |
| 431 | } |
| 432 | return false; |
| 433 | } |
| 434 | |
| 435 | void |
| 436 | MoveService::drag_cancel () |
nothing calls this directly
no test coverage detected