-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
18 changed files
with
64,351 additions
and
63,825 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,51 @@ | ||
from PyQt5.QtCore import Qt | ||
from PyQt5.QtGui import QIcon | ||
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QLayout, QSpinBox, QVBoxLayout | ||
|
||
|
||
class QCustomSpinboxInput(QDialog): | ||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) | ||
|
||
self.spinbox = QSpinBox(self) | ||
self.spinbox.setRange(0, 1000) | ||
self.spinbox.setSpecialValueText("Auto") | ||
|
||
self.buttons = QDialogButtonBox( | ||
QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self | ||
) | ||
self.buttons.accepted.connect(self.accept) | ||
self.buttons.rejected.connect(self.reject) | ||
|
||
for btn in self.buttons.buttons(): | ||
btn.setIcon(QIcon()) | ||
|
||
main_layout = QVBoxLayout(self) | ||
main_layout.setSizeConstraint(QLayout.SetMinAndMaxSize) | ||
main_layout.addWidget(self.spinbox) | ||
main_layout.addWidget(self.buttons) | ||
|
||
@classmethod | ||
def get_int( # noqa: WPS211 | ||
cls, | ||
parent, | ||
title, | ||
special_text=None, | ||
initial_value=0, | ||
_min=-2147483647, | ||
_max=2147483647, | ||
step=1, | ||
): | ||
dialog = cls(parent=parent) | ||
dialog.setWindowTitle(title) | ||
dialog.spinbox.setRange(_min, _max) | ||
dialog.spinbox.setValue(initial_value) | ||
dialog.spinbox.setSingleStep(step) | ||
|
||
if special_text: | ||
dialog.spinbox.setSpecialValueText(special_text) | ||
|
||
if dialog.exec(): | ||
return dialog.spinbox.value() | ||
|
||
return initial_value |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from pydantic import BaseModel | ||
|
||
from gridplayer.params_static import GridMode | ||
from gridplayer.settings import default_field | ||
|
||
|
||
class GridState(BaseModel): | ||
mode: GridMode = default_field("playlist/grid_mode") | ||
is_fit: bool = default_field("playlist/grid_fit") | ||
size: int = default_field("playlist/grid_size") |
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.