strawberry-audio-player-win.../src/collection/collectionviewcontainer.cpp

53 lines
2.0 KiB
C++
Raw Normal View History

2018-02-27 18:06:05 +01:00
/*
* Strawberry Music Player
* This file was part of Clementine.
* Copyright 2010, David Sansome <me@davidsansome.com>
2021-03-20 21:14:47 +01:00
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
2018-02-27 18:06:05 +01:00
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Strawberry is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
2018-08-09 18:39:44 +02:00
*
2018-02-27 18:06:05 +01:00
*/
#include "config.h"
#include <QWidget>
#include <QKeyEvent>
#include "collectionfilterwidget.h"
#include "collectionview.h"
2018-02-27 18:06:05 +01:00
#include "collectionviewcontainer.h"
#include "ui_collectionviewcontainer.h"
CollectionViewContainer::CollectionViewContainer(QWidget *parent) : QWidget(parent), ui_(new Ui_CollectionViewContainer) {
ui_->setupUi(this);
2021-06-28 00:07:58 +02:00
view()->SetFilter(filter_widget());
2018-02-27 18:06:05 +01:00
2021-06-28 00:07:58 +02:00
QObject::connect(filter_widget(), &CollectionFilterWidget::UpPressed, view(), &CollectionView::UpAndFocus);
QObject::connect(filter_widget(), &CollectionFilterWidget::DownPressed, view(), &CollectionView::DownAndFocus);
QObject::connect(filter_widget(), &CollectionFilterWidget::ReturnPressed, view(), &CollectionView::FilterReturnPressed);
QObject::connect(view(), &CollectionView::FocusOnFilterSignal, filter_widget(), &CollectionFilterWidget::FocusOnFilter);
2018-02-27 18:06:05 +01:00
ReloadSettings();
}
CollectionViewContainer::~CollectionViewContainer() { delete ui_; }
2018-03-10 13:02:56 +01:00
CollectionView *CollectionViewContainer::view() const { return ui_->view; }
2021-06-28 00:07:58 +02:00
CollectionFilterWidget *CollectionViewContainer::filter_widget() const { return ui_->filter; }
2021-06-22 13:45:29 +02:00
void CollectionViewContainer::ReloadSettings() const {
2021-06-28 00:07:58 +02:00
filter_widget()->ReloadSettings();
view()->ReloadSettings();
}