-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added controls dialog that can be opened with a tickbox or by pressin…
…g C (#139) * added controls dialog * Update controls_dialog.py with copyright notice * fix controls_dialog.py typos
- Loading branch information
1 parent
7faa328
commit ec26022
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
""" | ||
Copyright (C) 2024 Felipe Galindo | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
import sys | ||
from PyQt5 import QtWidgets | ||
from PyQt5 import QtCore | ||
|
||
# class to create a new dialog window that shows the controls of the application | ||
class ControlsDialog(QtWidgets.QDialog): | ||
closed = QtCore.pyqtSignal() | ||
|
||
def __init__(self, parent=None): | ||
super().__init__(parent) | ||
self.setWindowTitle("Controls") | ||
self.setMinimumSize(300, 200) | ||
|
||
# controls_text = """ | ||
# Controls: | ||
# - Left Click: Draw | ||
# - Right Click: Erase | ||
# - Scroll: Zoom | ||
# - Arrow Keys: Move around | ||
# - Ctrl + Z: Undo | ||
# - Ctrl + Y: Redo | ||
# """ | ||
|
||
controls_text = """ | ||
Controls: | ||
- Show/Hide Predicted Segmentation: S | ||
- Show/Hide Human Annotations: A | ||
- Show/Hide Image: I | ||
- Foreground: Q | ||
- Background: W | ||
- Erase: E | ||
- Change Brush Size: Shift + Scroll | ||
- Undo: Z | ||
- Redo: Shift + cmd + Z | ||
- Zoom In: Shift + '+' | ||
- Zoom Out: - | ||
- Zoom: Scroll | ||
- Pan: cmd + drag the on the image with right click | ||
""" | ||
|
||
layout = QtWidgets.QVBoxLayout() | ||
label = QtWidgets.QLabel(controls_text) | ||
layout.addWidget(label) | ||
self.setLayout(layout) | ||
|
||
def closeEvent(self, event): | ||
self.closed.emit() | ||
super().closeEvent(event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters