src/eric7/QScintilla/EditorAssembly.py

branch
eric7
changeset 10849
78d338b6d89f
parent 10832
479cf39ac9cb
child 10880
2d2dd2c638e8
diff -r 328c9a177c64 -r 78d338b6d89f src/eric7/QScintilla/EditorAssembly.py
--- a/src/eric7/QScintilla/EditorAssembly.py	Mon Jul 15 16:40:23 2024 +0200
+++ b/src/eric7/QScintilla/EditorAssembly.py	Tue Jul 16 15:14:23 2024 +0200
@@ -10,8 +10,8 @@
 
 import contextlib
 
-from PyQt6.QtCore import QTimer
-from PyQt6.QtWidgets import QComboBox, QGridLayout, QWidget
+from PyQt6.QtCore import Qt, QTimer
+from PyQt6.QtWidgets import QComboBox, QGridLayout, QSplitter, QWidget
 
 from eric7 import Preferences
 from eric7.EricGui import EricPixmapCache
@@ -59,7 +59,15 @@
             "SourceOutlineListContentsByOccurrence"
         )
 
-        self.__editor = Editor(dbs, fn, vm, filetype, editor, tv)
+        self.__editor = Editor(
+            dbs=dbs,
+            fn=fn,
+            vm=vm,
+            filetype=filetype,
+            editor=editor,
+            tv=tv,
+            assembly=self,
+        )
         self.__buttonsWidget = EditorButtonsWidget(self.__editor, self)
         self.__globalsCombo = QComboBox()
         self.__globalsCombo.setDuplicatesEnabled(True)
@@ -68,15 +76,15 @@
         self.__sourceOutline = EditorOutlineView(
             self.__editor, populate=self.__showOutline
         )
-        self.__sourceOutline.setMaximumWidth(
-            Preferences.getEditor("SourceOutlineWidth")
-        )
+        self.__editorSplitter = QSplitter(Qt.Orientation.Horizontal)
+        self.__editorSplitter.setChildrenCollapsible(False)
+        self.__editorSplitter.addWidget(self.__editor)
+        self.__editorSplitter.addWidget(self.__sourceOutline)
 
         self.__layout.addWidget(self.__buttonsWidget, 1, 0, -1, 1)
         self.__layout.addWidget(self.__globalsCombo, 0, 1)
         self.__layout.addWidget(self.__membersCombo, 0, 2)
-        self.__layout.addWidget(self.__editor, 1, 1, 1, 2)
-        self.__layout.addWidget(self.__sourceOutline, 0, 3, -1, -1)
+        self.__layout.addWidget(self.__editorSplitter, 1, 1, 1, 2)
 
         self.setFocusProxy(self.__editor)
 
@@ -101,6 +109,16 @@
             self.__preferencesChanged
         )
 
+    def finishSetup(self):
+        """
+        Public method to finish the setup of the assembly.
+        """
+        splitterWidth = (
+            self.__editorSplitter.width() - self.__editorSplitter.handleWidth()
+        )
+        outlineWidth = Preferences.getEditor("SourceOutlineWidth")
+        self.__editorSplitter.setSizes([splitterWidth - outlineWidth, outlineWidth])
+
     def aboutToBeClosed(self):
         """
         Public method to stop and disconnect the timer and disconnect some signals.
@@ -145,6 +163,8 @@
             self.__activateOutline(self.__showNavigator and self.__showOutline)
             self.__activateCombos(self.__showNavigator and not self.__showOutline)
 
+        self.finishSetup()
+
     #######################################################################
     ## Methods dealing with the navigation combos below
     #######################################################################

eric ide

mercurial