From: Joel Holdsworth Date: Mon, 31 Dec 2012 09:34:12 +0000 (+0000) Subject: Added status icons to Run/Stop button X-Git-Tag: pulseview-0.1.0~171 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f5798068924d5f7cc12a94211c06f520d9835f3b;p=pulseview.git Added status icons to Run/Stop button --- diff --git a/icons/status-green.svg b/icons/status-green.svg new file mode 100644 index 00000000..e9ba2e82 --- /dev/null +++ b/icons/status-green.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/icons/status-grey.svg b/icons/status-grey.svg new file mode 100644 index 00000000..33f75d8e --- /dev/null +++ b/icons/status-grey.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/icons/status-red.svg b/icons/status-red.svg new file mode 100644 index 00000000..593b3075 --- /dev/null +++ b/icons/status-red.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/pulseview.qrc b/pulseview.qrc index de265fbb..e43e0784 100644 --- a/pulseview.qrc +++ b/pulseview.qrc @@ -3,6 +3,9 @@ icons/configure.png icons/document-open.png icons/sigrok-logo-notext.png + icons/status-green.svg + icons/status-grey.svg + icons/status-red.svg icons/zoom-in.png icons/zoom-out.png diff --git a/pv/samplingbar.cpp b/pv/samplingbar.cpp index 08cb0f34..60d7b4c8 100644 --- a/pv/samplingbar.cpp +++ b/pv/samplingbar.cpp @@ -54,6 +54,8 @@ SamplingBar::SamplingBar(QWidget *parent) : _configure_button(this), _record_length_selector(this), _sample_rate_list(this), + _icon_green(":/icons/status-green.svg"), + _icon_grey(":/icons/status-grey.svg"), _run_stop_button(this) { connect(&_run_stop_button, SIGNAL(clicked()), @@ -79,6 +81,8 @@ SamplingBar::SamplingBar(QWidget *parent) : _configure_button.setIcon(QIcon::fromTheme("configure", QIcon(":/icons/configure.png"))); + _run_stop_button.setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + addWidget(&_device_selector); addWidget(&_configure_button); addWidget(&_record_length_selector); @@ -130,6 +134,7 @@ uint64_t SamplingBar::get_sample_rate() const void SamplingBar::set_sampling(bool sampling) { + _run_stop_button.setIcon(sampling ? _icon_green : _icon_grey); _run_stop_button.setText(sampling ? "Stop" : "Run"); } diff --git a/pv/samplingbar.h b/pv/samplingbar.h index a9ceb6bd..0bf5c449 100644 --- a/pv/samplingbar.h +++ b/pv/samplingbar.h @@ -70,6 +70,8 @@ private: QDoubleSpinBox _sample_rate_value; QAction *_sample_rate_value_action; + QIcon _icon_green; + QIcon _icon_grey; QToolButton _run_stop_button; };