diff options
| author | in1tiate <radwoodward@vikings.grayson.edu> | 2021-01-20 03:23:45 -0600 |
|---|---|---|
| committer | in1tiate <radwoodward@vikings.grayson.edu> | 2021-01-20 03:23:45 -0600 |
| commit | a0d0546c6692a87380a24e1a671185c279490193 (patch) | |
| tree | 1ddd43080ee9475398ad3b5c365a30d6867ac675 | |
| parent | 0bb8574d79229f1c1629198784c69f3753d718b5 (diff) | |
add some tooltip exceptions
| -rw-r--r-- | src/courtroom.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 4b37e6f9..307062bf 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -5402,6 +5402,10 @@ void Courtroom::truncate_label_text(QWidget *p_widget, QString p_identifier) QString label_text_tr = QCoreApplication::translate(p_widget->metaObject()->className(), "%1") .arg((p_label != nullptr ? p_label->text() : p_checkbox->text())); + if (label_text_tr.endsWith("…") || label_text_tr.endsWith("…")) { + 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 @@ -5410,7 +5414,8 @@ void Courtroom::truncate_label_text(QWidget *p_widget, QString p_identifier) // padding, TODO: fetch the actual size int label_px_width = p_widget->fontMetrics().boundingRect(label_text_tr).width(); // pixel width of our translated text - p_widget->setToolTip(label_text_tr + "\n" + p_widget->toolTip()); + if (!p_widget->toolTip().startsWith(label_text_tr)) // don't want to append this multiple times + p_widget->setToolTip(label_text_tr + "\n" + p_widget->toolTip()); // qInfo() << "I: Width of label text: " << label_px_width << "px. Theme's // width: " << label_theme_width << "px."; |
