2010-03-24 00:11:46 +01:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-03-24 00:11:46 +01:00
|
|
|
|
|
|
|
Clementine 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.
|
|
|
|
|
|
|
|
Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2009-12-25 17:12:07 +01:00
|
|
|
#ifndef PLAYLISTHEADER_H
|
|
|
|
#define PLAYLISTHEADER_H
|
|
|
|
|
2010-08-27 14:42:06 +02:00
|
|
|
#include "widgets/stretchheaderview.h"
|
2009-12-25 17:12:07 +01:00
|
|
|
|
2011-11-12 17:23:41 +01:00
|
|
|
class PlaylistView;
|
|
|
|
|
2009-12-25 17:12:07 +01:00
|
|
|
class QMenu;
|
|
|
|
|
2010-08-27 14:42:06 +02:00
|
|
|
class PlaylistHeader : public StretchHeaderView {
|
2009-12-25 17:12:07 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2011-11-12 17:23:41 +01:00
|
|
|
PlaylistHeader(Qt::Orientation orientation, PlaylistView* view,
|
2014-02-10 16:03:54 +01:00
|
|
|
QWidget* parent = nullptr);
|
2009-12-25 17:12:07 +01:00
|
|
|
|
|
|
|
// QWidget
|
|
|
|
void contextMenuEvent(QContextMenuEvent* e);
|
2010-10-24 01:30:38 +02:00
|
|
|
void enterEvent(QEvent*);
|
2009-12-25 17:12:07 +01:00
|
|
|
|
2020-09-18 16:15:19 +02:00
|
|
|
signals:
|
2010-06-16 19:15:13 +02:00
|
|
|
void SectionVisibilityChanged(int logical, bool visible);
|
2015-10-25 05:05:23 +01:00
|
|
|
void SectionRatingLockStatusChanged(bool state);
|
2010-10-24 01:30:38 +02:00
|
|
|
void MouseEntered();
|
2010-06-16 19:15:13 +02:00
|
|
|
|
2009-12-25 17:12:07 +01:00
|
|
|
private slots:
|
|
|
|
void HideCurrent();
|
|
|
|
void ToggleVisible(int section);
|
2015-10-25 05:05:23 +01:00
|
|
|
void ToggleRatingEditStatus();
|
2011-11-12 17:23:41 +01:00
|
|
|
void SetColumnAlignment(QAction* action);
|
2009-12-25 17:12:07 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void AddColumnAction(int index);
|
|
|
|
|
|
|
|
private:
|
2011-11-12 17:23:41 +01:00
|
|
|
PlaylistView* view_;
|
|
|
|
|
2009-12-25 17:12:07 +01:00
|
|
|
int menu_section_;
|
|
|
|
QMenu* menu_;
|
|
|
|
QAction* hide_action_;
|
2015-10-25 05:05:23 +01:00
|
|
|
QAction* rating_lock_;
|
2010-08-27 14:42:06 +02:00
|
|
|
QAction* stretch_action_;
|
2010-12-22 11:45:14 +01:00
|
|
|
QAction* align_left_action_;
|
|
|
|
QAction* align_center_action_;
|
|
|
|
QAction* align_right_action_;
|
2010-06-10 19:40:14 +02:00
|
|
|
QList<QAction*> show_actions_;
|
2009-12-25 17:12:07 +01:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // PLAYLISTHEADER_H
|