Skip to content

Commit

Permalink
locked transaction widget size to 450
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelHub committed Feb 14, 2021
1 parent 6d0d639 commit 6a01854
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pages/summary_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def format_and_dislay_text(self, trades_dict):
if trades_dict['buy_trades'][1]['index'] < trades_dict['sell_trades'][1]['index']: #first trans is buy
# formatted_trades += 'Traded'
for x in range(len(trades_dict['sell_trades'])-1):
formatted_trades += '-------------------------------------------------------------------------\n'
formatted_trades += '----------------------------------------------------------------------------\n'
formatted_trades += '{}) BOUGHT {} for price {}\n' \
.format(trades_dict['buy_trades'][x+1]['index'],
trades_dict['buy_trades'][x+1]['amount_traded'],
Expand All @@ -38,20 +38,19 @@ def format_and_dislay_text(self, trades_dict):
trades_dict['sell_trades'][x+1]['amount_traded'],
trades_dict['sell_trades'][x+1]['price'])
formatted_trades += '#PROFIT: {}\n' \
.format(
trades_dict['sell_trades'][x+1]['currency_2'] - trades_dict['sell_trades'][x]['currency_2']
- trades_dict['sell_trades'][x]['currency_1'] * trades_dict['sell_trades'][x]['price'])
.format(trades_dict['sell_trades'][x+1]['currency_2'] - trades_dict['sell_trades'][x]['currency_2']
- trades_dict['sell_trades'][x]['currency_1'] * trades_dict['sell_trades'][x]['price'])
else: #first trans is sell
formatted_trades += '-------------------------------------------------------------------------\n'
formatted_trades += '----------------------------------------------------------------------------\n'
formatted_trades += '{}) SOLD {} for price {}\n'\
.format(trades_dict['sell_trades'][1]['index'],
trades_dict['sell_trades'][1]['amount_traded'],
trades_dict['sell_trades'][1]['price'])
formatted_trades += '#PROFIT: {}\n'\
.format(trades_dict['sell_trades'][1]['currency_2'] - trades_dict['sell_trades'][0]['currency_2']
- trades_dict['sell_trades'][0]['currency_1'] * trades_dict['sell_trades'][0]['price'])
- trades_dict['sell_trades'][0]['currency_1'] * trades_dict['sell_trades'][0]['price'])
for x in range(len(trades_dict['sell_trades'])-2):
formatted_trades += '-------------------------------------------------------------------------\n'
formatted_trades += '----------------------------------------------------------------------------\n'
formatted_trades += '{}) BOUGHT {} for price {}\n'\
.format(trades_dict['buy_trades'][x+1]['index'],
trades_dict['buy_trades'][x+1]['amount_traded'],
Expand All @@ -62,7 +61,7 @@ def format_and_dislay_text(self, trades_dict):
trades_dict['sell_trades'][x+2]['price'])
formatted_trades += '#PROFIT: {}\n'\
.format(trades_dict['sell_trades'][x+2]['currency_2'] - trades_dict['sell_trades'][x+1]['currency_2']
- trades_dict['sell_trades'][x+1]['currency_1'] * trades_dict['sell_trades'][x+1]['price'])
- trades_dict['sell_trades'][x+1]['currency_1'] * trades_dict['sell_trades'][x+1]['price'])
self.textBrowser.setText(formatted_trades)


Expand Down
24 changes: 24 additions & 0 deletions ui/summary_page.ui
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
</property>
<item>
<widget class="QWidget" name="widget_2" native="true">
<property name="minimumSize">
<size>
<width>450</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>450</width>
<height>16777215</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
Expand Down Expand Up @@ -134,6 +146,18 @@ border-radius: 10px;</string>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">font: 10pt &quot;MS Shell Dlg 2&quot;;
border-radius: 10px;
Expand Down

0 comments on commit 6a01854

Please sign in to comment.