added cancel button

This commit is contained in:
itsmattkc
2019-06-29 10:40:26 -07:00
parent d1d57f63d1
commit b9083a673b
3 changed files with 16 additions and 1 deletions
+2
View File
@@ -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)
+1
View File
@@ -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
+13 -1
View 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);