pineapple-files/statusbarwidget.cpp

31 lines
912 B
C++
Raw Permalink Normal View History

2020-09-23 01:42:09 +08:00
#include "statusbarwidget.h"
#include <QPushButton>
#include <QVBoxLayout>
StatusbarWidget::StatusbarWidget(QWidget *parent) : QWidget(parent)
{
QHBoxLayout * layout = new QHBoxLayout;
this->setLayout(layout);
layout->setMargin(0);
QPushButton * m_columnsModeBtn = new QPushButton("Columns");
connect(m_columnsModeBtn, &QPushButton::clicked, this, [this](){
Q_EMIT requestMode(0);
});
QPushButton * m_listModeBtn = new QPushButton("List");
connect(m_listModeBtn, &QPushButton::clicked, this, [this](){
Q_EMIT requestMode(1);
});
QPushButton * m_detailsModeBtn = new QPushButton("Details");
connect(m_detailsModeBtn, &QPushButton::clicked, this, [this](){
Q_EMIT requestMode(2);
});
layout->addWidget(m_columnsModeBtn);
layout->addWidget(m_listModeBtn);
layout->addWidget(m_detailsModeBtn);
}