Changeset View
Changeset View
Standalone View
Standalone View
src/filterbar/filterbar.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 34 | { | |||
---|---|---|---|---|---|
42 | // Create button to lock text when changing folders | 42 | // Create button to lock text when changing folders | ||
43 | m_lockButton = new QToolButton(this); | 43 | m_lockButton = new QToolButton(this); | ||
44 | m_lockButton->setAutoRaise(true); | 44 | m_lockButton->setAutoRaise(true); | ||
45 | m_lockButton->setCheckable(true); | 45 | m_lockButton->setCheckable(true); | ||
46 | m_lockButton->setIcon(QIcon::fromTheme(QStringLiteral("object-unlocked"))); | 46 | m_lockButton->setIcon(QIcon::fromTheme(QStringLiteral("object-unlocked"))); | ||
47 | m_lockButton->setToolTip(i18nc("@info:tooltip", "Keep Filter When Changing Folders")); | 47 | m_lockButton->setToolTip(i18nc("@info:tooltip", "Keep Filter When Changing Folders")); | ||
48 | connect(m_lockButton, &QToolButton::toggled, this, &FilterBar::slotToggleLockButton); | 48 | connect(m_lockButton, &QToolButton::toggled, this, &FilterBar::slotToggleLockButton); | ||
49 | 49 | | |||
50 | // Create label | | |||
51 | QLabel* filterLabel = new QLabel(i18nc("@label:textbox", "Filter:"), this); | | |||
52 | 50 | | |||
53 | // Create filter editor | 51 | // Create filter editor | ||
54 | m_filterInput = new QLineEdit(this); | 52 | m_filterInput = new QLineEdit(this); | ||
55 | m_filterInput->setLayoutDirection(Qt::LeftToRight); | 53 | m_filterInput->setLayoutDirection(Qt::LeftToRight); | ||
56 | m_filterInput->setClearButtonEnabled(true); | 54 | m_filterInput->setClearButtonEnabled(true); | ||
55 | m_filterInput->setPlaceholderText(i18n("Filter...")); | ||||
57 | connect(m_filterInput, &QLineEdit::textChanged, | 56 | connect(m_filterInput, &QLineEdit::textChanged, | ||
58 | this, &FilterBar::filterChanged); | 57 | this, &FilterBar::filterChanged); | ||
59 | setFocusProxy(m_filterInput); | 58 | setFocusProxy(m_filterInput); | ||
60 | 59 | | |||
61 | // Apply layout | 60 | // Apply layout | ||
62 | QHBoxLayout* hLayout = new QHBoxLayout(this); | 61 | QHBoxLayout* hLayout = new QHBoxLayout(this); | ||
63 | hLayout->setContentsMargins(0, 0, 0, 0); | 62 | hLayout->setContentsMargins(0, 0, 0, 0); | ||
64 | hLayout->addWidget(closeButton); | 63 | hLayout->addWidget(closeButton); | ||
65 | hLayout->addWidget(filterLabel); | | |||
66 | hLayout->addWidget(m_filterInput); | 64 | hLayout->addWidget(m_filterInput); | ||
67 | hLayout->addWidget(m_lockButton); | 65 | hLayout->addWidget(m_lockButton); | ||
68 | | ||||
69 | filterLabel->setBuddy(m_filterInput); | | |||
70 | } | 66 | } | ||
71 | 67 | | |||
72 | FilterBar::~FilterBar() | 68 | FilterBar::~FilterBar() | ||
73 | { | 69 | { | ||
74 | } | 70 | } | ||
75 | 71 | | |||
76 | void FilterBar::closeFilterBar() | 72 | void FilterBar::closeFilterBar() | ||
77 | { | 73 | { | ||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |