Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

fix: address PR review - unique objectName, drop dead null guard, fix button width

Abhi Kakadiya15e35597071d
diff --git a/fincept-qt/src/screens/news/NewsDetailPanel.cpp b/fincept-qt/src/screens/news/NewsDetailPanel.cpp
index bb7193e01..cb4a41508 100644
--- a/fincept-qt/src/screens/news/NewsDetailPanel.cpp
+++ b/fincept-qt/src/screens/news/NewsDetailPanel.cpp
@@ -163,8 +163,9 @@ QWidget* NewsDetailPanel::build_content_view() {
copy_btn_->setObjectName("newsDetailCopyBtn");
copy_btn_->setFixedHeight(24);
copy_title_btn_ = new QPushButton("COPY TITLE", content);
- copy_title_btn_->setObjectName("newsDetailCopyBtn"); // reuse existing style
+ copy_title_btn_->setObjectName("newsDetailCopyTitleBtn");
copy_title_btn_->setFixedHeight(24);
+ copy_title_btn_->setFixedWidth(copy_title_btn_->fontMetrics().horizontalAdvance("COPY TITLE") + 20);
copy_title_btn_->setToolTip("Copy article headline to clipboard");
analyze_btn_ = new QPushButton("ANALYZE", content);
analyze_btn_->setObjectName("newsDetailAnalyzeBtn");
@@ -210,8 +211,7 @@ QWidget* NewsDetailPanel::build_content_view() {
// Brief visual confirmation — flip label for ~1 s, then revert.
copy_title_btn_->setText("COPIED");
QTimer::singleShot(1000, this, [this]() {
- if (copy_title_btn_)
- copy_title_btn_->setText("COPY TITLE");
+ copy_title_btn_->setText("COPY TITLE");
});
});
connect(analyze_btn_, &QPushButton::clicked, this, [this]() {
diff --git a/fincept-qt/src/ui/theme/StyleSheets.cpp b/fincept-qt/src/ui/theme/StyleSheets.cpp
index a2d5fdcbc..dd0ef7aef 100644
--- a/fincept-qt/src/ui/theme/StyleSheets.cpp
+++ b/fincept-qt/src/ui/theme/StyleSheets.cpp
@@ -186,9 +186,9 @@ QString news_screen_styles() {
" letter-spacing: 0.5px; background: transparent; padding: 2px 0; "
" border-bottom: 1px solid %3; }"
"#newsDetailSubTitle { color: %6; font-size: 10px; font-weight: 700; background: transparent; }"
- "#newsDetailOpenBtn, #newsDetailCopyBtn, #newsDetailSaveBtn { background: %8; color: %7; "
+ "#newsDetailOpenBtn, #newsDetailCopyBtn, #newsDetailCopyTitleBtn, #newsDetailSaveBtn { background: %8; color: %7; "
" border: 1px solid %3; font-size: 11px; font-weight: 700; padding: 0 8px; }"
- "#newsDetailOpenBtn:hover, #newsDetailCopyBtn:hover, #newsDetailSaveBtn:hover { color: %4; background: %13; }"
+ "#newsDetailOpenBtn:hover, #newsDetailCopyBtn:hover, #newsDetailCopyTitleBtn:hover, #newsDetailSaveBtn:hover { color: %4; background: %13; }"
"#newsDetailAnalyzeBtn { background: rgba(217,119,6,0.1); color: %12; "
" border: 1px solid %10; font-size: 11px; font-weight: 700; padding: 0 10px; }"
"#newsDetailAnalyzeBtn:hover { background: %12; color: %1; }"