1
1
# @autor: Magno Efren
2
2
# Youtube: https://www.youtube.com/c/MagnoEfren
3
-
4
3
import sys
5
4
from menu import *
6
5
from PyQt5 import QtCore
7
6
from PyQt5 .QtCore import QPropertyAnimation
8
7
from PyQt5 import QtCore , QtGui , QtWidgets
9
-
10
8
class MiApp (QtWidgets .QMainWindow ):
11
9
def __init__ (self ):
12
10
super ().__init__ ()
13
11
self .ui = Ui_MainWindow ()
14
12
self .ui .setupUi (self )
15
-
16
13
#eliminar barra y de titulo - opacidad
17
14
self .setWindowFlag (QtCore .Qt .FramelessWindowHint )
18
15
self .setWindowOpacity (1 )
19
-
20
16
#SizeGrip
21
17
self .gripSize = 10
22
18
self .grip = QtWidgets .QSizeGrip (self )
23
19
self .grip .resize (self .gripSize , self .gripSize )
24
-
25
20
# mover ventana
26
21
self .ui .frame_superior .mouseMoveEvent = self .mover_ventana
27
-
28
22
#acceder a las paginas
29
23
self .ui .bt_inicio .clicked .connect (lambda : self .ui .stackedWidget .setCurrentWidget (self .ui .page ))
30
24
self .ui .bt_uno .clicked .connect (lambda : self .ui .stackedWidget .setCurrentWidget (self .ui .page_uno ))
@@ -71,16 +65,13 @@ def mover_menu(self):
71
65
self .animacion .setEndValue (extender )
72
66
self .animacion .setEasingCurve (QtCore .QEasingCurve .InOutQuart )
73
67
self .animacion .start ()
74
-
75
68
## SizeGrip
76
69
def resizeEvent (self , event ):
77
70
rect = self .rect ()
78
71
self .grip .move (rect .right () - self .gripSize , rect .bottom () - self .gripSize )
79
-
80
72
## mover ventana
81
73
def mousePressEvent (self , event ):
82
74
self .clickPosition = event .globalPos ()
83
85FC
-
84
75
def mover_ventana (self , event ):
85
76
if self .isMaximized () == False :
86
77
if event .buttons () == QtCore .Qt .LeftButton :
@@ -92,11 +83,8 @@ def mover_ventana(self, event):
92
83
self .showMaximized ()
93
84
else :
94
85
self .showNormal ()
95
-
96
86
if __name__ == "__main__" :
97
87
app = QtWidgets .QApplication (sys .argv )
98
88
mi_app = MiApp ()
99
89
mi_app .show ()
100
90
sys .exit (app .exec_ ())
101
-
102
-
0 commit comments