Skip to content

Commit

Permalink
Add length command by showing lengths automatically, word wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
kovzol committed Feb 15, 2024
1 parent d94357c commit ffc3106
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ QString getClipboardInfos() {
intro += "<br>Clipboard " + QString::number(i + 1);
if (text[i].empty())
intro += " is empty.";
else
intro += " contains " + latinToGreek(text[i]) + " (" + text[i] + ").";
else {
intro += " contains " + latinToGreek(text[i]) + " (" + text[i] + "),"
+ " length ";
intro += QString::number(text[i].length()) + ".";
}
}
if (textset[0] && textset[1]) {
// double c = dist(text[0], text[1]);
Expand All @@ -48,6 +51,7 @@ MainWindow::MainWindow()
infoLabel = new QLabel(getClipboardInfos());
infoLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
infoLabel->setAlignment(Qt::AlignCenter);
infoLabel->setWordWrap(true);

QWidget *bottomFiller = new QWidget;
bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
Expand Down

0 comments on commit ffc3106

Please sign in to comment.