added cancel button
This commit is contained in:
@@ -57,6 +57,7 @@ QIcon olive::icon::ZoomIn;
|
||||
QIcon olive::icon::ZoomOut;
|
||||
QIcon olive::icon::Record;
|
||||
QIcon olive::icon::Add;
|
||||
QIcon olive::icon::Error;
|
||||
|
||||
void olive::icon::LoadAll()
|
||||
{
|
||||
@@ -90,6 +91,7 @@ void olive::icon::LoadAll()
|
||||
ZoomOut = Create("zoomout");
|
||||
Record = Create("record");
|
||||
Add = Create("add-button");
|
||||
Error = Create("error");
|
||||
}
|
||||
|
||||
QIcon olive::icon::Create(const QString &name)
|
||||
|
||||
@@ -60,6 +60,7 @@ extern QIcon ZoomIn;
|
||||
extern QIcon ZoomOut;
|
||||
extern QIcon Record;
|
||||
extern QIcon Add;
|
||||
extern QIcon Error;
|
||||
|
||||
/**
|
||||
* @brief Create an icon object loaded from file
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
|
||||
#include "taskviewitem.h"
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "ui/icons/icons.h"
|
||||
|
||||
TaskViewItem::TaskViewItem(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
task_(nullptr)
|
||||
@@ -36,10 +39,19 @@ TaskViewItem::TaskViewItem(QWidget *parent) :
|
||||
task_name_lbl_ = new QLabel(this);
|
||||
layout->addWidget(task_name_lbl_);
|
||||
|
||||
// Create center layout (combines progress bar and a cancel button)
|
||||
QHBoxLayout* middle_layout = new QHBoxLayout();
|
||||
layout->addLayout(middle_layout);
|
||||
|
||||
// Create progress bar
|
||||
progress_bar_ = new QProgressBar(this);
|
||||
progress_bar_->setRange(0, 100);
|
||||
layout->addWidget(progress_bar_);
|
||||
middle_layout->addWidget(progress_bar_);
|
||||
|
||||
// Create cancel button
|
||||
QPushButton* cancel_btn = new QPushButton(this);
|
||||
cancel_btn->setIcon(olive::icon::Error);
|
||||
middle_layout->addWidget(cancel_btn);
|
||||
|
||||
// Create status label
|
||||
task_status_lbl_ = new QLabel(this);
|
||||
|
||||
Reference in New Issue
Block a user