Skip to content

Commit 657ee8a

Browse files
committed
try to center indicator window EMA/SMA
1 parent a38b857 commit 657ee8a

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

indicatorParametersUI.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,24 @@ def __init__(self, parent = None):
1818
self.parameterLayout = self.findChild(QtWidgets.QFormLayout, "parameterLayout")
1919

2020
# Move at the center of the window
21-
x = int(parent.sizeHint().width() / 2 - self.sizeHint().width())
22-
y = int(parent.sizeHint().height() / 2 - self.sizeHint().height())
21+
#x = int(parent.sizeHint().width() / 2 - self.sizeHint().width())
22+
#y = int(parent.sizeHint().height() / 2 - self.sizeHint().height())
2323

24-
self.move( x, y )
24+
#self.move( x, y )
25+
pw = parent.sizeHint().width()
26+
ph = parent.sizeHint().height()
27+
28+
px = parent.x()
29+
py = parent.y()
30+
31+
myH = self.height()
32+
33+
self.move( parent.sizeHint().width() - (self.width() / 2), (parent.sizeHint().height() / 2) - (self.height() / 2))
2534

2635
self.layout().setSizeConstraint( QtWidgets.QLayout.SetFixedSize )
2736

37+
self.setStyleSheet("border: solid 1px #FFF")
38+
2839
pass
2940

3041
def setTitle(self, title):

userInterface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ def resetChart(self):
638638
def addSma(self):
639639

640640
# Show indicator parameter dialog
641-
paramDialog = indicatorParametersUI.IndicatorParametersUI(self.dock_charts[self.current_timeframe])
641+
paramDialog = indicatorParametersUI.IndicatorParametersUI(self.win)
642642
paramDialog.setWindowFlags(QtCore.Qt.CustomizeWindowHint)
643643
paramDialog.setTitle("SMA Indicator parameters")
644644
paramDialog.addParameter("SMA Period", 14)
@@ -654,7 +654,7 @@ def addSma(self):
654654
def addEma(self):
655655

656656
# Show indicator parameter dialog
657-
paramDialog = indicatorParametersUI.IndicatorParametersUI(self.dock_charts[self.current_timeframe])
657+
paramDialog = indicatorParametersUI.IndicatorParametersUI(self.win)
658658
paramDialog.setWindowFlags(QtCore.Qt.CustomizeWindowHint)
659659
paramDialog.setTitle("EMA Indicator parameters")
660660
paramDialog.addParameter("EMA Period", 9)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy