Repository: pyqtgraph/pyqtgraph

Issue:
ExportDialog Drawn Off Screen
Depending on the size of the scene the export dialog box can be drawn off or partially off screen. This is due to an implementation of the `show` command that allows moving the box to negative pixel indices.

Problem Code:
https://github.com/pyqtgraph/pyqtgraph/blob/a5f48ec5b58a10260195f1424309f7374a85ece7/pyqtgraph/GraphicsScene/exportDialog.py#L57-L62

To fix this, the position calculation can be clipped using `max`, and the `setGeometry` command can be changed to `move` to account for the size of the window's frame.

Potential Fix:
```python
        if not self.shown:
            self.shown = True
            vcenter = self.scene.getViewWidget().geometry().center()
            x = max(0, int(vcenter.x() - self.width() / 2))
            y = max(0, int(vcenter.y() - self.height() / 2))
            self.move(x, y)
```

I can't say I understand the motivation for moving the dialog box in the first place, but atleast with this modification the dialog box is always accessible with the mouse.


Discussion:
Hi, I am new to open source and would like to work on this issue
Would love your contribution to the library! Issue is all yours.
Thank you @j9ac9k. Is there a contribution guide as well?
> Thank you @j9ac9k. Is there a contribution guide as well?

We have a contributing guide here, most of the content is about creating a development environment, how to run the test suite, and things of that nature.

https://github.com/pyqtgraph/pyqtgraph/blob/master/CONTRIBUTING.md

For a change like this, you can submit your change and we'll give feedback on it if something is out of order/place
Thank you for the reply. I have started working on the issue but cannot view my changes on any of the export dialog boxes. Please help me in this regard 

Resolving patch:
diff --git a/pyqtgraph/GraphicsScene/exportDialog.py b/pyqtgraph/GraphicsScene/exportDialog.py
--- a/pyqtgraph/GraphicsScene/exportDialog.py
+++ b/pyqtgraph/GraphicsScene/exportDialog.py
@@ -49,13 +49,12 @@ def show(self, item=None):
         self.activateWindow()
         self.raise_()
         self.selectBox.setVisible(True)
-        
         if not self.shown:
             self.shown = True
             vcenter = self.scene.getViewWidget().geometry().center()
-            self.setGeometry(int(vcenter.x() - self.width() / 2),
-                             int(vcenter.y() - self.height() / 2),
-                             self.width(), self.height())
+            x = max(0, int(vcenter.x() - self.width() / 2))
+            y = max(0, int(vcenter.y() - self.height() / 2))
+            self.move(x, y)
         
     def updateItemList(self, select=None):
         self.ui.itemTree.clear()
diff --git a/pyqtgraph/GraphicsScene/exportDialogTemplate_generic.py b/pyqtgraph/GraphicsScene/exportDialogTemplate_generic.py
--- a/pyqtgraph/GraphicsScene/exportDialogTemplate_generic.py
+++ b/pyqtgraph/GraphicsScene/exportDialogTemplate_generic.py
@@ -5,7 +5,6 @@
 # WARNING: Any manual changes made to this file will be lost when pyuic6 is
 # run again.  Do not edit this file unless you know what you are doing.
 
-
 from ..Qt import QtCore, QtGui, QtWidgets
 
 


Test patch: