Changed the button layout of the Plugin Repository widget. eric7

Sun, 26 Sep 2021 20:04:58 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 26 Sep 2021 20:04:58 +0200
branch
eric7
changeset 8644
4a84adb1216a
parent 8643
5adf87ac0c3e
child 8645
67eb147b3531

Changed the button layout of the Plugin Repository widget.

eric7/PluginManager/PluginRepositoryDialog.py file | annotate | diff | comparison | revisions
eric7/icons/breeze-dark/cancel.svg file | annotate | diff | comparison | revisions
eric7/icons/breeze-dark/downloadPlus.svg file | annotate | diff | comparison | revisions
eric7/icons/breeze-light/cancel.svg file | annotate | diff | comparison | revisions
eric7/icons/breeze-light/downloadPlus.svg file | annotate | diff | comparison | revisions
eric7/icons/oxygen/cancel.png file | annotate | diff | comparison | revisions
eric7/icons/oxygen/downloadPlus.png file | annotate | diff | comparison | revisions
--- a/eric7/PluginManager/PluginRepositoryDialog.py	Sun Sep 26 18:15:37 2021 +0200
+++ b/eric7/PluginManager/PluginRepositoryDialog.py	Sun Sep 26 20:04:58 2021 +0200
@@ -19,7 +19,7 @@
 )
 from PyQt6.QtWidgets import (
     QWidget, QDialogButtonBox, QAbstractButton, QTreeWidgetItem, QDialog,
-    QVBoxLayout, QMenu, QLabel
+    QVBoxLayout, QHBoxLayout, QMenu, QLabel, QToolButton
 )
 from PyQt6.QtNetwork import (
     QNetworkAccessManager, QNetworkRequest, QNetworkReply, QNetworkInformation
@@ -96,27 +96,70 @@
         if integrated:
             self.layout().setContentsMargins(0, 3, 0, 0)
         
-        self.__updateButton = self.buttonBox.addButton(
-            self.tr("Update"), QDialogButtonBox.ButtonRole.ActionRole)
-        self.__downloadButton = self.buttonBox.addButton(
-            self.tr("Download"), QDialogButtonBox.ButtonRole.ActionRole)
+        if self.__integratedWidget:
+            self.__actionButtonsLayout = QHBoxLayout()
+            self.__actionButtonsLayout.addStretch()
+            
+            self.__updateButton = QToolButton(self)
+            self.__updateButton.setIcon(UI.PixmapCache.getIcon("reload"))
+            self.__updateButton.setToolTip(self.tr("Update"))
+            self.__updateButton.clicked.connect(self.updateList)
+            self.__actionButtonsLayout.addWidget(self.__updateButton)
+            
+            self.__downloadButton = QToolButton(self)
+            self.__downloadButton.setIcon(UI.PixmapCache.getIcon("download"))
+            self.__downloadButton.setToolTip(self.tr("Download"))
+            self.__updateButton.clicked.connect(self.__downloadButtonClicked)
+            self.__actionButtonsLayout.addWidget(self.__downloadButton)
+            
+            self.__downloadInstallButton = QToolButton(self)
+            self.__downloadInstallButton.setIcon(
+                UI.PixmapCache.getIcon("downloadPlus"))
+            self.__downloadInstallButton.setToolTip(
+                self.tr("Download && Install"))
+            self.__downloadInstallButton.clicked.connect(
+                self.__downloadInstallButtonClicked)
+            self.__actionButtonsLayout.addWidget(self.__downloadInstallButton)
+            
+            self.__downloadCancelButton = QToolButton(self)
+            self.__downloadCancelButton.setIcon(
+                UI.PixmapCache.getIcon("cancel"))
+            self.__downloadCancelButton.setToolTip(self.tr("Cancel"))
+            self.__downloadCancelButton.clicked.connect(self.__downloadCancel)
+            self.__actionButtonsLayout.addWidget(self.__downloadCancelButton)
+            
+            self.__installButton = QToolButton(self)
+            self.__installButton.setIcon(UI.PixmapCache.getIcon("plus"))
+            self.__installButton.setToolTip(self.tr("Install"))
+            self.__installButton.clicked.connect(self.__closeAndInstall)
+            self.__actionButtonsLayout.addWidget(self.__installButton)
+            
+            self.__actionButtonsLayout.addStretch()
+            
+            self.layout().addLayout(self.__actionButtonsLayout)
+            self.buttonBox.hide()
+        else:
+            self.__updateButton = self.buttonBox.addButton(
+                self.tr("Update"), QDialogButtonBox.ButtonRole.ActionRole)
+            self.__downloadButton = self.buttonBox.addButton(
+                self.tr("Download"), QDialogButtonBox.ButtonRole.ActionRole)
+            self.__downloadInstallButton = self.buttonBox.addButton(
+                self.tr("Download && Install"),
+                QDialogButtonBox.ButtonRole.ActionRole)
+            self.__downloadCancelButton = self.buttonBox.addButton(
+                self.tr("Cancel"), QDialogButtonBox.ButtonRole.ActionRole)
+            self.__installButton = self.buttonBox.addButton(
+                self.tr("Close && Install"),
+                QDialogButtonBox.ButtonRole.ActionRole)
+            if not self.__integratedWidget:
+                self.__closeButton = self.buttonBox.addButton(
+                    self.tr("Close"), QDialogButtonBox.ButtonRole.RejectRole)
+                self.__closeButton.setEnabled(True)
+        
         self.__downloadButton.setEnabled(False)
-        self.__downloadInstallButton = self.buttonBox.addButton(
-            self.tr("Download && Install"),
-            QDialogButtonBox.ButtonRole.ActionRole)
         self.__downloadInstallButton.setEnabled(False)
-        self.__downloadCancelButton = self.buttonBox.addButton(
-            self.tr("Cancel"), QDialogButtonBox.ButtonRole.ActionRole)
         self.__downloadCancelButton.setEnabled(False)
-        self.__installButton = self.buttonBox.addButton(
-            self.tr("Install") if self.__integratedWidget else
-            self.tr("Close && Install"),
-            QDialogButtonBox.ButtonRole.ActionRole)
         self.__installButton.setEnabled(False)
-        if not self.__integratedWidget:
-            self.__closeButton = self.buttonBox.addButton(
-                self.tr("Close"), QDialogButtonBox.ButtonRole.RejectRole)
-            self.__closeButton.setEnabled(True)
         
         self.repositoryUrlEdit.setText(
             Preferences.getUI("PluginRepositoryUrl7"))
@@ -159,7 +202,7 @@
         ):
             self.__reachabilityChanged(
                 QNetworkInformation.instance().reachability())
-            # TODO: remove this 'contextlib' with official relelase
+            # TODO: remove this 'contextlib' with official release
             import contextlib
             with contextlib.suppress(Exception):
                 QNetworkInformation.instance().reachabilityChanged.connect(
@@ -209,17 +252,31 @@
         if button == self.__updateButton:
             self.updateList()
         elif button == self.__downloadButton:
-            self.__isDownloadInstall = False
-            self.__downloadPlugins()
+            self.__downloadButtonClicked()
         elif button == self.__downloadInstallButton:
-            self.__isDownloadInstall = True
-            self.__allDownloadedOk = True
-            self.__downloadPlugins()
+            self.__downloadInstallButtonClicked()
         elif button == self.__downloadCancelButton:
             self.__downloadCancel()
         elif button == self.__installButton:
             self.__closeAndInstall()
     
+    @pyqtSlot()
+    def __downloadButtonClicked(self):
+        """
+        Private slot to handle a click of the Download button.
+        """
+        self.__isDownloadInstall = False
+        self.__downloadPlugins()
+    
+    @pyqtSlot()
+    def __downloadInstallButtonClicked(self):
+        """
+        Private slot to handle a click of the Download & Install button.
+        """
+        self.__isDownloadInstall = True
+        self.__allDownloadedOk = True
+        self.__downloadPlugins()
+    
     def __formatDescription(self, lines):
         """
         Private method to format the description.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/icons/breeze-dark/cancel.svg	Sun Sep 26 20:04:58 2021 +0200
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   viewBox="0 0 22 22"
+   version="1.1"
+   id="svg6"
+   sodipodi:docname="cancel.svg"
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
+  <metadata
+     id="metadata10">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1683"
+     inkscape:window-height="1047"
+     id="namedview8"
+     showgrid="false"
+     inkscape:zoom="32.5"
+     inkscape:cx="11"
+     inkscape:cy="11"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg6" />
+  <defs
+     id="defs3051">
+    <style
+       type="text/css"
+       id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#eff0f1;
+      }
+      </style>
+  </defs>
+  <path
+     style="fill:currentColor;fill-opacity:1;stroke:none;stroke-width:1.25"
+     d="M 11,1 C 8.4655025,1 6.16085,1.9458675 4.3984375,3.5 4.2406388,3.63915 4.0784,3.780975 3.9296875,3.9296875 L 3.5,4.3984375 C 1.9458675,6.16085 1,8.4655025 1,11 c 0,5.52285 4.47715,10 10,10 2.534497,0 4.83915,-0.945867 6.601562,-2.5 l 0.46875,-0.429688 C 18.219025,17.9216 18.36085,17.759361 18.5,17.601562 20.054133,15.83915 21,13.534497 21,11 21,5.47715 16.52285,1 11,1 m 0,1.25 c 4.832487,0 8.75,3.9175125 8.75,8.75 0,2.192075 -0.816519,4.167835 -2.148438,5.703125 L 5.296875,4.3984375 C 6.8321638,3.0665187 8.807925,2.25 11,2.25 M 4.3984375,5.296875 16.703125,17.601562 C 15.167835,18.933481 13.192075,19.75 11,19.75 6.1675125,19.75 2.25,15.832487 2.25,11 2.25,8.807925 3.0665187,6.8321638 4.3984375,5.296875"
+     class="ColorScheme-Text"
+     id="path4" />
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/icons/breeze-dark/downloadPlus.svg	Sun Sep 26 20:04:58 2021 +0200
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   viewBox="0 0 22 22"
+   id="svg8"
+   sodipodi:docname="downloadPlus.svg"
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
+  <metadata
+     id="metadata12">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1427"
+     inkscape:window-height="925"
+     id="namedview10"
+     showgrid="false"
+     inkscape:zoom="32.5"
+     inkscape:cx="11"
+     inkscape:cy="11"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg8"
+     inkscape:document-rotation="0" />
+  <defs
+     id="defs4">
+    <style
+       type="text/css"
+       id="style2">.ColorScheme-Text {
+        color:#eff0f1;
+      }</style>
+  </defs>
+  <path
+     class="ColorScheme-Text"
+     d="M 4.1428222,1 V 5.5 H 4.9285278 V 1.75 H 8.0714111 V 5.5 H 8.8571167 V 1 H 4.9285278 Z M 2.4087333,6.25 1.7857056,6.8623 6.5,11.5 11.214294,6.8623 10.591267,6.25 6.5,10.2754 Z M 1,11.5 V 13 h 11 v -1.5 h -0.785706 v 0.75 H 1.7854611 V 11.5 Z"
+     color="#eff0f1"
+     fill="#232629"
+     id="path6"
+     style="stroke-width:0.60553;fill:#eff0f1;fill-opacity:1" />
+  <path
+     class="ColorScheme-Text"
+     d="m 15.133333,10 v 5.133333 H 10 v 0.733334 h 5.133333 V 21 h 0.733334 V 15.866667 H 21 V 15.133333 H 15.866667 V 10 Z"
+     fill="currentColor"
+     id="path6-3"
+     style="color:#232629;fill:#eff0f1;fill-opacity:1;stroke-width:0.733334;stroke:#eff0f1;stroke-opacity:1" />
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/icons/breeze-light/cancel.svg	Sun Sep 26 20:04:58 2021 +0200
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   viewBox="0 0 22 22"
+   version="1.1"
+   id="svg6"
+   sodipodi:docname="cancel.svg"
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
+  <metadata
+     id="metadata10">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1464"
+     inkscape:window-height="947"
+     id="namedview8"
+     showgrid="false"
+     inkscape:zoom="32.5"
+     inkscape:cx="11"
+     inkscape:cy="11"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg6" />
+  <defs
+     id="defs3051">
+    <style
+       type="text/css"
+       id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#232629;
+      }
+      </style>
+  </defs>
+  <path
+     style="fill:currentColor;fill-opacity:1;stroke:none;stroke-width:1.25"
+     d="M 11,1 C 8.4655025,1 6.16085,1.9458675 4.3984375,3.5 4.2406388,3.63915 4.0784,3.780975 3.9296875,3.9296875 L 3.5,4.3984375 C 1.9458675,6.16085 1,8.4655025 1,11 c 0,5.52285 4.47715,10 10,10 2.534497,0 4.83915,-0.945867 6.601562,-2.5 l 0.46875,-0.429688 C 18.219025,17.9216 18.36085,17.759361 18.5,17.601562 20.054133,15.83915 21,13.534497 21,11 21,5.47715 16.52285,1 11,1 m 0,1.25 c 4.832487,0 8.75,3.9175125 8.75,8.75 0,2.192075 -0.816519,4.167835 -2.148438,5.703125 L 5.296875,4.3984375 C 6.8321638,3.0665187 8.807925,2.25 11,2.25 M 4.3984375,5.296875 16.703125,17.601562 C 15.167835,18.933481 13.192075,19.75 11,19.75 6.1675125,19.75 2.25,15.832487 2.25,11 2.25,8.807925 3.0665187,6.8321638 4.3984375,5.296875"
+     class="ColorScheme-Text"
+     id="path4" />
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/icons/breeze-light/downloadPlus.svg	Sun Sep 26 20:04:58 2021 +0200
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   viewBox="0 0 22 22"
+   id="svg8"
+   sodipodi:docname="downloadPlus.svg"
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
+  <metadata
+     id="metadata12">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1732"
+     inkscape:window-height="1132"
+     id="namedview10"
+     showgrid="false"
+     inkscape:zoom="32.5"
+     inkscape:cx="11"
+     inkscape:cy="11"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg8"
+     inkscape:document-rotation="0" />
+  <defs
+     id="defs4">
+    <style
+       type="text/css"
+       id="style2">.ColorScheme-Text {
+        color:#eff0f1;
+      }</style>
+  </defs>
+  <path
+     class="ColorScheme-Text"
+     d="M 4.1428222,1 V 5.5 H 4.9285278 V 1.75 H 8.0714111 V 5.5 H 8.8571167 V 1 H 4.9285278 Z M 2.4087333,6.25 1.7857056,6.8623 6.5,11.5 11.214294,6.8623 10.591267,6.25 6.5,10.2754 Z M 1,11.5 V 13 h 11 v -1.5 h -0.785706 v 0.75 H 1.7854611 V 11.5 Z"
+     color="#eff0f1"
+     fill="#232629"
+     id="path6"
+     style="stroke-width:0.60553;stroke:none;stroke-opacity:1" />
+  <path
+     class="ColorScheme-Text"
+     d="m 15.13125,9.96875 v 5.1625 h -5.1625 v 0.7375 h 5.1625 v 5.1625 h 0.7375 v -5.1625 h 5.1625 v -0.7375 h -5.1625 v -5.1625 z"
+     fill="currentColor"
+     id="path6-3"
+     style="color:#232629;stroke:#232629;stroke-width:0.7375;stroke-opacity:1" />
+</svg>
Binary file eric7/icons/oxygen/cancel.png has changed
Binary file eric7/icons/oxygen/downloadPlus.png has changed

eric ide

mercurial