-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
86 changed files
with
311 additions
and
344 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
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# SPDX-FileCopyrightText: © 2022-2024 Wojciech Trybus <[email protected]> | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
from typing import Dict, Optional | ||
from functools import partial, partialmethod | ||
|
||
from PyQt5.QtCore import QTimer | ||
|
@@ -27,7 +26,7 @@ class TransformModeActions: | |
|
||
def __init__(self, window) -> None: | ||
self._finder = TransformModeFinder() | ||
self._actions: Dict[TransformMode, QWidgetAction] = {} | ||
self._actions: dict[TransformMode, QWidgetAction] = {} | ||
self._create_actions(window) | ||
|
||
def _create_actions(self, window) -> None: | ||
|
@@ -84,7 +83,7 @@ class TransformModeFinder: | |
""" | ||
|
||
def __init__(self) -> None: | ||
self._mode_buttons: Dict[TransformMode, QToolButton] = {} | ||
self._mode_buttons: dict[TransformMode, QToolButton] = {} | ||
self._transform_options: QWidget | ||
self._apply_button: QPushButton | ||
|
||
|
@@ -111,7 +110,7 @@ def activate_mode(self, mode: TransformMode, apply: bool) -> None: | |
self._apply_button.click() | ||
self._mode_buttons[mode].click() | ||
|
||
def get_active_mode(self) -> Optional[TransformMode]: | ||
def get_active_mode(self) -> TransformMode | None: | ||
for mode, button in self._mode_buttons.items(): | ||
if button.isChecked(): | ||
return mode | ||
|
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
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
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
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
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# SPDX-FileCopyrightText: © 2022-2024 Wojciech Trybus <[email protected]> | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
from typing import Optional, Callable | ||
from typing import Callable | ||
|
||
from PyQt5.QtWidgets import QWidget, QPushButton | ||
from PyQt5.QtGui import QColor, QIcon | ||
|
@@ -20,7 +20,7 @@ def __init__( | |
active_color_callback: Callable[[], QColor], | ||
icon: QIcon = QIcon(), | ||
icon_scale: float = 1, | ||
parent: Optional[QWidget] = None, | ||
parent: QWidget | None = None, | ||
) -> None: | ||
QPushButton.__init__(self, icon, "", parent) | ||
self.setCursor(Qt.ArrowCursor) | ||
|
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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# SPDX-FileCopyrightText: © 2022-2024 Wojciech Trybus <[email protected]> | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
from typing import Optional | ||
|
||
from PyQt5.QtGui import QIcon | ||
from PyQt5.QtCore import pyqtSignal, QEvent | ||
from PyQt5.QtWidgets import QWidget, QPushButton | ||
|
@@ -26,7 +24,7 @@ def __init__( | |
icon: QIcon = QIcon(), | ||
text: str = "", | ||
confirm_text: str = "Confirm?", | ||
parent: Optional[QWidget] = None | ||
parent: QWidget | None = None | ||
) -> None: | ||
super().__init__(icon, text, parent) | ||
super().clicked.connect(self._clicked) | ||
|
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
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
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
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
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
Oops, something went wrong.