1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

Spreadsheet: Rename variables to better describe their function

Rename some variables relating to the drag-and-cut operations as
well as the select operation so that they are more clear.
This commit is contained in:
martinfalisse 2022-02-08 15:38:17 +01:00 committed by Ali Mohammad Pur
parent e98d0dafa0
commit 8a7d2c3336
2 changed files with 10 additions and 10 deletions

View file

@ -79,7 +79,7 @@ void InfinitelyScrollableTableView::mousemove_event(GUI::MouseEvent& event)
m_is_hovering_cut_zone = false;
m_is_hovering_extend_zone = false;
if (selection().size() > 0 && !m_should_intercept_drag) {
if (selection().size() > 0 && !m_is_dragging_for_select) {
// Get top-left and bottom-right most cells of selection
auto bottom_right_most_index = selection().first();
auto top_left_most_index = selection().first();
@ -134,20 +134,20 @@ void InfinitelyScrollableTableView::mousemove_event(GUI::MouseEvent& event)
auto holding_left_button = !!(event.buttons() & GUI::MouseButton::Primary);
if (m_is_dragging_for_copy) {
m_should_intercept_drag = false;
m_is_dragging_for_select = false;
if (holding_left_button) {
m_has_committed_to_dragging = true;
m_has_committed_to_cutting = true;
}
} else if (!m_should_intercept_drag) {
} else if (!m_is_dragging_for_select) {
if (!holding_left_button) {
m_starting_selection_index = index;
} else {
m_should_intercept_drag = true;
m_is_dragging_for_select = true;
m_might_drag = false;
}
}
if (holding_left_button && m_should_intercept_drag && !m_has_committed_to_dragging) {
if (holding_left_button && m_is_dragging_for_select && !m_has_committed_to_cutting) {
if (!m_starting_selection_index.is_valid())
m_starting_selection_index = index;
@ -189,9 +189,9 @@ void InfinitelyScrollableTableView::mousedown_event(GUI::MouseEvent& event)
void InfinitelyScrollableTableView::mouseup_event(GUI::MouseEvent& event)
{
m_should_intercept_drag = false;
m_has_committed_to_dragging = false;
m_is_dragging_for_select = false;
m_is_dragging_for_copy = false;
m_has_committed_to_cutting = false;
if (m_is_hovering_cut_zone) {
auto rect = content_rect(m_target_cell);
GUI::MouseEvent adjusted_event = { (GUI::Event::Type)event.type(), rect.center(), event.buttons(), event.button(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y() };