feat(market): per-group configurable price data
Each portfolio group can now configure how it is valued and which price fields its card shows: - Price basis: Market · USD, Market · BTC, DRGX only, or Manual (a custom price-per-DRGX + currency label). Manual mode values the group independently of the live DRGX market price. - Field toggles: show DRGX amount / show value / show 24h change (24h enabled only for the live-market bases; value disabled for DRGX-only). - The editor's left "Appearance" column gains a Price section (basis combo, manual price + currency inputs, field checkboxes); the live preview and the group cards both render through one pfBuildDisplay() helper so they stay in sync. Defaults preserve the prior behavior (DRGX + USD). Persisted in settings.json (price_basis / manual_price / manual_currency / show_drgx / show_value / show_24h). Note: "price source per exchange/pair" is limited to USD/BTC/Manual — the app only fetches the aggregate DRGX price (USD + BTC); ExchangePair carries no price, so valuing against an arbitrary pair's live price would need a new market fetch (can be added separately). Full-node + Lite build clean; ctest 1/1; hygiene clean. Rendering change — needs a screenshot check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -80,6 +80,15 @@ public:
|
||||
std::vector<std::string> addresses;
|
||||
std::string icon; // project_icons wallet-icon name; empty = no icon
|
||||
unsigned int color = 0; // packed IM_COL32 accent; 0 = theme default
|
||||
// Per-group price data. priceBasis: 0 = live market (USD), 1 = live market (BTC),
|
||||
// 2 = DRGX only (no fiat value), 3 = manual price. Defaults preserve prior behavior
|
||||
// (show DRGX + USD value).
|
||||
int priceBasis = 0;
|
||||
double manualPrice = 0.0; // price per DRGX for the Manual basis
|
||||
std::string manualCurrency = "USD";
|
||||
bool showDrgx = true; // show the DRGX amount on the card
|
||||
bool showValue = true; // show the converted/fiat value on the card
|
||||
bool show24h = false; // show the 24h % change (live-market bases only)
|
||||
};
|
||||
|
||||
// Theme
|
||||
|
||||
Reference in New Issue
Block a user