diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 563c5cc..7bde837 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -5614,12 +5614,10 @@ void Courtroom::truncate_label_text(QWidget *p_widget, QString p_identifier) qInfo() << "Truncation aborted for label text" << label_text_tr << ", label text was already truncated!"; return; } - int label_theme_width = - (p_label != nullptr - ? design_ini_result.width - : design_ini_result.width - - 18); // 18 is the width of a checkbox on win10 + 5px of - // padding, TODO: fetch the actual size + + int checkbox_width = AOApplication::style()->pixelMetric(QStyle::PM_IndicatorWidth) + AOApplication::style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing); + + int label_theme_width = (p_label != nullptr ? design_ini_result.width : (design_ini_result.width - checkbox_width)); int label_px_width = p_widget->fontMetrics().boundingRect(label_text_tr).width(); // pixel width of our translated text if (!p_widget->toolTip().startsWith(label_text_tr)) // don't want to append this multiple times