History

First step toward pie menus

atlante45 committed 13 years ago

Commit 72774a51 parent e6cd90f4 files · +166 −3Browse files

Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all

Unified · Split

interface/src/Application.cpp+17−2
@@ -835,6 +835,8 @@ void Application::mouseMoveEvent(QMouseEvent* event) { · 834 unmodified lines
835 deleteVoxelUnderCursor();835 deleteVoxelUnderCursor();
836 }836 }
837 }837 }
838
839 _pieMenu.mouseMoveEvent(_mouseX, _mouseY);
838 }840 }
839}841}
840 842
@@ -847,7 +849,10 @@ void Application::mousePressEvent(QMouseEvent* event) { · 6 unmodified lines
847 _mouseDragStartedY = _mouseY;849 _mouseDragStartedY = _mouseY;
848 _mouseVoxelDragging = _mouseVoxel;850 _mouseVoxelDragging = _mouseVoxel;
849 _mousePressed = true;851 _mousePressed = true;
850 maybeEditVoxelUnderCursor();852
853 if (!maybeEditVoxelUnderCursor()) {
854 _pieMenu.mousePressEvent(_mouseX, _mouseY);
855 }
851 856
852 } else if (event->button() == Qt::RightButton && checkedVoxelModeAction() != 0) {857 } else if (event->button() == Qt::RightButton && checkedVoxelModeAction() != 0) {
853 deleteVoxelUnderCursor();858 deleteVoxelUnderCursor();
@@ -862,6 +867,8 @@ void Application::mouseReleaseEvent(QMouseEvent* event) { · 8 unmodified lines
862 _mouseY = event->y();867 _mouseY = event->y();
863 _mousePressed = false;868 _mousePressed = false;
864 checkBandwidthMeterClick();869 checkBandwidthMeterClick();
870
871 _pieMenu.mouseReleaseEvent(_mouseX, _mouseY);
865 }872 }
866 }873 }
867}874}
@@ -2740,6 +2747,10 @@ void Application::displayOverlay() { · 1872 unmodified lines
2740 _swatch.checkColor();2747 _swatch.checkColor();
2741 }2748 }
2742 2749
2750 if (_pieMenu.isDisplayed()) {
2751 _pieMenu.render();
2752 }
2753
2743 glPopMatrix();2754 glPopMatrix();
2744}2755}
2745 2756
@@ -3147,7 +3158,7 @@ void Application::shiftPaintingColor() { · 401 unmodified lines
3147}3158}
3148 3159
3149 3160
3150void Application::maybeEditVoxelUnderCursor() {3161bool Application::maybeEditVoxelUnderCursor() {
3151 if (_addVoxelMode->isChecked() || _colorVoxelMode->isChecked()) {3162 if (_addVoxelMode->isChecked() || _colorVoxelMode->isChecked()) {
3152 if (_mouseVoxel.s != 0) {3163 if (_mouseVoxel.s != 0) {
3153 PACKET_TYPE message = (_destructiveAddVoxel->isChecked() ?3164 PACKET_TYPE message = (_destructiveAddVoxel->isChecked() ?
@@ -3218,7 +3229,11 @@ void Application::maybeEditVoxelUnderCursor() { · 64 unmodified lines
3218 deleteVoxelUnderCursor();3229 deleteVoxelUnderCursor();
3219 } else if (_eyedropperMode->isChecked()) {3230 } else if (_eyedropperMode->isChecked()) {
3220 eyedropperVoxelUnderCursor();3231 eyedropperVoxelUnderCursor();
3232 } else {
3233 return false;
3221 }3234 }
3235
3236 return true;
3222}3237}
3223 3238
3224void Application::deleteVoxelUnderCursor() {3239void Application::deleteVoxelUnderCursor() {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t