File indexing completed on 2024-06-02 05:26:04

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #include "knoteswidget.h"
0007 #include "knotesiconview.h"
0008 #include "knoteslistwidgetsearchline.h"
0009 
0010 #include <QVBoxLayout>
0011 
0012 KNotesWidget::KNotesWidget(KNotesPart *part, QWidget *parent)
0013     : QWidget(parent)
0014 {
0015     auto lay = new QVBoxLayout(this);
0016     mSearchLine = new KNotesListWidgetSearchLine;
0017     lay->addWidget(mSearchLine);
0018     mIconView = new KNotesIconView(part, parent);
0019     mSearchLine->setListWidget(mIconView);
0020     lay->addWidget(mIconView);
0021 }
0022 
0023 KNotesWidget::~KNotesWidget() = default;
0024 
0025 void KNotesWidget::slotFocusQuickSearch()
0026 {
0027     mSearchLine->setFocus();
0028 }
0029 
0030 void KNotesWidget::updateClickMessage(const QString &shortcutStr)
0031 {
0032     mSearchLine->updateClickMessage(shortcutStr);
0033 }
0034 
0035 KNotesIconView *KNotesWidget::notesView() const
0036 {
0037     return mIconView;
0038 }
0039 
0040 #include "moc_knoteswidget.cpp"