diff --git a/src/config/settings.h b/src/config/settings.h index 02534b6..214c2eb 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -97,7 +97,7 @@ public: int gridCol = -1; int gridRow = -1; int gridW = 6; - int gridH = 3; // minimum group height (cells); card design adapts below ~4 + int gridH = 3; // default group height (cells); minimum is 2, card design adapts }; // Theme diff --git a/src/ui/windows/market_tab.cpp b/src/ui/windows/market_tab.cpp index b99a09d..6e5c3c0 100644 --- a/src/ui/windows/market_tab.cpp +++ b/src/ui/windows/market_tab.cpp @@ -891,7 +891,7 @@ void RenderMarketTab(App* app) // this grid and span many cells; they're drawn with an inner inset so adjacent cards don't touch. float pfCardGap = 0.0f; // gapless cell grid float pfInset = 3.0f * mktDp; // per-card inset for visual separation - const int pfMinW = 4, pfMinH = 3; // minimum card size in cells (~128x96) + const int pfMinW = 4, pfMinH = 2; // minimum card size in cells (~128x64) int pfCols = std::max(pfMinW, (int)(availWidth / (32.0f * mktDp))); float pfCellW = availWidth / (float)pfCols; // square cell edge (>= ~32px) float pfCellH = pfCellW; @@ -1168,7 +1168,8 @@ void RenderMarketTab(App* app) dl->AddLine(ImVec2(plotLeft, gy), ImVec2(plotRight, gy), IM_COL32(255, 255, 255, 12), 1.0f); double labelVal = yMax - (yMax - yMin) * (double)g / 4.0; - snprintf(buf, sizeof(buf), "$%.6f", labelVal); + // Adaptive precision (via the shared price formatter) — cleaner than a fixed 6 decimals. + snprintf(buf, sizeof(buf), "%s", FormatPrice(labelVal).c_str()); ImVec2 labelSz = capFont->CalcTextSizeA(capFont->LegacySize, FLT_MAX, 0, buf); // Keep the axis label inside the card even on narrow windows (min-padding may be // smaller than the label width) so it never spills onto the tab background. @@ -1208,11 +1209,14 @@ void RenderMarketTab(App* app) // Line dl->AddPolyline(points.data(), (int)points.size(), lineCol, ImDrawFlags_None, S.drawElement("tabs.market", "chart-line-thickness").size); - // Dots + // Dots: only for a sparse series — a dense historical curve reads better as a clean line. + // Always mark the latest point (current price) with a dot + ring. float dotR = std::max(S.drawElement("tabs.market", "chart-dot-min-radius").size, S.drawElement("tabs.market", "chart-dot-radius").size * hs); - for (size_t i = 0; i < n; i++) { - dl->AddCircleFilled(points[i], dotR, dotCol); + if (n <= 40) { + for (size_t i = 0; i < n; i++) dl->AddCircleFilled(points[i], dotR, dotCol); } + dl->AddCircleFilled(points[n - 1], dotR + 1.0f * mktDp, dotCol); + dl->AddCircle(points[n - 1], dotR + 3.5f * mktDp, WithAlpha(dotCol, 130), 0, 1.4f * mktDp); // X-axis time labels. Each point spans one interval unit (minute/hour/day/week/month); // convert points-before-now to a "~