diff --git a/app/ui/icons/icons.cpp b/app/ui/icons/icons.cpp index 792e7b997..530a30b41 100644 --- a/app/ui/icons/icons.cpp +++ b/app/ui/icons/icons.cpp @@ -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) diff --git a/app/ui/icons/icons.h b/app/ui/icons/icons.h index 8990368bd..2d0be7a42 100644 --- a/app/ui/icons/icons.h +++ b/app/ui/icons/icons.h @@ -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 diff --git a/app/widget/taskview/taskviewitem.cpp b/app/widget/taskview/taskviewitem.cpp index 97ad9a669..f52e12ce5 100644 --- a/app/widget/taskview/taskviewitem.cpp +++ b/app/widget/taskview/taskviewitem.cpp @@ -20,8 +20,11 @@ #include "taskviewitem.h" +#include #include +#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);