diff --git a/App/view/feadbackConcluido.py b/App/view/feadbackConcluido.py index 38ff806..7fd055e 100644 --- a/App/view/feadbackConcluido.py +++ b/App/view/feadbackConcluido.py @@ -1,9 +1,28 @@ from PyQt5.QtWidgets import QDialog from PyQt5.uic import loadUi +from PyQt5.QtCore import Qt, QPoint class FeadbackConcluido(QDialog): def __init__(self): super().__init__() - loadUi('App/view/ui/feadbackConcluido.ui',self) + loadUi('App/view/ui/feadbackConcluido.ui', self) - #label do aviso do Concluido = #texto \ No newline at end of file + # Variáveis para armazenar o estado da movimentação + self._is_dragging = False + self._start_pos = QPoint() + + def mousePressEvent(self, event): + if event.button() == Qt.LeftButton: + self._is_dragging = True + self._start_pos = event.globalPos() - self.frameGeometry().topLeft() + event.accept() + + def mouseMoveEvent(self, event): + if self._is_dragging and event.buttons() == Qt.LeftButton: + self.move(event.globalPos() - self._start_pos) + event.accept() + + def mouseReleaseEvent(self, event): + if event.button() == Qt.LeftButton: + self._is_dragging = False + event.accept() diff --git a/App/view/feadbackErro.py b/App/view/feadbackErro.py index 5a9d7e0..7d8ca60 100644 --- a/App/view/feadbackErro.py +++ b/App/view/feadbackErro.py @@ -1,41 +1,62 @@ from PyQt5.QtWidgets import QDialog from PyQt5.uic import loadUi -from PyQt5.QtCore import Qt +from PyQt5.QtCore import Qt, QPoint class FeadbackErro(QDialog): def __init__(self, txt): super().__init__() - loadUi('App/view/ui/feadbackErro.ui',self) + loadUi('App/view/ui/feadbackErro.ui', self) self.texto.setText(txt) # Remove a barra de título e as bordas da janela self.setWindowFlags(Qt.FramelessWindowHint) + # Variáveis para controle de movimentação + self._is_dragging = False + self._start_pos = QPoint() + + # Botões self.btnConfirmar.clicked.connect(self.reject) self.btnFechar.clicked.connect(self.reject) - + def mudarFoto(self, img): if img == 'Validado': self.setStyleSheet(""" #icon { - image: url(App/view/ui/icones/iconConcluido.png) + image: url(App/view/ui/icones/iconConcluido.png); } - """) + """) else: self.setStyleSheet(""" #icon { - image: url(App/view/ui/icones/iconErro.png) + image: url(App/view/ui/icones/iconErro.png); } - """) - - - + """) + + # Adiciona movimentação da janela + def mousePressEvent(self, event): + if event.button() == Qt.LeftButton: + self._is_dragging = True + self._start_pos = event.globalPos() - self.frameGeometry().topLeft() + event.accept() + + def mouseMoveEvent(self, event): + if self._is_dragging and event.buttons() == Qt.LeftButton: + self.move(event.globalPos() - self._start_pos) + event.accept() + + def mouseReleaseEvent(self, event): + if event.button() == Qt.LeftButton: + self._is_dragging = False + event.accept() + + if __name__ == "__main__": from PyQt5.QtWidgets import QApplication - resp = FeadbackErro('sla') + resp = FeadbackErro('Texto de exemplo') app = QApplication([]) if resp.exec_(): print('ok') else: - print('negado') \ No newline at end of file + print('negado') diff --git a/App/view/ui/cadastroCurso.ui b/App/view/ui/cadastroCurso.ui index 6dabd9e..67ed2cb 100644 --- a/App/view/ui/cadastroCurso.ui +++ b/App/view/ui/cadastroCurso.ui @@ -58,7 +58,7 @@ border-radius: 15px; - + @@ -66,6 +66,12 @@ border-radius: 15px; 0 + + + 793 + 486 + + QFrame::StyledPanel diff --git a/App/view/ui/cadastroPessoas.ui b/App/view/ui/cadastroPessoas.ui index 3efd4df..fb058f5 100644 --- a/App/view/ui/cadastroPessoas.ui +++ b/App/view/ui/cadastroPessoas.ui @@ -56,7 +56,7 @@ - + @@ -64,6 +64,12 @@ 0 + + + 762 + 479 + + QFrame::StyledPanel diff --git a/App/view/ui/cadastroSalas.ui b/App/view/ui/cadastroSalas.ui index aaf17ce..80d22f1 100644 --- a/App/view/ui/cadastroSalas.ui +++ b/App/view/ui/cadastroSalas.ui @@ -52,7 +52,7 @@ - + @@ -60,6 +60,12 @@ 0 + + + 801 + 340 + + QFrame::StyledPanel diff --git a/App/view/ui/editarCurso.ui b/App/view/ui/editarCurso.ui index 49476ca..ff9f2dc 100644 --- a/App/view/ui/editarCurso.ui +++ b/App/view/ui/editarCurso.ui @@ -85,7 +85,7 @@ - + @@ -93,6 +93,12 @@ 0 + + + 1056 + 642 + + QFrame::StyledPanel diff --git a/App/view/ui/editarLogin.ui b/App/view/ui/editarLogin.ui index a81800f..8144b95 100644 --- a/App/view/ui/editarLogin.ui +++ b/App/view/ui/editarLogin.ui @@ -51,7 +51,7 @@ - + @@ -59,6 +59,12 @@ 0 + + + 833 + 582 + + QFrame::StyledPanel diff --git a/App/view/ui/editarPessoa.ui b/App/view/ui/editarPessoa.ui index 02527e2..3de0dad 100644 --- a/App/view/ui/editarPessoa.ui +++ b/App/view/ui/editarPessoa.ui @@ -51,7 +51,7 @@ border-radius: 15px; - + @@ -59,6 +59,12 @@ border-radius: 15px; 0 + + + 803 + 566 + + QFrame::StyledPanel diff --git a/App/view/ui/editarReserva.ui b/App/view/ui/editarReserva.ui index a6a66d6..f4346c3 100644 --- a/App/view/ui/editarReserva.ui +++ b/App/view/ui/editarReserva.ui @@ -81,7 +81,7 @@ border-radius: 15px; - + @@ -89,6 +89,12 @@ border-radius: 15px; 0 + + + 1130 + 622 + + QFrame::StyledPanel diff --git a/App/view/ui/editarSalas.ui b/App/view/ui/editarSalas.ui index febe390..7c3c2ce 100644 --- a/App/view/ui/editarSalas.ui +++ b/App/view/ui/editarSalas.ui @@ -47,7 +47,7 @@ - + @@ -55,6 +55,12 @@ 0 + + + 794 + 314 + + QFrame::StyledPanel diff --git a/App/view/ui/reserva.ui b/App/view/ui/reserva.ui index 0799384..594aa75 100644 --- a/App/view/ui/reserva.ui +++ b/App/view/ui/reserva.ui @@ -85,7 +85,7 @@ - + @@ -93,6 +93,12 @@ 0 + + + 1106 + 642 + + QFrame::StyledPanel