Changeset View
Changeset View
Standalone View
Standalone View
src/searchwidget.cpp
Show All 29 Lines | |||||
30 | #include "search.h" | 30 | #include "search.h" | ||
31 | 31 | | |||
32 | SearchWidget::SearchWidget(QWidget *parent) : QWidget(parent), m_timer(nullptr) | 32 | SearchWidget::SearchWidget(QWidget *parent) : QWidget(parent), m_timer(nullptr) | ||
33 | { | 33 | { | ||
34 | QHBoxLayout *mainlay = new QHBoxLayout(this); | 34 | QHBoxLayout *mainlay = new QHBoxLayout(this); | ||
35 | mainlay->setMargin(2); | 35 | mainlay->setMargin(2); | ||
36 | mainlay->setSpacing(5); | 36 | mainlay->setSpacing(5); | ||
37 | 37 | | |||
38 | mainlay->addWidget(new QLabel(i18n("Search:"), this)); | | |||
39 | | ||||
40 | m_searchLine = new KLineEdit(this); | 38 | m_searchLine = new KLineEdit(this); | ||
41 | m_searchLine->setClearButtonEnabled(true); | 39 | m_searchLine->setClearButtonEnabled(true); | ||
40 | m_searchLine->setPlaceholderText(i18n("Search...")); | ||||
ngraham: Typically we use three periods for this, not the actual ellipsis character. I don't know why… | |||||
In this case, we need to fix the HIG, because the symbol in the HIG is the unicode ellipsis. Also, @yurchor say GNOME also use the unicode ellipsis. ognarb: In this case, we need to fix the HIG, because the symbol in the HIG is the unicode ellipsis. | |||||
In the past, the original text often used just 3 dots and the translation used an ellipsis (one of the few places where the en_XX translation is not a noop). I am not sure if this still applies. bruns: In the past, the original text often used just 3 dots and the translation used an ellipsis (one… | |||||
42 | m_searchLine->setTrapReturnKey(true); | 41 | m_searchLine->setTrapReturnKey(true); | ||
43 | connect(m_searchLine, &QLineEdit::textChanged, | 42 | connect(m_searchLine, &QLineEdit::textChanged, | ||
44 | this, &SearchWidget::searchTextChanged); | 43 | this, &SearchWidget::searchTextChanged); | ||
45 | connect(m_searchLine, SIGNAL(returnPressed()), | 44 | connect(m_searchLine, SIGNAL(returnPressed()), | ||
46 | this, SLOT(slotReturnPressed())); | 45 | this, SLOT(slotReturnPressed())); | ||
47 | mainlay->addWidget(m_searchLine); | 46 | mainlay->addWidget(m_searchLine); | ||
48 | } | 47 | } | ||
49 | 48 | | |||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |
Typically we use three periods for this, not the actual ellipsis character. I don't know why, but what's what we do. :)