src/eric7/EricWidgets/EricApplication.py

branch
eric7
changeset 10303
ee1aadab1215
parent 9995
00eb2b418f8e
child 10417
c6011e501282
diff -r 8cb0dabf852f -r ee1aadab1215 src/eric7/EricWidgets/EricApplication.py
--- a/src/eric7/EricWidgets/EricApplication.py	Sat Nov 11 10:13:29 2023 +0100
+++ b/src/eric7/EricWidgets/EricApplication.py	Sat Nov 11 12:44:51 2023 +0100
@@ -9,6 +9,7 @@
 
 import contextlib
 import os
+import sys
 
 from PyQt6.QtCore import QCoreApplication, Qt
 from PyQt6.QtGui import QColor, QPalette
@@ -45,14 +46,14 @@
         "link-visited": QPalette.ColorRole.LinkVisited,
     }
 
-    def __init__(self, argv):
+    def __init__(self, args):
         """
         Constructor
 
-        @param argv command line arguments
-        @type list
+        @param args namespace object containing the parsed command line parameters
+        @type argparse.Namespace
         """
-        super().__init__(argv)
+        super().__init__(sys.argv)
 
         QCoreApplication.setAttribute(
             Qt.ApplicationAttribute.AA_DontCreateNativeWidgetSiblings, True
@@ -61,10 +62,10 @@
         self.__objectRegistry = {}
         self.__pluginObjectRegistry = {}
 
-        self.__smallScreen = False
-        if "--small-screen" in argv:
-            self.__smallScreen = True
-            argv.remove("--small-screen")
+        try:
+            self.__smallScreen = args.small_screen
+        except AttributeError:
+            self.__smallScreen = False
         if not self.__smallScreen:
             primaryScreenSize = self.primaryScreen().size()
             self.__smallScreen = (

eric ide

mercurial