Skip to content

Commit

Permalink
harbour-watchlist: ISSUE-105 : Add Option to display Capital Gain (WIP)
Browse files Browse the repository at this point in the history
* added configurable portfolio share row (for overview)
  • Loading branch information
andywuest committed Jun 8, 2023
1 parent f8b9b21 commit c5ef22d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
28 changes: 28 additions & 0 deletions qml/components/WatchlistView.qml
Expand Up @@ -299,6 +299,7 @@ SilicaFlickable {
height: firstRow.height + changeRow.height
/* + secondRow.height*/ + changeValuesRow.height
+ (watchlistSettings.showPerformanceRow ? performanceRow.height : 0)
+ (watchlistSettings.showPortfolioShareRow ? portfolioShareRow.height : 0)

anchors.verticalCenter: parent.verticalCenter

Expand Down Expand Up @@ -397,6 +398,33 @@ SilicaFlickable {
horizontalAlignment: Text.AlignRight
}
}

Row {
id: portfolioShareRow
width: parent.width
visible: watchlistSettings.showPortfolioShareRow
height: Theme.fontSizeExtraSmall + Theme.paddingSmall

Text {
width: parent.width / 2
height: parent.height
//: WatchlistView Portfolio share label
text: qsTr("Portfolio share")
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeExtraSmall
horizontalAlignment: Text.AlignLeft
}

Text {
width: parent.width / 2
height: parent.height
text: Functions.isNonNullValue(portfolioShare) ? Functions.renderPercentage(portfolioShare) : ''
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeExtraSmall
horizontalAlignment: Text.AlignRight
}
}

}
}

Expand Down
1 change: 1 addition & 0 deletions qml/harbour-watchlist.qml
Expand Up @@ -40,6 +40,7 @@ ApplicationWindow {
property int dataBackend: Constants.BACKEND_EUROINVESTOR
property int newsDataDownloadStrategy: Constants.NEWS_DATA_DOWNLOAD_STRATEGY_ONLY_ON_WIFI
property bool showPerformanceRow: false
property bool showPortfolioShareRow: false
property date dividendsDataLastUpdate
property bool showSecondWatchlist: false
property string firstWatchlistName: qsTr("Watchlist")
Expand Down
12 changes: 12 additions & 0 deletions qml/pages/SettingsPage.qml
Expand Up @@ -192,6 +192,18 @@ Page {
}
}

TextSwitch {
id: portfolioShareRowRowTextSwitch
//: SettingsPage show portfolio share row title
text: qsTr("Show portfolio share row")
//: SettingsPage show portfolio share row description
description: qsTr("Displays the portfolio share of the for a security. Portfolio share will only be calculated, if a reference price and the number of pieces were configured for the security.")
checked: watchlistSettings.showPortfolioShareRow
onCheckedChanged: {
watchlistSettings.showPortfolioShareRow = checked
}
}

ComboBox {
id: dataBackendComboBox
//: SettingsPage data backend for watchlist
Expand Down

0 comments on commit c5ef22d

Please sign in to comment.