Introduced the command line option '--small-screen' and a small screen detection method to choose the interface layout suitable for screen small than full HD. Added a section to the README file. eric7

Wed, 27 Oct 2021 20:03:03 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 27 Oct 2021 20:03:03 +0200
branch
eric7
changeset 8728
62b44a7c0a3a
parent 8727
e2f8a0fbf738
child 8729
226da2e26a84

Introduced the command line option '--small-screen' and a small screen detection method to choose the interface layout suitable for screen small than full HD. Added a section to the README file.

docs/README.rst file | annotate | diff | comparison | revisions
eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
eric7/eric7.py file | annotate | diff | comparison | revisions
--- a/docs/README.rst	Wed Oct 27 19:15:50 2021 +0200
+++ b/docs/README.rst	Wed Oct 27 20:03:03 2021 +0200
@@ -131,20 +131,31 @@
 Please take your time and go through all the configuration items.
 However, every configuration option has a meaningful default value.
 
-4. Running from the sources
+4. Using eric on devices with small displays
+--------------------------------------------
+eric can be used on devices with displays smaller than full HD as well
+(i.e. smaller than 1920 x 1080 pixels). If such a small screen is detected,
+the interface using sidebars with just the left sidebar is chosen
+automatically. This cannot be changed. If the auto-detection fails, use of
+the small screen layout can be forced by startin eric with the '--small-screen'
+command line option. This changes the respective settings available via the
+Interface ⇨ Interface configuration page (options 'Layout' and 'Combine left
+and right sidebar'.
+
+5. Running from the sources
 ---------------------------
 If you want to run eric7 from within the source tree you have to execute
 the ``compileUiFiles.py`` script once after a fresh checkout from the source
 repository or when new dialogs have been added. Thereafter just execute
 the ``eric7.py`` script.
 
-5. Tray starter
+6. Tray starter
 ---------------
 eric7 comes with a little utility called "eric7_tray". This embeds an icon
 in the system tray, which contains a context menu to start eric7 and all
 it's utilities. Double clicking this icon starts the eric7 IDE.
 
-6. Completions/Calltips
+7. Completions/Calltips
 -----------------------
 eric7 provides an interface to the QScintilla completion and call-tips
 functionality. QScintilla2 comes with API files for Python and itself. PyQt6
@@ -159,7 +170,7 @@
 Additional completions and call-tip providers are available through the eric7
 plug-in system. See below for details.
 
-7. Remote Debugger
+8. Remote Debugger
 ------------------
 In order to enable the remote debugger start eric7, open the preferences
 dialog and configure the settings on the debugger pages.
@@ -174,14 +185,14 @@
 To ease the installation process of the debug client, the eric7 sources
 include the script ``install-debugclients.py``.
 
-8. Passive Debugging
+9. Passive Debugging
 --------------------
 Passive debugging mode allows the startup of the debugger from outside
 of the IDE. The IDE waits for a connection attempt. For further details
 see the file README-passive-debugging.rst.
 
-9. Plug-in System
------------------
+10. Plug-in System
+------------------
 eric7 contains a plug-in system, that is used to extend eric7's 
 functionality. Some plug-ins are part of eric7. Additional plugins
 are available via the Internet. Please use the built-in plug-in
@@ -189,7 +200,7 @@
 and to download them. For more details about the plug-in system
 please see the documentation area.
 
-10. Interfaces to additional software packages
+11. Interfaces to additional software packages
 ----------------------------------------------
 At the moment eric7 provides interfaces to the following software
 packages.
@@ -248,7 +259,7 @@
         This is part of the standard Python distribution and is used to profile
         Python source code.
 
-11. Internationalization
+12. Internationalization
 ------------------------
 eric7 and its tools are prepared to show the UI in different languages, which
 can be configured via the preferences dialog. The Qt and QScintilla
@@ -259,19 +270,19 @@
 volunteer for this work please send me an email naming the country code and
 I will send you the respective Qt-Linguist file.
 
-12. Window Layout
+13. Window Layout
 -----------------
 eric7 provides a configurable window layout. The visibility of the various tool
 panes can be configured. The position of the shell pane may be configured as
 well.
 
-13. Source code documentation
+14. Source code documentation
 -----------------------------
 eric7 has a built in source code documentation generator, which is
 usable via the command line as well. For further details please see
 the file README-eric7-doc.rst.
 
-14. Included Tools
+15. Included Tools
 ------------------
 eric7 comes with a long list of tools. These can be started via the eric7
 tray starter or directly via the command line. They are available from within
@@ -378,14 +389,19 @@
 
     This is a standalone tool to execute existing unit tests.
 
-14. License
+  * **eric7_virtualenv**
+
+    This is a standalone tool to manage Python virtual environments. It is
+    like the integrated pane and offers the same functionality.
+
+16. License
 -----------
 eric7 (and the eric7 tools) is released under the conditions of the GPLv3. See 
 separate license file ``LICENSE.GPL3`` for more details. Third party software
 included in eric7 is released under their respective license and contained in
 the eric7 distribution for convenience. 
 
-15. Bugs and other reports
+17. Bugs and other reports
 --------------------------
 Please send bug reports, feature requests or contributions to eric bugs
 address. After the IDE is installed you can use the "Report Bug..."
--- a/eric7/UI/UserInterface.py	Wed Oct 27 19:15:50 2021 +0200
+++ b/eric7/UI/UserInterface.py	Wed Oct 27 20:03:03 2021 +0200
@@ -169,7 +169,7 @@
     
     def __init__(self, app, locale, splash, plugin, disabledPlugins,
                  noOpenAtStartup, noCrashOpenAtStartup, disableCrashSession,
-                 restartArguments, originalPathString):
+                 smallScreen, restartArguments, originalPathString):
         """
         Constructor
         
@@ -194,6 +194,9 @@
         @param disableCrashSession flag indicating to disable the crash session
             support
         @type bool
+        @param smallScreen flag indicating to use the interface for small
+            screens (i.e. smaller than 1920 x 1080)
+        @type bool
         @param restartArguments list of command line parameters to be used for
             a restart
         @type list of str
@@ -216,13 +219,23 @@
         
         self.__originalPathString = originalPathString
         
+        primaryScreenSize = app.primaryScreen().size()
+        if (
+            smallScreen or
+            primaryScreenSize.width() < 1920 or
+            primaryScreenSize.height() < 1080
+        ):
+            # override settings for small screens
+            Preferences.setUI("LayoutType", "Sidebars")
+            Preferences.setUI("CombinedLeftRightSidebar", True)
+        
         self.__layoutType = Preferences.getUI("LayoutType")
         
         self.passiveMode = Preferences.getDebugger("PassiveDbgEnabled")
         
         g = Preferences.getGeometry("MainGeometry")
         if g.isEmpty():
-            s = QSize(1280, 1024)
+            s = QSize(1280, 720)
             self.resize(s)
         else:
             self.restoreGeometry(g)
--- a/eric7/eric7.py	Wed Oct 27 19:15:50 2021 +0200
+++ b/eric7/eric7.py	Wed Oct 27 20:03:03 2021 +0200
@@ -266,6 +266,8 @@
          "load the given plugin file (plugin development)"),
         ("--settings=settingsDir",
          "use the given directory to store the settings files"),
+        ("--small-screen",
+         "adjust the interface for screens smaller than FHD"),
         ("--start-file", "load the most recently opened file"),
         ("--start-multi", "load the most recently opened multi-project"),
         ("--start-project", "load the most recently opened project"),
@@ -340,6 +342,7 @@
     nocrash = False
     disablecrash = False
     disabledPlugins = []
+    smallScreen = False
     if "--no-open" in sys.argv and sys.argv.index("--no-open") < ddindex:
         sys.argv.remove("--no-open")
         ddindex -= 1
@@ -355,6 +358,10 @@
         sys.argv.remove("--disable-crash")
         ddindex -= 1
         disablecrash = True
+    if "--small-screen" in sys.argv:
+        sys.argv.remove("--small-screen")
+        ddindex -= 1
+        smallScreen = True
     for arg in sys.argv[:]:
         if (
             arg.startswith("--disable-plugin=") and
@@ -401,8 +408,8 @@
     splash.showMessage(
         QCoreApplication.translate("eric7", "Generating Main Window..."))
     mainWindow = UserInterface(app, loc, splash, pluginFile, disabledPlugins,
-                               noopen, nocrash, disablecrash, restartArgs,
-                               originalPathString)
+                               noopen, nocrash, disablecrash, smallScreen,
+                               restartArgs, originalPathString)
     app.lastWindowClosed.connect(app.quit)
     mainWindow.show()
     

eric ide

mercurial