88from actions .edit_actions import EditActionsMixin
99from actions .file_actions import FileActionsMixin
1010
11- # class MarkdownEditor(QMainWindow, EditActionsMixin, FileActionsMixin):
1211class MarkdownEditor (MainWindow , EditActionsMixin , FileActionsMixin ):
1312
1413 def __init__ (self , file_to_open = None ):
@@ -39,41 +38,6 @@ def connect_buttons(self):
3938 self .ui .minimize_btn .clicked .connect (lambda : self .showMinimized ())
4039 self .ui .maxmize_btn .clicked .connect (lambda : self .toggle_maximize_restore ())
4140
42- # def restore_or_maximize(self):
43- # self.showNormal() if self.isMaximized() else self.showMaximized()
44-
45- # def mousePressEvent(self, event):
46- # if event.button() == Qt.LeftButton and not self.isMaximized():
47- # # Verifica se o clique foi na área permitida para arrastar (ex.: barra de título)
48- # if self.is_draggable_area(event.position().toPoint()):
49- # self._mousePressPos = event.globalPosition().toPoint()
50- # self._windowPos = self.pos()
51- # super().mousePressEvent(event)
52-
53- # def is_draggable_area(self, pos):
54- # # Define a área onde a janela pode ser arrastada (ex.: barra de título)
55- # # Ajuste conforme o layout da sua UI
56- # title_bar_height = 40 # Altura da barra de título (ajuste conforme necessário)
57- # return pos.y() < title_bar_height and pos.x() < self.width()
58-
59- # # def mouseMoveEvent(self, event):
60- # # if self._mousePressPos is not None:
61- # # self.move(self.geometry().topLeft() + event.position().toPoint() - self._mousePressPos)
62- # def mouseMoveEvent(self, event):
63- # # Move a janela apenas se o arrastar foi iniciado
64- # if self._mousePressPos is not None:
65- # global_pos = event.globalPosition().toPoint()
66- # delta = global_pos - self._mousePressPos
67- # self.move(self._windowPos + delta)
68- # super().mouseMoveEvent(event)
69- # # def mouseMoveEvent(self, event):
70- # # # Move a janela com base na posição do mouse
71- # # if self._mousePressPos is not None:
72- # # self.move(self.pos() +event.position().toPoint() - self._mousePressPos)
73-
74- # def mouseReleaseEvent(self, event):
75- # self._mousePressPos = None
76-
7741 def keyPressEvent (self , event ):
7842 if event .type () == QEvent .KeyPress :
7943 match (event .key (), event .modifiers ()):
@@ -87,7 +51,6 @@ def keyPressEvent(self, event):
8751 case (Qt .Key_J , Qt .ControlModifier ): self .removeSyntaxAndHint ()
8852 super ().keyPressEvent (event )
8953
90-
9154 def onTabChange (self , index ):
9255 self .ui .editArea = self .getCurrentTextEdit (index )
9356 if (self .ui .editArea is not None ):
@@ -130,7 +93,6 @@ def inteliComplete(self):
13093
13194 ##cursor.movePosition(QtGui.QTextCursor.StartOfLine, QtGui.QTextCursor.MoveAnchor)
13295 self .ui .editArea .setTextCursor (cursor )
133-
13496
13597 def getCurrentTextEdit (self , current_index ):
13698 """Recupera o QTextEdit da aba atualmente selecionada"""
0 commit comments