]> sigrok.org Git - pulseview.git/commitdiff
Rename colour* to color*
authorSoeren Apel <redacted>
Tue, 10 Apr 2018 17:57:35 +0000 (19:57 +0200)
committerSoeren Apel <redacted>
Sun, 15 Apr 2018 06:19:59 +0000 (08:19 +0200)
47 files changed:
CMakeLists.txt
pv/data/signalbase.cpp
pv/data/signalbase.hpp
pv/dialogs/settings.cpp
pv/dialogs/settings.hpp
pv/globalsettings.cpp
pv/globalsettings.hpp
pv/mainwindow.cpp
pv/mainwindow.hpp
pv/views/trace/analogsignal.cpp
pv/views/trace/analogsignal.hpp
pv/views/trace/cursor.cpp
pv/views/trace/cursor.hpp
pv/views/trace/cursorpair.cpp
pv/views/trace/cursorpair.hpp
pv/views/trace/decodetrace.cpp
pv/views/trace/decodetrace.hpp
pv/views/trace/flag.cpp
pv/views/trace/flag.hpp
pv/views/trace/logicsignal.cpp
pv/views/trace/logicsignal.hpp
pv/views/trace/signal.cpp
pv/views/trace/timemarker.cpp
pv/views/trace/timemarker.hpp
pv/views/trace/trace.cpp
pv/views/trace/trace.hpp
pv/views/trace/tracegroup.cpp
pv/views/trace/tracegroup.hpp
pv/views/trace/tracepalette.cpp
pv/views/trace/tracepalette.hpp
pv/views/trace/triggermarker.cpp
pv/views/trace/triggermarker.hpp
pv/views/trace/view.cpp
pv/views/trace/view.hpp
pv/views/trace/viewitem.cpp
pv/views/trace/viewitem.hpp
pv/views/trace/viewitempaintparams.cpp
pv/views/trace/viewitempaintparams.hpp
pv/widgets/colorbutton.cpp [new file with mode: 0644]
pv/widgets/colorbutton.hpp [new file with mode: 0644]
pv/widgets/colorpopup.cpp [new file with mode: 0644]
pv/widgets/colorpopup.hpp [new file with mode: 0644]
pv/widgets/colourbutton.cpp [deleted file]
pv/widgets/colourbutton.hpp [deleted file]
pv/widgets/colourpopup.cpp [deleted file]
pv/widgets/colourpopup.hpp [deleted file]
test/CMakeLists.txt

index 1e81a60ce37ee24dfc7d985ca8e7728a48f96fa7..252f9024d21c4bf089cb74afe7c1cfa14ecff829 100644 (file)
@@ -270,8 +270,8 @@ set(pulseview_SOURCES
        pv/views/trace/viewwidget.cpp
        pv/views/viewbase.cpp
        pv/views/trace/standardbar.cpp
-       pv/widgets/colourbutton.cpp
-       pv/widgets/colourpopup.cpp
+       pv/widgets/colorbutton.cpp
+       pv/widgets/colorpopup.cpp
        pv/widgets/devicetoolbutton.cpp
        pv/widgets/exportmenu.cpp
        pv/widgets/importmenu.cpp
@@ -329,8 +329,8 @@ set(pulseview_HEADERS
        pv/views/trace/viewwidget.hpp
        pv/views/viewbase.hpp
        pv/views/trace/standardbar.hpp
-       pv/widgets/colourbutton.hpp
-       pv/widgets/colourpopup.hpp
+       pv/widgets/colorbutton.hpp
+       pv/widgets/colorpopup.hpp
        pv/widgets/devicetoolbutton.hpp
        pv/widgets/exportmenu.hpp
        pv/widgets/importmenu.hpp
index 5f6dc398f012d8507ca499f56b84887e04ec5a97..eb2996d04105d605dc5472a182ab42a496352c89 100644 (file)
@@ -41,7 +41,7 @@ using std::unique_lock;
 namespace pv {
 namespace data {
 
-const int SignalBase::ColourBGAlpha = 8 * 256 / 100;
+const int SignalBase::ColorBGAlpha = 8 * 256 / 100;
 const uint64_t SignalBase::ConversionBlockSize = 4096;
 const uint32_t SignalBase::ConversionDelay = 1000;  // 1 second
 
@@ -130,24 +130,24 @@ unsigned int SignalBase::logic_bit_index() const
                return 0;
 }
 
-QColor SignalBase::colour() const
+QColor SignalBase::color() const
 {
-       return colour_;
+       return color_;
 }
 
-void SignalBase::set_colour(QColor colour)
+void SignalBase::set_color(QColor color)
 {
-       colour_ = colour;
+       color_ = color;
 
-       bgcolour_ = colour;
-       bgcolour_.setAlpha(ColourBGAlpha);
+       bgcolor_ = color;
+       bgcolor_.setAlpha(ColorBGAlpha);
 
-       colour_changed(colour);
+       color_changed(color);
 }
 
-QColor SignalBase::bgcolour() const
+QColor SignalBase::bgcolor() const
 {
-       return bgcolour_;
+       return bgcolor_;
 }
 
 void SignalBase::set_data(shared_ptr<pv::data::SignalData> data)
@@ -430,7 +430,7 @@ void SignalBase::save_settings(QSettings &settings) const
 {
        settings.setValue("name", name());
        settings.setValue("enabled", enabled());
-       settings.setValue("colour", colour());
+       settings.setValue("color", color());
        settings.setValue("conversion_type", (int)conversion_type_);
 
        settings.setValue("conv_options", (int)(conversion_options_.size()));
@@ -446,7 +446,7 @@ void SignalBase::restore_settings(QSettings &settings)
 {
        set_name(settings.value("name").toString());
        set_enabled(settings.value("enabled").toBool());
-       set_colour(settings.value("colour").value<QColor>());
+       set_color(settings.value("color").value<QColor>());
        set_conversion_type((ConversionType)settings.value("conversion_type").toInt());
 
        int conv_options = settings.value("conv_options").toInt();
index 3356af5b786ad3fefeace38f7d42fe32dc7bdfa7..b6f69ef56e0950d628c0b55234f0bbf6770a42a5 100644 (file)
@@ -86,7 +86,7 @@ public:
        };
 
 private:
-       static const int ColourBGAlpha;
+       static const int ColorBGAlpha;
        static const uint64_t ConversionBlockSize;
        static const uint32_t ConversionDelay;
 
@@ -152,19 +152,19 @@ public:
        virtual void set_name(QString name);
 
        /**
-        * Get the colour of the signal.
+        * Get the color of the signal.
         */
-       QColor colour() const;
+       QColor color() const;
 
        /**
-        * Set the colour of the signal.
+        * Set the color of the signal.
         */
-       void set_colour(QColor colour);
+       void set_color(QColor color);
 
        /**
-        * Get the background colour of the signal.
+        * Get the background color of the signal.
         */
-       QColor bgcolour() const;
+       QColor bgcolor() const;
 
        /**
         * Sets the internal data object.
@@ -298,7 +298,7 @@ Q_SIGNALS:
 
        void name_changed(const QString &name);
 
-       void colour_changed(const QColor &colour);
+       void color_changed(const QColor &color);
 
        void conversion_type_changed(const ConversionType t);
 
@@ -338,7 +338,7 @@ protected:
        QTimer delayed_conversion_starter_;
 
        QString internal_name_, name_;
-       QColor colour_, bgcolour_;
+       QColor color_, bgcolor_;
 };
 
 } // namespace data
index b0ef922a8ed0a1d957d900fbcd36843dde17a86f..4744567f6b0eef1d6eee0cc14e99e23e447cfae5 100644 (file)
@@ -205,9 +205,9 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const
        QFormLayout *trace_view_layout = new QFormLayout();
        trace_view_group->setLayout(trace_view_layout);
 
-       cb = create_checkbox(GlobalSettings::Key_View_ColouredBG,
-               SLOT(on_view_colouredBG_changed(int)));
-       trace_view_layout->addRow(tr("Use coloured trace &background"), cb);
+       cb = create_checkbox(GlobalSettings::Key_View_ColoredBG,
+               SLOT(on_view_coloredBG_changed(int)));
+       trace_view_layout->addRow(tr("Use colored trace &background"), cb);
 
        cb = create_checkbox(GlobalSettings::Key_View_ZoomToFitDuringAcq,
                SLOT(on_view_zoomToFitDuringAcq_changed(int)));
@@ -571,10 +571,10 @@ void Settings::on_view_triggerIsZero_changed(int state)
        settings.setValue(GlobalSettings::Key_View_TriggerIsZeroTime, state ? true : false);
 }
 
-void Settings::on_view_colouredBG_changed(int state)
+void Settings::on_view_coloredBG_changed(int state)
 {
        GlobalSettings settings;
-       settings.setValue(GlobalSettings::Key_View_ColouredBG, state ? true : false);
+       settings.setValue(GlobalSettings::Key_View_ColoredBG, state ? true : false);
 }
 
 void Settings::on_view_stickyScrolling_changed(int state)
index 71fbaf40c5c58191a9d56fb2be5c3877edbaf8a9..f1925b45a65ab2767db1c87e6991c7e74aa6af4a 100644 (file)
@@ -58,7 +58,7 @@ private Q_SLOTS:
        void on_view_zoomToFitDuringAcq_changed(int state);
        void on_view_zoomToFitAfterAcq_changed(int state);
        void on_view_triggerIsZero_changed(int state);
-       void on_view_colouredBG_changed(int state);
+       void on_view_coloredBG_changed(int state);
        void on_view_stickyScrolling_changed(int state);
        void on_view_showSamplingPoints_changed(int state);
        void on_view_showAnalogMinorGrid_changed(int state);
index 088a6e27bda0701771e75c8a33c41debc89ed7f2..9f20b2694968942a2a0e1da9a38dd920707f4d1a 100644 (file)
@@ -32,7 +32,7 @@ namespace pv {
 const QString GlobalSettings::Key_View_ZoomToFitDuringAcq = "View_ZoomToFitDuringAcq";
 const QString GlobalSettings::Key_View_ZoomToFitAfterAcq = "View_ZoomToFitAfterAcq";
 const QString GlobalSettings::Key_View_TriggerIsZeroTime = "View_TriggerIsZeroTime";
-const QString GlobalSettings::Key_View_ColouredBG = "View_ColouredBG";
+const QString GlobalSettings::Key_View_ColoredBG = "View_ColoredBG";
 const QString GlobalSettings::Key_View_StickyScrolling = "View_StickyScrolling";
 const QString GlobalSettings::Key_View_ShowSamplingPoints = "View_ShowSamplingPoints";
 const QString GlobalSettings::Key_View_ShowAnalogMinorGrid = "View_ShowAnalogMinorGrid";
@@ -59,9 +59,9 @@ void GlobalSettings::set_defaults_where_needed()
        if (!contains(Key_View_ZoomToFitAfterAcq))
                setValue(Key_View_ZoomToFitAfterAcq, true);
 
-       // Enable coloured trace backgrounds by default
-       if (!contains(Key_View_ColouredBG))
-               setValue(Key_View_ColouredBG, true);
+       // Enable colored trace backgrounds by default
+       if (!contains(Key_View_ColoredBG))
+               setValue(Key_View_ColoredBG, true);
 
        // Enable showing sampling points by default
        if (!contains(Key_View_ShowSamplingPoints))
index 51212b023ab19f2e79145d991117bf804c707904..b7f7af06de2d8ec5efbb7e15205187ff9090928c 100644 (file)
@@ -48,7 +48,7 @@ public:
        static const QString Key_View_ZoomToFitDuringAcq;
        static const QString Key_View_ZoomToFitAfterAcq;
        static const QString Key_View_TriggerIsZeroTime;
-       static const QString Key_View_ColouredBG;
+       static const QString Key_View_ColoredBG;
        static const QString Key_View_StickyScrolling;
        static const QString Key_View_ShowSamplingPoints;
        static const QString Key_View_ShowAnalogMinorGrid;
index c08576caff7a7bb18beaf5af10d32c81df0322a9..4fe483ef3abafda58104052dc9f6d3a581eb74ac 100644 (file)
@@ -185,7 +185,7 @@ shared_ptr<views::ViewBase> MainWindow::add_view(const QString &title,
                views::trace::View *tv =
                        qobject_cast<views::trace::View*>(v.get());
 
-               tv->enable_coloured_bg(settings.value(GlobalSettings::Key_View_ColouredBG).toBool());
+               tv->enable_colored_bg(settings.value(GlobalSettings::Key_View_ColoredBG).toBool());
                tv->enable_show_sampling_points(settings.value(GlobalSettings::Key_View_ShowSamplingPoints).toBool());
                tv->enable_show_analog_minor_grid(settings.value(GlobalSettings::Key_View_ShowAnalogMinorGrid).toBool());
 
@@ -405,8 +405,8 @@ void MainWindow::restore_sessions()
 
 void MainWindow::on_setting_changed(const QString &key, const QVariant &value)
 {
-       if (key == GlobalSettings::Key_View_ColouredBG)
-               on_settingViewColouredBg_changed(value);
+       if (key == GlobalSettings::Key_View_ColoredBG)
+               on_settingViewColoredBg_changed(value);
 
        if (key == GlobalSettings::Key_View_ShowSamplingPoints)
                on_settingViewShowSamplingPoints_changed(value);
@@ -435,8 +435,8 @@ void MainWindow::setup_ui()
        view_show_analog_minor_grid_shortcut_ = new QShortcut(QKeySequence(Qt::Key_G), this, SLOT(on_view_show_analog_minor_grid_shortcut()));
        view_show_analog_minor_grid_shortcut_->setAutoRepeat(false);
 
-       view_coloured_bg_shortcut_ = new QShortcut(QKeySequence(Qt::Key_B), this, SLOT(on_view_coloured_bg_shortcut()));
-       view_coloured_bg_shortcut_->setAutoRepeat(false);
+       view_colored_bg_shortcut_ = new QShortcut(QKeySequence(Qt::Key_B), this, SLOT(on_view_colored_bg_shortcut()));
+       view_colored_bg_shortcut_->setAutoRepeat(false);
 
        // Set up the tab area
        new_session_button_ = new QToolButton();
@@ -762,12 +762,12 @@ void MainWindow::on_tab_close_requested(int index)
                remove_session(session);
 }
 
-void MainWindow::on_view_coloured_bg_shortcut()
+void MainWindow::on_view_colored_bg_shortcut()
 {
        GlobalSettings settings;
 
-       bool state = settings.value(GlobalSettings::Key_View_ColouredBG).toBool();
-       settings.setValue(GlobalSettings::Key_View_ColouredBG, !state);
+       bool state = settings.value(GlobalSettings::Key_View_ColoredBG).toBool();
+       settings.setValue(GlobalSettings::Key_View_ColoredBG, !state);
 }
 
 void MainWindow::on_view_sticky_scrolling_shortcut()
@@ -794,7 +794,7 @@ void MainWindow::on_view_show_analog_minor_grid_shortcut()
        settings.setValue(GlobalSettings::Key_View_ShowAnalogMinorGrid, !state);
 }
 
-void MainWindow::on_settingViewColouredBg_changed(const QVariant new_value)
+void MainWindow::on_settingViewColoredBg_changed(const QVariant new_value)
 {
        bool state = new_value.toBool();
 
@@ -805,7 +805,7 @@ void MainWindow::on_settingViewColouredBg_changed(const QVariant new_value)
                views::trace::View* view =
                                qobject_cast<views::trace::View*>(viewbase.get());
                if (view)
-                       view->enable_coloured_bg(state);
+                       view->enable_colored_bg(state);
        }
 }
 
index 5f4609d90b42e3824d3116b1431cc05abcfc1ab3..6d92b270dc6394f4fd5c2a66bb604766044b8c98 100644 (file)
@@ -131,12 +131,12 @@ private Q_SLOTS:
        void on_tab_changed(int index);
        void on_tab_close_requested(int index);
 
-       void on_view_coloured_bg_shortcut();
+       void on_view_colored_bg_shortcut();
        void on_view_sticky_scrolling_shortcut();
        void on_view_show_sampling_points_shortcut();
        void on_view_show_analog_minor_grid_shortcut();
 
-       void on_settingViewColouredBg_changed(const QVariant new_value);
+       void on_settingViewColoredBg_changed(const QVariant new_value);
        void on_settingViewShowSamplingPoints_changed(const QVariant new_value);
        void on_settingViewShowAnalogMinorGrid_changed(const QVariant new_value);
 
@@ -164,7 +164,7 @@ private:
        QShortcut *view_sticky_scrolling_shortcut_;
        QShortcut *view_show_sampling_points_shortcut_;
        QShortcut *view_show_analog_minor_grid_shortcut_;
-       QShortcut *view_coloured_bg_shortcut_;
+       QShortcut *view_colored_bg_shortcut_;
        QShortcut *run_stop_shortcut_;
        QShortcut *close_application_shortcut_;
        QShortcut *close_current_tab_shortcut_;
index 43d1175d3bb466c346dbbf1f1a65657fbd8bf203..8a055729e10d6305a2887e33cd87f660e516896f 100644 (file)
@@ -65,7 +65,7 @@ namespace pv {
 namespace views {
 namespace trace {
 
-const QColor AnalogSignal::SignalColours[4] = {
+const QColor AnalogSignal::SignalColors[4] = {
        QColor(0xC4, 0xA0, 0x00),       // Yellow
        QColor(0x87, 0x20, 0x7A),       // Magenta
        QColor(0x20, 0x4A, 0x87),       // Blue
@@ -76,10 +76,10 @@ const QPen AnalogSignal::AxisPen(QColor(0, 0, 0, 30 * 256 / 100), 2);
 const QColor AnalogSignal::GridMajorColor = QColor(0, 0, 0, 40 * 256 / 100);
 const QColor AnalogSignal::GridMinorColor = QColor(0, 0, 0, 20 * 256 / 100);
 
-const QColor AnalogSignal::SamplingPointColour(0x77, 0x77, 0x77);
-const QColor AnalogSignal::SamplingPointColourLo = QColor(200, 0, 0, 80 * 256 / 100);
-const QColor AnalogSignal::SamplingPointColourNe = QColor(0,   0, 0, 80 * 256 / 100);
-const QColor AnalogSignal::SamplingPointColourHi = QColor(0, 200, 0, 80 * 256 / 100);
+const QColor AnalogSignal::SamplingPointColor(0x77, 0x77, 0x77);
+const QColor AnalogSignal::SamplingPointColorLo = QColor(200, 0, 0, 80 * 256 / 100);
+const QColor AnalogSignal::SamplingPointColorNe = QColor(0,   0, 0, 80 * 256 / 100);
+const QColor AnalogSignal::SamplingPointColorHi = QColor(0, 200, 0, 80 * 256 / 100);
 
 const QColor AnalogSignal::ThresholdColor = QColor(0, 0, 0, 30 * 256 / 100);
 const QColor AnalogSignal::ThresholdColorLo = QColor(255, 0, 0, 8 * 256 / 100);
@@ -124,7 +124,7 @@ AnalogSignal::AnalogSignal(
 
        div_height_ = gs.value(GlobalSettings::Key_View_DefaultDivHeight).toInt();
 
-       base_->set_colour(SignalColours[base_->index() % countof(SignalColours)]);
+       base_->set_color(SignalColors[base_->index() % countof(SignalColors)]);
        update_scale();
 }
 
@@ -318,7 +318,7 @@ void AnalogSignal::paint_fore(QPainter &p, ViewItemPaintParams &pp)
                // Show the info section on the right side of the trace
                const QString infotext = QString("%1 V/div").arg(resolution_);
 
-               p.setPen(base_->colour());
+               p.setPen(base_->color());
                p.setFont(QApplication::font());
 
                const QRectF bounding_rect = QRectF(pp.left(),
@@ -405,7 +405,7 @@ void AnalogSignal::paint_trace(QPainter &p,
                (settings.value(GlobalSettings::Key_View_ShowSamplingPoints).toBool() ||
                paint_thr_dots) && (samples_per_pixel < 0.25);
 
-       p.setPen(base_->colour());
+       p.setPen(base_->color());
 
        const int64_t points_count = end - start;
 
@@ -456,14 +456,14 @@ void AnalogSignal::paint_trace(QPainter &p,
 
        if (show_sampling_points) {
                if (paint_thr_dots) {
-                       p.setPen(SamplingPointColourNe);
+                       p.setPen(SamplingPointColorNe);
                        p.drawRects(sampling_points[0].data(), sampling_points[0].size());
-                       p.setPen(SamplingPointColourLo);
+                       p.setPen(SamplingPointColorLo);
                        p.drawRects(sampling_points[1].data(), sampling_points[1].size());
-                       p.setPen(SamplingPointColourHi);
+                       p.setPen(SamplingPointColorHi);
                        p.drawRects(sampling_points[2].data(), sampling_points[2].size());
                } else {
-                       p.setPen(SamplingPointColour);
+                       p.setPen(SamplingPointColor);
                        p.drawRects(sampling_points[0].data(), sampling_points[0].size());
                }
        }
@@ -485,7 +485,7 @@ void AnalogSignal::paint_envelope(QPainter &p,
                return;
 
        p.setPen(QPen(Qt::NoPen));
-       p.setBrush(base_->colour());
+       p.setBrush(base_->color());
 
        QRectF *const rects = new QRectF[e.length];
        QRectF *rect = rects;
@@ -611,7 +611,7 @@ void AnalogSignal::paint_logic_mid(QPainter &p, ViewItemPaintParams &pp)
                        sampling_point_x += pixels_per_sample;
                };
 
-       p.setPen(LogicSignal::EdgeColour);
+       p.setPen(LogicSignal::EdgeColor);
        p.drawLines(edge_lines, edge_count);
        delete[] edge_lines;
 
@@ -619,10 +619,10 @@ void AnalogSignal::paint_logic_mid(QPainter &p, ViewItemPaintParams &pp)
        const unsigned int max_cap_line_count = edges.size();
        QLineF *const cap_lines = new QLineF[max_cap_line_count];
 
-       p.setPen(LogicSignal::HighColour);
+       p.setPen(LogicSignal::HighColor);
        paint_logic_caps(p, cap_lines, edges, true, samples_per_pixel,
                pixels_offset, pp.left(), high_offset);
-       p.setPen(LogicSignal::LowColour);
+       p.setPen(LogicSignal::LowColor);
        paint_logic_caps(p, cap_lines, edges, false, samples_per_pixel,
                pixels_offset, pp.left(), low_offset);
 
@@ -630,7 +630,7 @@ void AnalogSignal::paint_logic_mid(QPainter &p, ViewItemPaintParams &pp)
 
        // Paint the sampling points
        if (show_sampling_points) {
-               p.setPen(SamplingPointColour);
+               p.setPen(SamplingPointColor);
                p.drawRects(sampling_points.data(), sampling_points.size());
        }
 }
index 97d5160bd08b42591191211121f6d16fc874669a..6afc394227170c99151acc9d8220daa3fed63def 100644 (file)
@@ -48,12 +48,12 @@ class AnalogSignal : public Signal, public GlobalSettingsInterface
 
 private:
        static const QPen AxisPen;
-       static const QColor SignalColours[4];
+       static const QColor SignalColors[4];
        static const QColor GridMajorColor, GridMinorColor;
-       static const QColor SamplingPointColour;
-       static const QColor SamplingPointColourLo;
-       static const QColor SamplingPointColourNe;
-       static const QColor SamplingPointColourHi;
+       static const QColor SamplingPointColor;
+       static const QColor SamplingPointColorLo;
+       static const QColor SamplingPointColorNe;
+       static const QColor SamplingPointColorHi;
        static const QColor ThresholdColor;
        static const QColor ThresholdColorLo;
        static const QColor ThresholdColorNe;
index 88c4ebfdca52172c12f609c1eba9c1cb0fee7018..7a375c7aad49410450c5f41f0d6d8c949e6bcd38 100644 (file)
@@ -41,10 +41,10 @@ namespace pv {
 namespace views {
 namespace trace {
 
-const QColor Cursor::FillColour(52, 101, 164);
+const QColor Cursor::FillColor(52, 101, 164);
 
 Cursor::Cursor(View &view, double time) :
-       TimeMarker(view, FillColour, time)
+       TimeMarker(view, FillColor, time)
 {
 }
 
index ad91b05979e2ac02f0388cc1fe7af77694079f5f..c3960d6d39aa57d5d3bd8c6a02773ccc14eb65e2 100644 (file)
@@ -39,7 +39,7 @@ class Cursor : public TimeMarker
        Q_OBJECT
 
 public:
-       static const QColor FillColour;
+       static const QColor FillColor;
 
 public:
        /**
index 2ddecb278e6e86c8b7785d9402ad54a73f5454f3..86198c5217a2f1129bc750d6f553f2ee51c6eeea 100644 (file)
@@ -37,7 +37,7 @@ namespace views {
 namespace trace {
 
 const int CursorPair::DeltaPadding = 8;
-const QColor CursorPair::ViewportFillColour(220, 231, 243);
+const QColor CursorPair::ViewportFillColor(220, 231, 243);
 
 CursorPair::CursorPair(View &view) :
        TimeItem(view),
@@ -110,10 +110,10 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect, bool hover)
        if (!enabled())
                return;
 
-       const QColor text_colour =
-               ViewItem::select_text_colour(Cursor::FillColour);
+       const QColor text_color =
+               ViewItem::select_text_color(Cursor::FillColor);
 
-       p.setPen(text_colour);
+       p.setPen(text_color);
        compute_text_size(p);
        QRectF delta_rect(label_rect(rect));
 
@@ -129,16 +129,16 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect, bool hover)
                        p.drawRoundedRect(delta_rect, radius, radius);
                }
 
-               p.setBrush(hover ? Cursor::FillColour.lighter() :
-                       Cursor::FillColour);
-               p.setPen(Cursor::FillColour.darker());
+               p.setBrush(hover ? Cursor::FillColor.lighter() :
+                       Cursor::FillColor);
+               p.setPen(Cursor::FillColor.darker());
                p.drawRoundedRect(delta_rect, radius, radius);
 
                delta_rect.adjust(1, 1, -1, -1);
-               p.setPen(Cursor::FillColour.lighter());
+               p.setPen(Cursor::FillColor.lighter());
                p.drawRoundedRect(delta_rect, highlight_radius, highlight_radius);
 
-               p.setPen(text_colour);
+               p.setPen(text_color);
                p.drawText(text_rect, Qt::AlignCenter | Qt::AlignVCenter,
                        format_string());
        }
@@ -150,7 +150,7 @@ void CursorPair::paint_back(QPainter &p, ViewItemPaintParams &pp)
                return;
 
        p.setPen(Qt::NoPen);
-       p.setBrush(QBrush(ViewportFillColour));
+       p.setBrush(QBrush(ViewportFillColor));
 
        const pair<float, float> offsets(get_cursor_offsets());
        const int l = (int)max(min(
index 5d53bacfd3ad839c825e6fbc90a33b21569a34cd..12a9d7ff7a7344b0154a30f8a61e2e078e6cb989 100644 (file)
@@ -39,7 +39,7 @@ class CursorPair : public TimeItem
 {
 private:
        static const int DeltaPadding;
-       static const QColor ViewportFillColour;
+       static const QColor ViewportFillColor;
 
 public:
        /**
index bf31a72ac05adaee19ee78e6d54b1c9f3bc09191..b05bcb0ccbadedd192ed13bd8282c767d4860c60 100644 (file)
@@ -72,15 +72,15 @@ namespace pv {
 namespace views {
 namespace trace {
 
-const QColor DecodeTrace::DecodeColours[4] = {
+const QColor DecodeTrace::DecodeColors[4] = {
        QColor(0xEF, 0x29, 0x29),       // Red
        QColor(0xFC, 0xE9, 0x4F),       // Yellow
        QColor(0x8A, 0xE2, 0x34),       // Green
        QColor(0x72, 0x9F, 0xCF)        // Blue
 };
 
-const QColor DecodeTrace::ErrorBgColour = QColor(0xEF, 0x29, 0x29);
-const QColor DecodeTrace::NoDecodeColour = QColor(0x88, 0x8A, 0x85);
+const QColor DecodeTrace::ErrorBgColor = QColor(0xEF, 0x29, 0x29);
+const QColor DecodeTrace::NoDecodeColor = QColor(0x88, 0x8A, 0x85);
 
 const int DecodeTrace::ArrowSize = 4;
 const double DecodeTrace::EndCapWidth = 5;
@@ -89,7 +89,7 @@ const int DecodeTrace::DrawPadding = 100;
 
 const int DecodeTrace::MaxTraceUpdateRate = 1; // No more than 1 Hz
 
-const QColor DecodeTrace::Colours[16] = {
+const QColor DecodeTrace::Colors[16] = {
        QColor(0xEF, 0x29, 0x29),
        QColor(0xF6, 0x6A, 0x32),
        QColor(0xFC, 0xAE, 0x3E),
@@ -108,7 +108,7 @@ const QColor DecodeTrace::Colours[16] = {
        QColor(0xD7, 0x47, 0x6F)
 };
 
-const QColor DecodeTrace::OutlineColours[16] = {
+const QColor DecodeTrace::OutlineColors[16] = {
        QColor(0x77, 0x14, 0x14),
        QColor(0x7B, 0x35, 0x19),
        QColor(0x7E, 0x57, 0x1F),
@@ -142,7 +142,7 @@ DecodeTrace::DecodeTrace(pv::Session &session,
        QFontMetrics m(QApplication::font());
        min_useful_label_width_ = m.width("XX"); // e.g. two hex characters
 
-       base_->set_colour(DecodeColours[index % countof(DecodeColours)]);
+       base_->set_color(DecodeColors[index % countof(DecodeColors)]);
 
        connect(decode_signal_.get(), SIGNAL(new_annotations()),
                this, SLOT(on_new_annotations()));
@@ -228,18 +228,18 @@ void DecodeTrace::paint_mid(QPainter &p, ViewItemPaintParams &pp)
                }
 
                // Determine the row's color
-               size_t base_colour = 0x13579BDF;
-               boost::hash_combine(base_colour, this);
-               boost::hash_combine(base_colour, row.decoder());
-               boost::hash_combine(base_colour, row.row());
-               base_colour >>= 16;
+               size_t base_color = 0x13579BDF;
+               boost::hash_combine(base_color, this);
+               boost::hash_combine(base_color, row.decoder());
+               boost::hash_combine(base_color, row.row());
+               base_color >>= 16;
 
                vector<Annotation> annotations;
                decode_signal_->get_annotation_subset(annotations, row,
                        current_segment_, sample_range.first, sample_range.second);
                if (!annotations.empty()) {
                        draw_annotations(annotations, p, annotation_height, pp, y,
-                               base_colour, row_title_width);
+                               base_color, row_title_width);
 
                        y += row_height_;
 
@@ -362,7 +362,7 @@ QMenu* DecodeTrace::create_context_menu(QWidget *parent)
 
 void DecodeTrace::draw_annotations(vector<pv::data::decode::Annotation> annotations,
                QPainter &p, int h, const ViewItemPaintParams &pp, int y,
-               size_t base_colour, int row_title_width)
+               size_t base_color, int row_title_width)
 {
        using namespace pv::data::decode;
 
@@ -406,17 +406,17 @@ void DecodeTrace::draw_annotations(vector<pv::data::decode::Annotation> annotati
                if ((abs(delta) > 1) || a_is_separate) {
                        // Block was broken, draw annotations that form the current block
                        if (a_block.size() == 1) {
-                               draw_annotation(a_block.front(), p, h, pp, y, base_colour,
+                               draw_annotation(a_block.front(), p, h, pp, y, base_color,
                                        row_title_width);
                        }
                        else
-                               draw_annotation_block(a_block, p, h, y, base_colour);
+                               draw_annotation_block(a_block, p, h, y, base_color);
 
                        a_block.clear();
                }
 
                if (a_is_separate) {
-                       draw_annotation(a, p, h, pp, y, base_colour, row_title_width);
+                       draw_annotation(a, p, h, pp, y, base_color, row_title_width);
                        // Next annotation must start a new block. delta will be > 1
                        // because we set p_end to INT_MIN but that's okay since
                        // a_block will be empty, so nothing will be drawn
@@ -428,15 +428,15 @@ void DecodeTrace::draw_annotations(vector<pv::data::decode::Annotation> annotati
        }
 
        if (a_block.size() == 1)
-               draw_annotation(a_block.front(), p, h, pp, y, base_colour,
+               draw_annotation(a_block.front(), p, h, pp, y, base_color,
                        row_title_width);
        else
-               draw_annotation_block(a_block, p, h, y, base_colour);
+               draw_annotation_block(a_block, p, h, y, base_color);
 }
 
 void DecodeTrace::draw_annotation(const pv::data::decode::Annotation &a,
        QPainter &p, int h, const ViewItemPaintParams &pp, int y,
-       size_t base_colour, int row_title_width) const
+       size_t base_color, int row_title_width) const
 {
        double samples_per_pixel, pixels_offset;
        tie(pixels_offset, samples_per_pixel) =
@@ -446,9 +446,9 @@ void DecodeTrace::draw_annotation(const pv::data::decode::Annotation &a,
                pixels_offset;
        const double end = a.end_sample() / samples_per_pixel - pixels_offset;
 
-       const size_t colour = (base_colour + a.format()) % countof(Colours);
-       p.setPen(OutlineColours[colour]);
-       p.setBrush(Colours[colour]);
+       const size_t color = (base_color + a.format()) % countof(Colors);
+       p.setPen(OutlineColors[color]);
+       p.setBrush(Colors[color]);
 
        if (start > pp.right() + DrawPadding || end < pp.left() - DrawPadding)
                return;
@@ -461,7 +461,7 @@ void DecodeTrace::draw_annotation(const pv::data::decode::Annotation &a,
 
 void DecodeTrace::draw_annotation_block(
        vector<pv::data::decode::Annotation> annotations, QPainter &p, int h,
-       int y, size_t base_colour) const
+       int y, size_t base_color) const
 {
        using namespace pv::data::decode;
 
@@ -480,8 +480,8 @@ void DecodeTrace::draw_annotation_block(
        const double top = y + .5 - h / 2;
        const double bottom = y + .5 + h / 2;
 
-       const size_t colour = (base_colour + annotations.front().format()) %
-               countof(Colours);
+       const size_t color = (base_color + annotations.front().format()) %
+               countof(Colors);
 
        // Check if all annotations are of the same type (i.e. we can use one color)
        // or if we should use a neutral color (i.e. gray)
@@ -497,8 +497,8 @@ void DecodeTrace::draw_annotation_block(
        p.setBrush(Qt::white);
        p.drawRoundedRect(rect, r, r);
 
-       p.setPen((single_format ? OutlineColours[colour] : Qt::gray));
-       p.setBrush(QBrush((single_format ? Colours[colour] : Qt::gray),
+       p.setPen((single_format ? OutlineColors[color] : Qt::gray));
+       p.setBrush(QBrush((single_format ? Colors[color] : Qt::gray),
                Qt::Dense4Pattern));
        p.drawRoundedRect(rect, r, r);
 }
@@ -584,8 +584,8 @@ void DecodeTrace::draw_error(QPainter &p, const QString &message,
 {
        const int y = get_visual_y();
 
-       p.setPen(ErrorBgColour.darker());
-       p.setBrush(ErrorBgColour);
+       p.setPen(ErrorBgColor.darker());
+       p.setBrush(ErrorBgColor);
 
        const QRectF bounding_rect =
                QRectF(pp.left(), INT_MIN / 2 + y, pp.right(), INT_MAX);
@@ -629,8 +629,8 @@ void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left, int right
        p.setBrush(Qt::white);
        p.drawRect(no_decode_rect);
 
-       p.setPen(NoDecodeColour);
-       p.setBrush(QBrush(NoDecodeColour, Qt::Dense6Pattern));
+       p.setPen(NoDecodeColor);
+       p.setBrush(QBrush(NoDecodeColor, Qt::Dense6Pattern));
        p.drawRect(no_decode_rect);
 }
 
index 43473873444f01ba3f786b3c1fcd63b084215f70..410ea627e1ffa802d9f5542d65a15f4b0eff3fb4 100644 (file)
@@ -74,9 +74,9 @@ class DecodeTrace : public Trace
        Q_OBJECT
 
 private:
-       static const QColor DecodeColours[4];
-       static const QColor ErrorBgColour;
-       static const QColor NoDecodeColour;
+       static const QColor DecodeColors[4];
+       static const QColor ErrorBgColor;
+       static const QColor NoDecodeColor;
 
        static const int ArrowSize;
        static const double EndCapWidth;
@@ -85,8 +85,8 @@ private:
 
        static const int MaxTraceUpdateRate;
 
-       static const QColor Colours[16];
-       static const QColor OutlineColours[16];
+       static const QColor Colors[16];
+       static const QColor OutlineColors[16];
 
 public:
        DecodeTrace(pv::Session &session, shared_ptr<data::SignalBase> signalbase,
@@ -132,14 +132,14 @@ public:
 private:
        void draw_annotations(vector<pv::data::decode::Annotation> annotations,
                QPainter &p, int h, const ViewItemPaintParams &pp, int y,
-               size_t base_colour, int row_title_width);
+               size_t base_color, int row_title_width);
 
        void draw_annotation(const pv::data::decode::Annotation &a, QPainter &p,
                int h, const ViewItemPaintParams &pp, int y,
-               size_t base_colour, int row_title_width) const;
+               size_t base_color, int row_title_width) const;
 
        void draw_annotation_block(vector<pv::data::decode::Annotation> annotations,
-               QPainter &p, int h, int y, size_t base_colour) const;
+               QPainter &p, int h, int y, size_t base_color) const;
 
        void draw_instant(const pv::data::decode::Annotation &a, QPainter &p,
                int h, double x, int y) const;
index f5579ca14429298b80f5f6a35e49e4fc08d6e492..1cdaea8448ffdd5ad8107ca9c961a3842e544f14 100644 (file)
@@ -36,16 +36,16 @@ namespace pv {
 namespace views {
 namespace trace {
 
-const QColor Flag::FillColour(0x73, 0xD2, 0x16);
+const QColor Flag::FillColor(0x73, 0xD2, 0x16);
 
 Flag::Flag(View &view, const pv::util::Timestamp& time, const QString &text) :
-       TimeMarker(view, FillColour, time),
+       TimeMarker(view, FillColor, time),
        text_(text)
 {
 }
 
 Flag::Flag(const Flag &flag) :
-       TimeMarker(flag.view_, FillColour, flag.time_),
+       TimeMarker(flag.view_, FillColor, flag.time_),
        enable_shared_from_this<Flag>(flag)
 {
 }
index 2df13ca805e3ee74e5a185a372fc55049c7c8c80..150d37e81eebab9effc4de3e5e6b89375c385c4c 100644 (file)
@@ -41,7 +41,7 @@ class Flag : public TimeMarker, public enable_shared_from_this<Flag>
        Q_OBJECT
 
 public:
-       static const QColor FillColour;
+       static const QColor FillColor;
 
 public:
        /**
index 10a5bd4ae70bb2c1f95503fc8ec2b52c17d4f0d5..77e92c0cc2788f97eadedd8de04d560fcf571002 100644 (file)
@@ -63,12 +63,12 @@ namespace trace {
 
 const float LogicSignal::Oversampling = 2.0f;
 
-const QColor LogicSignal::EdgeColour(0x80, 0x80, 0x80);
-const QColor LogicSignal::HighColour(0x00, 0xC0, 0x00);
-const QColor LogicSignal::LowColour(0xC0, 0x00, 0x00);
-const QColor LogicSignal::SamplingPointColour(0x77, 0x77, 0x77);
+const QColor LogicSignal::EdgeColor(0x80, 0x80, 0x80);
+const QColor LogicSignal::HighColor(0x00, 0xC0, 0x00);
+const QColor LogicSignal::LowColor(0xC0, 0x00, 0x00);
+const QColor LogicSignal::SamplingPointColor(0x77, 0x77, 0x77);
 
-const QColor LogicSignal::SignalColours[10] = {
+const QColor LogicSignal::SignalColors[10] = {
        QColor(0x16, 0x19, 0x1A),       // Black
        QColor(0x8F, 0x52, 0x02),       // Brown
        QColor(0xCC, 0x00, 0x00),       // Red
@@ -81,7 +81,7 @@ const QColor LogicSignal::SignalColours[10] = {
        QColor(0xEE, 0xEE, 0xEC),       // White
 };
 
-QColor LogicSignal::TriggerMarkerBackgroundColour = QColor(0xED, 0xD4, 0x00);
+QColor LogicSignal::TriggerMarkerBackgroundColor = QColor(0xED, 0xD4, 0x00);
 const int LogicSignal::TriggerMarkerPadding = 2;
 const char* LogicSignal::TriggerMarkerIcons[8] = {
        nullptr,
@@ -112,7 +112,7 @@ LogicSignal::LogicSignal(
 {
        shared_ptr<Trigger> trigger;
 
-       base_->set_colour(SignalColours[base->index() % countof(SignalColours)]);
+       base_->set_color(SignalColors[base->index() % countof(SignalColors)]);
 
        GlobalSettings gs;
        signal_height_ = gs.value(GlobalSettings::Key_View_DefaultLogicHeight).toInt();
@@ -266,7 +266,7 @@ void LogicSignal::paint_mid(QPainter &p, ViewItemPaintParams &pp)
                        sampling_point_x += pixels_per_sample;
                };
 
-       p.setPen(EdgeColour);
+       p.setPen(EdgeColor);
        p.drawLines(edge_lines, edge_count);
        delete[] edge_lines;
 
@@ -274,10 +274,10 @@ void LogicSignal::paint_mid(QPainter &p, ViewItemPaintParams &pp)
        const unsigned int max_cap_line_count = edges.size();
        QLineF *const cap_lines = new QLineF[max_cap_line_count];
 
-       p.setPen(HighColour);
+       p.setPen(HighColor);
        paint_caps(p, cap_lines, edges, true, samples_per_pixel,
                pixels_offset, pp.left(), high_offset);
-       p.setPen(LowColour);
+       p.setPen(LowColor);
        paint_caps(p, cap_lines, edges, false, samples_per_pixel,
                pixels_offset, pp.left(), low_offset);
 
@@ -285,7 +285,7 @@ void LogicSignal::paint_mid(QPainter &p, ViewItemPaintParams &pp)
 
        // Paint the sampling points
        if (show_sampling_points) {
-               p.setPen(SamplingPointColour);
+               p.setPen(SamplingPointColor);
                p.drawRects(sampling_points.data(), sampling_points.size());
        }
 }
@@ -317,8 +317,8 @@ void LogicSignal::paint_fore(QPainter &p, ViewItemPaintParams &pp)
                        pp.right() - size.width() - pad * 2,
                        y - (signal_height_ + size.height()) / 2);
 
-               p.setPen(QPen(TriggerMarkerBackgroundColour.darker()));
-               p.setBrush(TriggerMarkerBackgroundColour);
+               p.setPen(QPen(TriggerMarkerBackgroundColor.darker()));
+               p.setBrush(TriggerMarkerBackgroundColor);
                p.drawRoundedRect(QRectF(point, size).adjusted(
                        -pad, -pad, pad, pad), pad, pad);
                p.drawPixmap(point, *pixmap);
index 4a52d379060523569e42628e94aa99d2aea6ee20..e49d69b3d6fac6d408f0efe3ba78bc5f5a1f66da 100644 (file)
@@ -59,14 +59,14 @@ class LogicSignal : public Signal
 public:
        static const float Oversampling;
 
-       static const QColor EdgeColour;
-       static const QColor HighColour;
-       static const QColor LowColour;
-       static const QColor SamplingPointColour;
+       static const QColor EdgeColor;
+       static const QColor HighColor;
+       static const QColor LowColor;
+       static const QColor SamplingPointColor;
 
-       static const QColor SignalColours[10];
+       static const QColor SignalColors[10];
 
-       static QColor TriggerMarkerBackgroundColour;
+       static QColor TriggerMarkerBackgroundColor;
        static const int TriggerMarkerPadding;
        static const char* TriggerMarkerIcons[8];
 
index 1e277f0d57196beb1ada1be3c4b016e4d44a5d95..e6c2594f82dabd50b25f5211339c97bbadb56e73 100644 (file)
@@ -127,7 +127,7 @@ void Signal::populate_popup_form(QWidget *parent, QFormLayout *form)
 
        form->addRow(tr("Name"), name_widget_);
 
-       add_colour_option(parent, form);
+       add_color_option(parent, form);
 }
 
 QMenu* Signal::create_context_menu(QWidget *parent)
index 0718f3cc8780704315e0e649b39c146a7a0e11bf..65b9481d12ff8261d321143d01b2add95c38ae5a 100644 (file)
@@ -44,9 +44,9 @@ namespace trace {
 const int TimeMarker::ArrowSize = 4;
 
 TimeMarker::TimeMarker(
-       View &view, const QColor &colour, const pv::util::Timestamp& time) :
+       View &view, const QColor &color, const pv::util::Timestamp& time) :
        TimeItem(view),
-       colour_(colour),
+       color_(color),
        time_(time),
        value_action_(nullptr),
        value_widget_(nullptr),
@@ -140,18 +140,18 @@ void TimeMarker::paint_label(QPainter &p, const QRect &rect, bool hover)
        }
 
        p.setPen(Qt::transparent);
-       p.setBrush(hover ? colour_.lighter() : colour_);
+       p.setBrush(hover ? color_.lighter() : color_);
        p.drawPolygon(points, countof(points));
 
-       p.setPen(colour_.lighter());
+       p.setPen(color_.lighter());
        p.setBrush(Qt::transparent);
        p.drawPolygon(highlight_points, countof(highlight_points));
 
-       p.setPen(colour_.darker());
+       p.setPen(color_.darker());
        p.setBrush(Qt::transparent);
        p.drawPolygon(points, countof(points));
 
-       p.setPen(select_text_colour(colour_));
+       p.setPen(select_text_color(color_));
        p.drawText(r, Qt::AlignCenter | Qt::AlignVCenter, get_text());
 }
 
@@ -161,7 +161,7 @@ void TimeMarker::paint_fore(QPainter &p, ViewItemPaintParams &pp)
                return;
 
        const float x = get_x();
-       p.setPen(colour_.darker());
+       p.setPen(color_.darker());
        p.drawLine(QPointF(x, pp.top()), QPointF(x, pp.bottom()));
 }
 
index 1a2abb3251e7bc3a8a3caa6e4d63b150141ecffd..48afc16bb77e9c346ec75e80c06ab3564873ecc1 100644 (file)
@@ -56,10 +56,10 @@ protected:
        /**
         * Constructor.
         * @param view A reference to the view that owns this marker.
-        * @param colour A reference to the colour of this cursor.
+        * @param color A reference to the color of this cursor.
         * @param time The time to set the flag to.
         */
-       TimeMarker(View &view, const QColor &colour, const pv::util::Timestamp& time);
+       TimeMarker(View &view, const QColor &color, const pv::util::Timestamp& time);
 
 public:
        /**
@@ -120,7 +120,7 @@ private Q_SLOTS:
        void on_value_changed(const pv::util::Timestamp& value);
 
 protected:
-       const QColor &colour_;
+       const QColor &color_;
 
        pv::util::Timestamp time_;
 
index 91fde4725cbbf6f142644174a7e1103be26ff5fa..cc91fff5a5aa43de401ec6b64cc4f1cc48d61090 100644 (file)
@@ -32,7 +32,7 @@
 #include "view.hpp"
 
 #include "pv/globalsettings.hpp"
-#include "pv/widgets/colourbutton.hpp"
+#include "pv/widgets/colorbutton.hpp"
 #include "pv/widgets/popup.hpp"
 
 using std::pair;
@@ -45,8 +45,8 @@ namespace trace {
 const QPen Trace::AxisPen(QColor(0, 0, 0, 30 * 256 / 100));
 const int Trace::LabelHitPadding = 2;
 
-const QColor Trace::BrightGrayBGColour = QColor(0, 0, 0, 10 * 255 / 100);
-const QColor Trace::DarkGrayBGColour = QColor(0, 0, 0, 15 * 255 / 100);
+const QColor Trace::BrightGrayBGColor = QColor(0, 0, 0, 10 * 255 / 100);
+const QColor Trace::DarkGrayBGColor = QColor(0, 0, 0, 15 * 255 / 100);
 
 Trace::Trace(shared_ptr<data::SignalBase> channel) :
        base_(channel),
@@ -58,8 +58,8 @@ Trace::Trace(shared_ptr<data::SignalBase> channel) :
 {
        connect(channel.get(), SIGNAL(name_changed(const QString&)),
                this, SLOT(on_name_changed(const QString&)));
-       connect(channel.get(), SIGNAL(colour_changed(const QColor&)),
-               this, SLOT(on_colour_changed(const QColor&)));
+       connect(channel.get(), SIGNAL(color_changed(const QColor&)),
+               this, SLOT(on_color_changed(const QColor&)));
 }
 
 shared_ptr<data::SignalBase> Trace::base() const
@@ -71,7 +71,7 @@ void Trace::paint_label(QPainter &p, const QRect &rect, bool hover)
 {
        const int y = get_visual_y();
 
-       p.setBrush(base_->colour());
+       p.setBrush(base_->color());
 
        if (!enabled())
                return;
@@ -105,19 +105,19 @@ void Trace::paint_label(QPainter &p, const QRect &rect, bool hover)
        }
 
        p.setPen(Qt::transparent);
-       p.setBrush(hover ? base_->colour().lighter() : base_->colour());
+       p.setBrush(hover ? base_->color().lighter() : base_->color());
        p.drawPolygon(points, countof(points));
 
-       p.setPen(base_->colour().lighter());
+       p.setPen(base_->color().lighter());
        p.setBrush(Qt::transparent);
        p.drawPolygon(highlight_points, countof(highlight_points));
 
-       p.setPen(base_->colour().darker());
+       p.setPen(base_->color().darker());
        p.setBrush(Qt::transparent);
        p.drawPolygon(points, countof(points));
 
        // Paint the text
-       p.setPen(select_text_colour(base_->colour()));
+       p.setPen(select_text_color(base_->color()));
        p.setFont(QApplication::font());
        p.drawText(QRectF(r.x(), r.y(),
                r.width() - label_arrow_length, r.height()),
@@ -177,10 +177,10 @@ void Trace::paint_back(QPainter &p, ViewItemPaintParams &pp)
        const View *view = owner_->view();
        assert(view);
 
-       if (view->coloured_bg())
-               p.setBrush(base_->bgcolour());
+       if (view->colored_bg())
+               p.setBrush(base_->bgcolor());
        else
-               p.setBrush(pp.next_bg_colour_state() ? BrightGrayBGColour : DarkGrayBGColour);
+               p.setBrush(pp.next_bg_color_state() ? BrightGrayBGColor : DarkGrayBGColor);
 
        p.setPen(QPen(Qt::NoPen));
 
@@ -199,18 +199,18 @@ void Trace::paint_axis(QPainter &p, ViewItemPaintParams &pp, int y)
        p.setRenderHint(QPainter::Antialiasing, true);
 }
 
-void Trace::add_colour_option(QWidget *parent, QFormLayout *form)
+void Trace::add_color_option(QWidget *parent, QFormLayout *form)
 {
-       using pv::widgets::ColourButton;
+       using pv::widgets::ColorButton;
 
-       ColourButton *const colour_button = new ColourButton(
+       ColorButton *const color_button = new ColorButton(
                TracePalette::Rows, TracePalette::Cols, parent);
-       colour_button->set_palette(TracePalette::Colours);
-       colour_button->set_colour(base_->colour());
-       connect(colour_button, SIGNAL(selected(const QColor&)),
-               this, SLOT(on_colouredit_changed(const QColor&)));
+       color_button->set_palette(TracePalette::Colors);
+       color_button->set_color(base_->color());
+       connect(color_button, SIGNAL(selected(const QColor&)),
+               this, SLOT(on_coloredit_changed(const QColor&)));
 
-       form->addRow(tr("Colour"), colour_button);
+       form->addRow(tr("Color"), color_button);
 }
 
 void Trace::create_popup_form()
@@ -241,7 +241,7 @@ void Trace::populate_popup_form(QWidget *parent, QFormLayout *form)
                this, SLOT(on_nameedit_changed(const QString&)));
        form->addRow(tr("Name"), name_edit);
 
-       add_colour_option(parent, form);
+       add_color_option(parent, form);
 }
 
 void Trace::set_name(QString name)
@@ -249,9 +249,9 @@ void Trace::set_name(QString name)
        base_->set_name(name);
 }
 
-void Trace::set_colour(QColor colour)
+void Trace::set_color(QColor color)
 {
-       base_->set_colour(colour);
+       base_->set_color(color);
 }
 
 void Trace::set_segment_display_mode(SegmentDisplayMode mode)
@@ -273,10 +273,10 @@ void Trace::on_name_changed(const QString &text)
        }
 }
 
-void Trace::on_colour_changed(const QColor &colour)
+void Trace::on_color_changed(const QColor &color)
 {
-       /* This event handler is called by SignalBase when the colour was changed there */
-       (void)colour;
+       /* This event handler is called by SignalBase when the color was changed there */
+       (void)color;
 
        if (owner_)
                owner_->row_item_appearance_changed(true, true);
@@ -294,10 +294,10 @@ void Trace::on_nameedit_changed(const QString &name)
        set_name(name);
 }
 
-void Trace::on_colouredit_changed(const QColor &colour)
+void Trace::on_coloredit_changed(const QColor &color)
 {
-       /* This event handler notifies SignalBase that the colour changed */
-       set_colour(colour);
+       /* This event handler notifies SignalBase that the color changed */
+       set_color(color);
 }
 
 } // namespace trace
index 134f11024f3a8de618dd64354280b5817b9c69fa..a9ccd7b7c4bd1b581d2b245821054466d2edf036 100644 (file)
@@ -88,8 +88,8 @@ private:
        static const QPen AxisPen;
        static const int LabelHitPadding;
 
-       static const QColor BrightGrayBGColour;
-       static const QColor DarkGrayBGColour;
+       static const QColor BrightGrayBGColor;
+       static const QColor DarkGrayBGColor;
 
 protected:
        Trace(shared_ptr<data::SignalBase> channel);
@@ -106,9 +106,9 @@ public:
        virtual void set_name(QString name);
 
        /**
-        * Set the colour of the signal.
+        * Set the color of the signal.
         */
-       virtual void set_colour(QColor colour);
+       virtual void set_color(QColor color);
 
        /**
         * Configures the segment display mode to use.
@@ -154,7 +154,7 @@ protected:
         */
        void paint_axis(QPainter &p, ViewItemPaintParams &pp, int y);
 
-       void add_colour_option(QWidget *parent, QFormLayout *form);
+       void add_color_option(QWidget *parent, QFormLayout *form);
 
        void create_popup_form();
 
@@ -163,14 +163,14 @@ protected:
 protected Q_SLOTS:
        virtual void on_name_changed(const QString &text);
 
-       virtual void on_colour_changed(const QColor &colour);
+       virtual void on_color_changed(const QColor &color);
 
        void on_popup_closed();
 
 private Q_SLOTS:
        void on_nameedit_changed(const QString &name);
 
-       void on_colouredit_changed(const QColor &colour);
+       void on_coloredit_changed(const QColor &color);
 
 protected:
        shared_ptr<data::SignalBase> base_;
index daf0c6705c9861a5cabf0f02612cac2dce7eb18d..3fbb864e8bca07111d359718274d6b5bd1e23d5e 100644 (file)
@@ -39,7 +39,7 @@ namespace trace {
 const int TraceGroup::Padding = 8;
 const int TraceGroup::Width = 12;
 const int TraceGroup::LineThickness = 5;
-const QColor TraceGroup::LineColour(QColor(0x55, 0x57, 0x53));
+const QColor TraceGroup::LineColor(QColor(0x55, 0x57, 0x53));
 
 TraceGroup::~TraceGroup()
 {
@@ -104,10 +104,10 @@ void TraceGroup::paint_label(QPainter &p, const QRect &rect, bool hover)
                p.drawPolyline(points, countof(points));
        }
 
-       p.setPen(QPen(QBrush(LineColour.darker()), LineThickness,
+       p.setPen(QPen(QBrush(LineColor.darker()), LineThickness,
                Qt::SolidLine, Qt::SquareCap, Qt::RoundJoin));
        p.drawPolyline(points, countof(points));
-       p.setPen(QPen(QBrush(hover ? LineColour.lighter() : LineColour),
+       p.setPen(QPen(QBrush(hover ? LineColor.lighter() : LineColor),
                LineThickness - 2, Qt::SolidLine, Qt::SquareCap,
                Qt::RoundJoin));
        p.drawPolyline(points, countof(points));
index 48b1bf23bcaf4424acbcffb212812253ebbff6bf..a1cc6fdc4558151911b56e40531d0fc5a23ea31a 100644 (file)
@@ -37,7 +37,7 @@ private:
        static const int Padding;
        static const int Width;
        static const int LineThickness;
-       static const QColor LineColour;
+       static const QColor LineColor;
 
 public:
        /**
index 762eafc3828f11bc322fa220a2cb26d848903729..e0497319224b9869e143febd4dd94c8cd433b83e 100644 (file)
@@ -23,9 +23,9 @@ namespace pv {
 namespace views {
 namespace trace {
 
-const QColor TracePalette::Colours[Cols * Rows] = {
+const QColor TracePalette::Colors[Cols * Rows] = {
 
-       // Light Colours
+       // Light Colors
        QColor(0xFC, 0xE9, 0x4F),       // Butter
        QColor(0xFC, 0xAF, 0x3E),       // Orange
        QColor(0xE9, 0xB9, 0x6E),       // Chocolate
@@ -35,7 +35,7 @@ const QColor TracePalette::Colours[Cols * Rows] = {
        QColor(0xCF, 0x72, 0xC3),       // Magenta
        QColor(0xEF, 0x29, 0x29),       // Scarlet Red
 
-       // Mid Colours
+       // Mid Colors
        QColor(0xED, 0xD4, 0x00),       // Butter
        QColor(0xF5, 0x79, 0x00),       // Orange
        QColor(0xC1, 0x7D, 0x11),       // Chocolate
@@ -45,7 +45,7 @@ const QColor TracePalette::Colours[Cols * Rows] = {
        QColor(0xA3, 0x34, 0x96),       // Magenta
        QColor(0xCC, 0x00, 0x00),       // Scarlet Red
 
-       // Dark Colours
+       // Dark Colors
        QColor(0xC4, 0xA0, 0x00),       // Butter
        QColor(0xCE, 0x5C, 0x00),       // Orange
        QColor(0x8F, 0x59, 0x02),       // Chocolate
index c3a8701742f501fee481a8d653c1cb32300ebc8e..7819ee6c44dcde4576ed0ed4fd81b561df40a014 100644 (file)
@@ -31,7 +31,7 @@ class TracePalette
 public:
        static const unsigned int Cols = 8;
        static const unsigned int Rows = 4;
-       static const QColor Colours[Cols * Rows];
+       static const QColor Colors[Cols * Rows];
 };
 
 } // namespace trace
index 031bc5d9d3cb9a03d86eb5dc4736b78c66ef87e0..7ef5454a8a5ccb9aa3d64c500f0ca01f598e3368 100644 (file)
@@ -24,7 +24,7 @@ namespace pv {
 namespace views {
 namespace trace {
 
-const QColor TriggerMarker::Colour(0x00, 0x00, 0xB0);
+const QColor TriggerMarker::Color(0x00, 0x00, 0xB0);
 
 TriggerMarker::TriggerMarker(View &view, const pv::util::Timestamp& time) :
        TimeItem(view),
@@ -73,7 +73,7 @@ void TriggerMarker::paint_fore(QPainter &p, ViewItemPaintParams &pp)
        if (!enabled())
                return;
 
-       QPen pen(Colour);
+       QPen pen(Color);
        pen.setStyle(Qt::DashLine);
 
        const float x = get_x();
index f2cee265c5514579fa05f17a329f0210c658720e..9137f28c1f5b96886c032709bd6d3d32caf06580 100644 (file)
@@ -35,7 +35,7 @@ class TriggerMarker : public TimeItem
        Q_OBJECT
 
 public:
-       static const QColor Colour;
+       static const QColor Color;
 
 public:
        /**
index 8922922aa1c1e939f747b15327545acc84c6379e..861eac0f6065e7f4ef93c7e14039173dd9ad0235 100644 (file)
@@ -196,7 +196,7 @@ View::View(Session &session, bool is_main_view, QWidget *parent) :
 
        // Set up settings and event handlers
        GlobalSettings settings;
-       coloured_bg_ = settings.value(GlobalSettings::Key_View_ColouredBG).toBool();
+       colored_bg_ = settings.value(GlobalSettings::Key_View_ColoredBG).toBool();
 
        GlobalSettings::add_change_handler(this);
 
@@ -774,15 +774,15 @@ void View::enable_show_analog_minor_grid(bool state)
        viewport_->update();
 }
 
-void View::enable_coloured_bg(bool state)
+void View::enable_colored_bg(bool state)
 {
-       coloured_bg_ = state;
+       colored_bg_ = state;
        viewport_->update();
 }
 
-bool View::coloured_bg() const
+bool View::colored_bg() const
 {
-       return coloured_bg_;
+       return colored_bg_;
 }
 
 bool View::cursors_shown() const
index a351fd9306332f0169e917c16c6bbf2246a07368..8c41fd9e40692e504c9db06c39a26f4aa5a92f6d 100644 (file)
@@ -242,15 +242,15 @@ public:
        pair<pv::util::Timestamp, pv::util::Timestamp> get_time_extents() const;
 
        /**
-        * Enables or disables coloured trace backgrounds. If they're not
-        * coloured then they will use alternating colors.
+        * Enables or disables colored trace backgrounds. If they're not
+        * colored then they will use alternating colors.
         */
-       void enable_coloured_bg(bool state);
+       void enable_colored_bg(bool state);
 
        /**
-        * Returns true if the trace background should be drawn with a coloured background.
+        * Returns true if the trace background should be drawn with a colored background.
         */
-       bool coloured_bg() const;
+       bool colored_bg() const;
 
        /**
         * Enable or disable showing sampling points.
@@ -490,7 +490,7 @@ private:
        bool header_was_shrunk_;
 
        bool sticky_scrolling_;
-       bool coloured_bg_;
+       bool colored_bg_;
        bool always_zoom_to_fit_;
 
        pv::util::Timestamp tick_period_;
index 445f17958b06719ccdd66f66a2afc43c00b2ae83..2141687c92b12fc546bbe87346681a65655dc4d3 100644 (file)
@@ -130,7 +130,7 @@ void ViewItem::paint_fore(QPainter &p, ViewItemPaintParams &pp)
        (void)pp;
 }
 
-QColor ViewItem::select_text_colour(QColor background)
+QColor ViewItem::select_text_color(QColor background)
 {
        return (background.lightness() > 110) ? Qt::black : Qt::white;
 }
index 39cf034562fb0e11cb500e949a424d9265b47fad..f3e0f9b67f5470b6942ae52d10351a2c58ea5db2 100644 (file)
@@ -147,12 +147,12 @@ public:
 
 public:
        /**
-        * Gets the text colour.
-        * @remarks This colour is computed by comparing the lightness
-        * of the trace colour against a threshold to determine whether
+        * Gets the text color.
+        * @remarks This color is computed by comparing the lightness
+        * of the trace color against a threshold to determine whether
         * white or black would be more visible.
         */
-       static QColor select_text_colour(QColor background);
+       static QColor select_text_color(QColor background);
 
 public:
        virtual QMenu* create_context_menu(QWidget *parent);
index 2d9cfbb5ab42fe7fbc3dad7d62797d3e59e1ec7e..eb5a354546b1dc5a813d96beededd1adecfc7647 100644 (file)
@@ -33,7 +33,7 @@ ViewItemPaintParams::ViewItemPaintParams(
        rect_(rect),
        scale_(scale),
        offset_(offset),
-       bg_colour_state_(false)
+       bg_color_state_(false)
 {
        assert(scale > 0.0);
 }
index f39085ce6712e91ff678168dbb807175672f3ae6..725a4336bbcb4944d3ca09992ba9da293523ee6c 100644 (file)
@@ -75,9 +75,9 @@ public:
                return (offset_ / scale_).convert_to<double>();
        }
 
-       bool next_bg_colour_state() {
-               const bool state = bg_colour_state_;
-               bg_colour_state_ = !bg_colour_state_;
+       bool next_bg_color_state() {
+               const bool state = bg_color_state_;
+               bg_color_state_ = !bg_color_state_;
                return state;
        }
 
@@ -90,7 +90,7 @@ private:
        QRect rect_;
        double scale_;
        pv::util::Timestamp offset_;
-       bool bg_colour_state_;
+       bool bg_color_state_;
 };
 
 } // namespace trace
diff --git a/pv/widgets/colorbutton.cpp b/pv/widgets/colorbutton.cpp
new file mode 100644 (file)
index 0000000..c9230d9
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "colorbutton.hpp"
+
+#include <cassert>
+
+#include <QApplication>
+#include <QPainter>
+
+namespace pv {
+namespace widgets {
+
+const int ColorButton::SwatchMargin = 7;
+
+ColorButton::ColorButton(int rows, int cols, QWidget *parent) :
+       QPushButton("", parent),
+       popup_(rows, cols, this)
+{
+       connect(this, SIGNAL(clicked(bool)), this, SLOT(on_clicked(bool)));
+       connect(&popup_, SIGNAL(selected(int, int)),
+               this, SLOT(on_selected(int, int)));
+}
+
+ColorPopup& ColorButton::popup()
+{
+       return popup_;
+}
+
+const QColor& ColorButton::color() const
+{
+       return cur_color_;
+}
+
+void ColorButton::set_color(QColor color)
+{
+       cur_color_ = color;
+
+       const unsigned int rows = popup_.well_array().numRows();
+       const unsigned int cols = popup_.well_array().numCols();
+
+       for (unsigned int r = 0; r < rows; r++)
+               for (unsigned int c = 0; c < cols; c++)
+                       if (popup_.well_array().cellBrush(r, c).color() == color) {
+                               popup_.well_array().setSelected(r, c);
+                               popup_.well_array().setCurrent(r, c);
+                               return;
+                       }
+}
+
+void ColorButton::set_palette(const QColor *const palette)
+{
+       assert(palette);
+
+       const unsigned int rows = popup_.well_array().numRows();
+       const unsigned int cols = popup_.well_array().numCols();
+
+       for (unsigned int r = 0; r < rows; r++)
+               for (unsigned int c = 0; c < cols; c++)
+                       popup_.well_array().setCellBrush(r, c,
+                               QBrush(palette[r * cols + c]));
+}
+
+void ColorButton::on_clicked(bool)
+{
+       popup_.set_position(mapToGlobal(rect().center()), Popup::Bottom);
+       popup_.show();
+}
+
+void ColorButton::on_selected(int row, int col)
+{
+       cur_color_ = popup_.well_array().cellBrush(row, col).color();
+       selected(cur_color_);
+}
+
+void ColorButton::paintEvent(QPaintEvent *event)
+{
+       QPushButton::paintEvent(event);
+
+       QPainter p(this);
+
+       const QRect r = rect().adjusted(SwatchMargin, SwatchMargin,
+               -SwatchMargin, -SwatchMargin);
+       p.setPen(QApplication::palette().color(QPalette::Dark));
+       p.setBrush(QBrush(cur_color_));
+       p.drawRect(r);
+}
+
+}  // namespace widgets
+}  // namespace pv
diff --git a/pv/widgets/colorbutton.hpp b/pv/widgets/colorbutton.hpp
new file mode 100644 (file)
index 0000000..37cd6e7
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_COLORBUTTON_HPP
+#define PULSEVIEW_PV_WIDGETS_COLORBUTTON_HPP
+
+#include <QPushButton>
+
+#include "colorpopup.hpp"
+
+namespace pv {
+namespace widgets {
+
+class ColorButton : public QPushButton
+{
+       Q_OBJECT;
+
+private:
+       static const int SwatchMargin;
+
+public:
+       ColorButton(int rows, int cols, QWidget *parent);
+
+       ColorPopup& popup();
+
+       const QColor& color() const;
+
+       void set_color(QColor color);
+
+       void set_palette(const QColor *const palette);
+
+private:
+       void paintEvent(QPaintEvent *event);
+
+private Q_SLOTS:
+       void on_clicked(bool);
+
+       void on_selected(int row, int col);
+
+Q_SIGNALS:
+       void selected(const QColor &color);
+
+private:
+       ColorPopup popup_;
+       QColor cur_color_;
+};
+
+}  // namespace widgets
+}  // namespace pv
+
+#endif // PULSEVIEW_PV_WIDGETS_COLORBUTTON_HPP
diff --git a/pv/widgets/colorpopup.cpp b/pv/widgets/colorpopup.cpp
new file mode 100644 (file)
index 0000000..c4f914e
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "colorpopup.hpp"
+
+namespace pv {
+namespace widgets {
+
+ColorPopup::ColorPopup(int rows, int cols, QWidget *parent) :
+       Popup(parent),
+       well_array_(rows, cols, this),
+       layout_(this)
+{
+       layout_.addWidget(&well_array_);
+       setLayout(&layout_);
+
+       connect(&well_array_, SIGNAL(selected(int, int)),
+               this, SIGNAL(selected(int, int)));
+       connect(&well_array_, SIGNAL(selected(int, int)),
+               this, SLOT(color_selected(int, int)));
+}
+
+WellArray& ColorPopup::well_array()
+{
+       return well_array_;
+}
+
+void ColorPopup::color_selected(int, int)
+{
+       close();
+}
+
+}  // namespace widgets
+}  // namespace pv
diff --git a/pv/widgets/colorpopup.hpp b/pv/widgets/colorpopup.hpp
new file mode 100644 (file)
index 0000000..23fd746
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_COLORPOPUP_HPP
+#define PULSEVIEW_PV_WIDGETS_COLORPOPUP_HPP
+
+#include "popup.hpp"
+#include "wellarray.hpp"
+
+#include <QVBoxLayout>
+
+namespace pv {
+namespace widgets {
+
+class ColorPopup : public Popup
+{
+       Q_OBJECT
+
+public:
+       ColorPopup(int rows, int cols, QWidget *parent);
+
+       WellArray& well_array();
+
+Q_SIGNALS:
+       void selected(int row, int col);
+
+private Q_SLOTS:
+       void color_selected(int, int);
+
+private:
+       WellArray well_array_;
+       QVBoxLayout layout_;
+};
+
+}  // namespace widgets
+}  // namespace pv
+
+#endif // PULSEVIEW_PV_WIDGETS_COLORPOPUP_HPP
diff --git a/pv/widgets/colourbutton.cpp b/pv/widgets/colourbutton.cpp
deleted file mode 100644 (file)
index 01a22b6..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "colourbutton.hpp"
-
-#include <cassert>
-
-#include <QApplication>
-#include <QPainter>
-
-namespace pv {
-namespace widgets {
-
-const int ColourButton::SwatchMargin = 7;
-
-ColourButton::ColourButton(int rows, int cols, QWidget *parent) :
-       QPushButton("", parent),
-       popup_(rows, cols, this)
-{
-       connect(this, SIGNAL(clicked(bool)), this, SLOT(on_clicked(bool)));
-       connect(&popup_, SIGNAL(selected(int, int)),
-               this, SLOT(on_selected(int, int)));
-}
-
-ColourPopup& ColourButton::popup()
-{
-       return popup_;
-}
-
-const QColor& ColourButton::colour() const
-{
-       return cur_colour_;
-}
-
-void ColourButton::set_colour(QColor colour)
-{
-       cur_colour_ = colour;
-
-       const unsigned int rows = popup_.well_array().numRows();
-       const unsigned int cols = popup_.well_array().numCols();
-
-       for (unsigned int r = 0; r < rows; r++)
-               for (unsigned int c = 0; c < cols; c++)
-                       if (popup_.well_array().cellBrush(r, c).color() == colour) {
-                               popup_.well_array().setSelected(r, c);
-                               popup_.well_array().setCurrent(r, c);
-                               return;
-                       }
-}
-
-void ColourButton::set_palette(const QColor *const palette)
-{
-       assert(palette);
-
-       const unsigned int rows = popup_.well_array().numRows();
-       const unsigned int cols = popup_.well_array().numCols();
-
-       for (unsigned int r = 0; r < rows; r++)
-               for (unsigned int c = 0; c < cols; c++)
-                       popup_.well_array().setCellBrush(r, c,
-                               QBrush(palette[r * cols + c]));
-}
-
-void ColourButton::on_clicked(bool)
-{
-       popup_.set_position(mapToGlobal(rect().center()), Popup::Bottom);
-       popup_.show();
-}
-
-void ColourButton::on_selected(int row, int col)
-{
-       cur_colour_ = popup_.well_array().cellBrush(row, col).color();
-       selected(cur_colour_);
-}
-
-void ColourButton::paintEvent(QPaintEvent *event)
-{
-       QPushButton::paintEvent(event);
-
-       QPainter p(this);
-
-       const QRect r = rect().adjusted(SwatchMargin, SwatchMargin,
-               -SwatchMargin, -SwatchMargin);
-       p.setPen(QApplication::palette().color(QPalette::Dark));
-       p.setBrush(QBrush(cur_colour_));
-       p.drawRect(r);
-}
-
-}  // namespace widgets
-}  // namespace pv
diff --git a/pv/widgets/colourbutton.hpp b/pv/widgets/colourbutton.hpp
deleted file mode 100644 (file)
index 9dbb2b2..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef PULSEVIEW_PV_WIDGETS_COLOURBUTTON_HPP
-#define PULSEVIEW_PV_WIDGETS_COLOURBUTTON_HPP
-
-#include <QPushButton>
-
-#include "colourpopup.hpp"
-
-namespace pv {
-namespace widgets {
-
-class ColourButton : public QPushButton
-{
-       Q_OBJECT;
-
-private:
-       static const int SwatchMargin;
-
-public:
-       ColourButton(int rows, int cols, QWidget *parent);
-
-       ColourPopup& popup();
-
-       const QColor& colour() const;
-
-       void set_colour(QColor colour);
-
-       void set_palette(const QColor *const palette);
-
-private:
-       void paintEvent(QPaintEvent *event);
-
-private Q_SLOTS:
-       void on_clicked(bool);
-
-       void on_selected(int row, int col);
-
-Q_SIGNALS:
-       void selected(const QColor &colour);
-
-private:
-       ColourPopup popup_;
-       QColor cur_colour_;
-};
-
-}  // namespace widgets
-}  // namespace pv
-
-#endif // PULSEVIEW_PV_WIDGETS_COLOURBUTTON_HPP
diff --git a/pv/widgets/colourpopup.cpp b/pv/widgets/colourpopup.cpp
deleted file mode 100644 (file)
index 170385b..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "colourpopup.hpp"
-
-namespace pv {
-namespace widgets {
-
-ColourPopup::ColourPopup(int rows, int cols, QWidget *parent) :
-       Popup(parent),
-       well_array_(rows, cols, this),
-       layout_(this)
-{
-       layout_.addWidget(&well_array_);
-       setLayout(&layout_);
-
-       connect(&well_array_, SIGNAL(selected(int, int)),
-               this, SIGNAL(selected(int, int)));
-       connect(&well_array_, SIGNAL(selected(int, int)),
-               this, SLOT(colour_selected(int, int)));
-}
-
-WellArray& ColourPopup::well_array()
-{
-       return well_array_;
-}
-
-void ColourPopup::colour_selected(int, int)
-{
-       close();
-}
-
-}  // namespace widgets
-}  // namespace pv
diff --git a/pv/widgets/colourpopup.hpp b/pv/widgets/colourpopup.hpp
deleted file mode 100644 (file)
index 6e4de20..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef PULSEVIEW_PV_WIDGETS_COLOURPOPUP_HPP
-#define PULSEVIEW_PV_WIDGETS_COLOURPOPUP_HPP
-
-#include "popup.hpp"
-#include "wellarray.hpp"
-
-#include <QVBoxLayout>
-
-namespace pv {
-namespace widgets {
-
-class ColourPopup : public Popup
-{
-       Q_OBJECT
-
-public:
-       ColourPopup(int rows, int cols, QWidget *parent);
-
-       WellArray& well_array();
-
-Q_SIGNALS:
-       void selected(int row, int col);
-
-private Q_SLOTS:
-       void colour_selected(int, int);
-
-private:
-       WellArray well_array_;
-       QVBoxLayout layout_;
-};
-
-}  // namespace widgets
-}  // namespace pv
-
-#endif // PULSEVIEW_PV_WIDGETS_COLOURPOPUP_HPP
index b4d3458f52a24cb2e2042a28422348622a26c3bd..5b38269fb855b9f77d03e3bfb8cf9c7ac301324c 100644 (file)
@@ -80,8 +80,8 @@ set(pulseview_TEST_SOURCES
        ${PROJECT_SOURCE_DIR}/pv/views/trace/viewwidget.cpp
        ${PROJECT_SOURCE_DIR}/pv/views/viewbase.cpp
        ${PROJECT_SOURCE_DIR}/pv/views/trace/standardbar.cpp
-       ${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.cpp
-       ${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.cpp
+       ${PROJECT_SOURCE_DIR}/pv/widgets/colorbutton.cpp
+       ${PROJECT_SOURCE_DIR}/pv/widgets/colorpopup.cpp
        ${PROJECT_SOURCE_DIR}/pv/widgets/devicetoolbutton.cpp
        ${PROJECT_SOURCE_DIR}/pv/widgets/exportmenu.cpp
        ${PROJECT_SOURCE_DIR}/pv/widgets/importmenu.cpp
@@ -147,8 +147,8 @@ set(pulseview_TEST_HEADERS
        ${PROJECT_SOURCE_DIR}/pv/views/trace/viewwidget.hpp
        ${PROJECT_SOURCE_DIR}/pv/views/viewbase.hpp
        ${PROJECT_SOURCE_DIR}/pv/views/trace/standardbar.hpp
-       ${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.hpp
-       ${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.hpp
+       ${PROJECT_SOURCE_DIR}/pv/widgets/colorbutton.hpp
+       ${PROJECT_SOURCE_DIR}/pv/widgets/colorpopup.hpp
        ${PROJECT_SOURCE_DIR}/pv/widgets/devicetoolbutton.hpp
        ${PROJECT_SOURCE_DIR}/pv/widgets/exportmenu.hpp
        ${PROJECT_SOURCE_DIR}/pv/widgets/importmenu.hpp