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
835835 deleteVoxelUnderCursor();
836836 }
837837 }
838+
839+ _pieMenu.mouseMoveEvent(_mouseX, _mouseY);
838840 }
839841 }
840842
@@ -847,7 +849,10 @@ void Application::mousePressEvent(QMouseEvent* event) { · 6 unmodified lines
847849 _mouseDragStartedY = _mouseY;
848850 _mouseVoxelDragging = _mouseVoxel;
849851 _mousePressed = true;
850− maybeEditVoxelUnderCursor();
852+
853+ if (!maybeEditVoxelUnderCursor()) {
854+ _pieMenu.mousePressEvent(_mouseX, _mouseY);
855+ }
851856
852857 } else if (event->button() == Qt::RightButton && checkedVoxelModeAction() != 0) {
853858 deleteVoxelUnderCursor();
@@ -862,6 +867,8 @@ void Application::mouseReleaseEvent(QMouseEvent* event) { · 8 unmodified lines
862867 _mouseY = event->y();
863868 _mousePressed = false;
864869 checkBandwidthMeterClick();
870+
871+ _pieMenu.mouseReleaseEvent(_mouseX, _mouseY);
865872 }
866873 }
867874 }
@@ -2740,6 +2747,10 @@ void Application::displayOverlay() { · 1872 unmodified lines
27402747 _swatch.checkColor();
27412748 }
27422749
2750+ if (_pieMenu.isDisplayed()) {
2751+ _pieMenu.render();
2752+ }
2753+
27432754 glPopMatrix();
27442755 }
27452756
@@ -3147,7 +3158,7 @@ void Application::shiftPaintingColor() { · 401 unmodified lines
31473158 }
31483159
31493160
3150−void Application::maybeEditVoxelUnderCursor() {
3161+bool Application::maybeEditVoxelUnderCursor() {
31513162 if (_addVoxelMode->isChecked() || _colorVoxelMode->isChecked()) {
31523163 if (_mouseVoxel.s != 0) {
31533164 PACKET_TYPE message = (_destructiveAddVoxel->isChecked() ?
@@ -3218,7 +3229,11 @@ void Application::maybeEditVoxelUnderCursor() { · 64 unmodified lines
32183229 deleteVoxelUnderCursor();
32193230 } else if (_eyedropperMode->isChecked()) {
32203231 eyedropperVoxelUnderCursor();
3232+ } else {
3233+ return false;
32213234 }
3235+
3236+ return true;
32223237 }
32233238
32243239 void 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