]> sigrok.org Git - pulseview.git/commitdiff
Added status icons to Run/Stop button
authorJoel Holdsworth <redacted>
Mon, 31 Dec 2012 09:34:12 +0000 (09:34 +0000)
committerJoel Holdsworth <redacted>
Tue, 1 Jan 2013 19:50:24 +0000 (19:50 +0000)
icons/status-green.svg [new file with mode: 0644]
icons/status-grey.svg [new file with mode: 0644]
icons/status-red.svg [new file with mode: 0644]
pulseview.qrc
pv/samplingbar.cpp
pv/samplingbar.h

diff --git a/icons/status-green.svg b/icons/status-green.svg
new file mode 100644 (file)
index 0000000..e9ba2e8
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg id="svg4376" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="22" width="22" version="1.0" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <defs id="defs3">
+  <radialGradient id="radialGradient3774" gradientUnits="userSpaceOnUse" cy="6" cx="7.5" gradientTransform="matrix(1.0799,0,0,1.0799,-2.4045,-1.3652)" r="7.5">
+   <stop id="stop3292" stop-color="#c1f093" offset="0"/>
+   <stop id="stop3294" stop-color="#8eea34" offset=".64486"/>
+   <stop id="stop3296" stop-color="#73d216" offset="1"/>
+  </radialGradient>
+ </defs>
+ <path id="path2996" stroke-linejoin="round" d="m17 7.5a8.5 8.5 0 1 1 -17 0 8.5 8.5 0 1 1 17 0z" transform="translate(2.5,3.5)" stroke="#3b7404" stroke-linecap="round" fill="url(#radialGradient3774)"/>
+ <path id="path3766" stroke-linejoin="round" d="m16 7.5a7.5 7.5 0 1 1 -15 0 7.5 7.5 0 1 1 15 0z" stroke-opacity=".64338" transform="translate(2.5,3.5)" stroke="#fff" stroke-linecap="round" fill="none"/>
+</svg>
diff --git a/icons/status-grey.svg b/icons/status-grey.svg
new file mode 100644 (file)
index 0000000..33f75d8
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg id="svg4376" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="22" width="22" version="1.0" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <defs id="defs3">
+  <radialGradient id="radialGradient3774" gradientUnits="userSpaceOnUse" cy="6" cx="7.5" gradientTransform="matrix(1.0799,0,0,1.0799,-2.4045,-1.3652)" r="7.5">
+   <stop id="stop3778" stop-color="#d3d7cf" offset="0"/>
+   <stop id="stop3780" stop-color="#babdb6" offset=".64486"/>
+   <stop id="stop3782" stop-color="#888a85" offset="1"/>
+  </radialGradient>
+ </defs>
+ <path id="path2996" stroke-linejoin="round" d="m17 7.5a8.5 8.5 0 1 1 -17 0 8.5 8.5 0 1 1 17 0z" transform="translate(2.5,3.5)" stroke="#555753" stroke-linecap="round" fill="url(#radialGradient3774)"/>
+ <path id="path3766" stroke-linejoin="round" d="m16 7.5a7.5 7.5 0 1 1 -15 0 7.5 7.5 0 1 1 15 0z" stroke-opacity=".64338" transform="translate(2.5,3.5)" stroke="#fff" stroke-linecap="round" fill="none"/>
+</svg>
diff --git a/icons/status-red.svg b/icons/status-red.svg
new file mode 100644 (file)
index 0000000..593b307
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg id="svg4376" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="22" width="22" version="1.0" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <defs id="defs3">
+  <radialGradient id="radialGradient3774" gradientUnits="userSpaceOnUse" cy="6" cx="7.5" gradientTransform="matrix(1.0799,0,0,1.0799,-2.4045,-1.3652)" r="7.5">
+   <stop id="stop3292" stop-color="#f24e4e" offset="0"/>
+   <stop id="stop3294" stop-color="#c00" offset=".64486"/>
+   <stop id="stop3296" stop-color="#a40000" offset="1"/>
+  </radialGradient>
+ </defs>
+ <path id="path2996" stroke-linejoin="round" d="m17 7.5a8.5 8.5 0 1 1 -17 0 8.5 8.5 0 1 1 17 0z" transform="translate(2.5,3.5)" stroke="#780000" stroke-linecap="round" fill="url(#radialGradient3774)"/>
+ <path id="path3766" stroke-linejoin="round" d="m16 7.5a7.5 7.5 0 1 1 -15 0 7.5 7.5 0 1 1 15 0z" stroke-opacity=".64338" transform="translate(2.5,3.5)" stroke="#fff" stroke-linecap="round" fill="none"/>
+</svg>
index de265fbbdf68efdfca5ab292ad86e3ab46ca7395..e43e0784dd3f6ed4cf67aca3c524ce3b102e60ef 100644 (file)
@@ -3,6 +3,9 @@
        <file>icons/configure.png</file>
        <file>icons/document-open.png</file>
        <file>icons/sigrok-logo-notext.png</file>
+       <file>icons/status-green.svg</file>
+       <file>icons/status-grey.svg</file>
+       <file>icons/status-red.svg</file>
        <file>icons/zoom-in.png</file>
        <file>icons/zoom-out.png</file>
     </qresource>
index 08cb0f34e015121af17b0ef9777bdc563051d1b7..60d7b4c8aec6cdcb2841a383ee5e8922b4fcc7be 100644 (file)
@@ -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");
 }
 
index a9ceb6bd96af85e7e5ffb7c4c38303b7e1647e74..0bf5c449e754ec23eb956b3d684671868cdac0b8 100644 (file)
@@ -70,6 +70,8 @@ private:
        QDoubleSpinBox _sample_rate_value;
        QAction *_sample_rate_value_action;
 
+       QIcon _icon_green;
+       QIcon _icon_grey;
        QToolButton _run_stop_button;
 };