Skip to content

Commit

Permalink
Improve start page
Browse files Browse the repository at this point in the history
  • Loading branch information
jhm-ciberman committed Oct 29, 2022
1 parent 9871757 commit 0d33cb8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
10 changes: 8 additions & 2 deletions src/Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def run(self):
return

from .Main.ProjectExplorerPage import ShellWindow # Avoid circular imports
win = ShellWindow()
win.showMaximized()
self._shell = ShellWindow()
self._shell.showMaximized()

self._imageProcessorService.start()

Expand All @@ -130,3 +130,9 @@ def modelsDownloader(self) -> ModelsDownloader:
Returns the models downloader.
"""
return self._modelsDownloader

def shell(self):
"""
Returns the shell window.
"""
return self._shell
16 changes: 12 additions & 4 deletions src/Main/PhantomMascotAnimationWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def __init__(self, parent=None):
self._width = 400
self._height = 200
self._mascot = PhantomMascot(moveStartX=100, moveEndX=300, baseY=90)
self._tumbleweedBack = Tumbleweed(moveStartX=50, moveEndX=350, baseY=110, scale=0.5, alphaMulti=0.6)
self._tumbleweedFront = Tumbleweed(moveStartX=40, moveEndX=360, baseY=160, scale=0.8)
self._tumbleweedBack = Tumbleweed(moveStartX=50, moveEndX=350, baseY=110, scale=0.5, alphaMulti=0.6, hspeed=40)
self._tumbleweedFront = Tumbleweed(moveStartX=40, moveEndX=360, baseY=160, scale=0.8, alphaMulti=1.0, hspeed=60)

def _update(self):
t = time_ns() * 1e-9 # seconds
Expand Down Expand Up @@ -174,7 +174,11 @@ class Tumbleweed:

_bounceDeltaY = 15 # From (0,0) to (0, bounceDeltaY) and back

_bounceSpeed = 2 # cycles per second
_bounceSpeedMin = 0.5 # cycles per second

_bounceSpeedMax = 1.5 # cycles per second

_bounceSpeed = 0 # cycles per second

_movingSpeedX = 60 # pixels per second

Expand Down Expand Up @@ -202,7 +206,9 @@ class Tumbleweed:

_isMoving = False

def __init__(self, moveStartX: int, moveEndX: int, baseY: int, scale: float = 1.0, alphaMulti: float = 1.0) -> None:
def __init__(
self, moveStartX: int, moveEndX: int, baseY: int,
scale: float = 1.0, alphaMulti: float = 1.0, hspeed: float = 60) -> None:
self._timer = QtCore.QTimer()
self._timer.setSingleShot(True)
self._timer.timeout.connect(self._onTimerTimeout)
Expand All @@ -215,6 +221,7 @@ def __init__(self, moveStartX: int, moveEndX: int, baseY: int, scale: float = 1.
self._baseY = baseY
self._scale = scale
self._alphaMulti = alphaMulti
self._movingSpeedX = hspeed

self._transform = QtGui.QTransform()
self._alpha = 0
Expand All @@ -230,6 +237,7 @@ def _onTimerTimeout(self):
self._x = self._movingStartX
self._y = self._baseY
self._isMoving = True
self._bounceSpeed = random.uniform(self._bounceSpeedMin, self._bounceSpeedMax)

def update(self, dt: float, t: float):
if self._isMoving:
Expand Down
4 changes: 0 additions & 4 deletions src/Main/ProjectExplorerPage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from ctypes import alignment
import os

from PySide6 import QtCore, QtGui, QtWidgets
Expand Down Expand Up @@ -288,7 +287,6 @@ class EmptyProjectMessageWidget(QtWidgets.QFrame):
def __init__(self, parent: QtWidgets.QWidget):
super().__init__(parent)
self.setFrameStyle(QtWidgets.QFrame.StyledPanel)
self.setContentsMargins(0, 0, 0, 0)
self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)

contentWidget = QtWidgets.QWidget(self)
Expand Down Expand Up @@ -354,8 +352,6 @@ def __init__(self, parent: QtWidgets.QWidget):
frameLayout.addWidget(contentWidget, alignment=QtCore.Qt.AlignCenter)
self.setLayout(frameLayout)



@QtCore.Slot()
def _onAddImagesPressed(self) -> None:
Application.projectManager().importImages(self)
Expand Down

0 comments on commit 0d33cb8

Please sign in to comment.