MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / mouseReleaseEvent

Method mouseReleaseEvent

src/client/ui/float_controller.cpp:56–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 void FloatController::mouseReleaseEvent(QMouseEvent *event) {
57 pressed_ = false;
58 event->accept();
59 repaint();
60
61 QRect parent_rect = parentWidget()->geometry();
62 float x_pos_ratio = this->pos().x() * 1.0f / parent_rect.width();
63 float y_pos_ratio = this->pos().y() * 1.0f / parent_rect.height();
64 context_->SaveKeyValue(kPosX, std::to_string(x_pos_ratio));
65 context_->SaveKeyValue(kPosY, std::to_string(y_pos_ratio));
66
67 if (click_listener_) {
68 click_listener_();
69 }
70
71 has_moved_ = false;
72 }
73
74 void FloatController::mouseMoveEvent(QMouseEvent *event) {
75 if (pressed_) {

Callers

nothing calls this directly

Calls 2

to_stringFunction · 0.85
SaveKeyValueMethod · 0.80

Tested by

no test coverage detected