From 641574bcc118be0b6dc3a65039ab3497f9d7241a Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Tue, 10 Apr 2018 19:57:35 +0200 Subject: [PATCH] Rename colour* to color* --- CMakeLists.txt | 8 +-- pv/data/signalbase.cpp | 24 +++---- pv/data/signalbase.hpp | 18 +++--- pv/dialogs/settings.cpp | 10 +-- pv/dialogs/settings.hpp | 2 +- pv/globalsettings.cpp | 8 +-- pv/globalsettings.hpp | 2 +- pv/mainwindow.cpp | 20 +++--- pv/mainwindow.hpp | 6 +- pv/views/trace/analogsignal.cpp | 34 +++++----- pv/views/trace/analogsignal.hpp | 10 +-- pv/views/trace/cursor.cpp | 4 +- pv/views/trace/cursor.hpp | 2 +- pv/views/trace/cursorpair.cpp | 20 +++--- pv/views/trace/cursorpair.hpp | 2 +- pv/views/trace/decodetrace.cpp | 62 +++++++++---------- pv/views/trace/decodetrace.hpp | 16 ++--- pv/views/trace/flag.cpp | 6 +- pv/views/trace/flag.hpp | 2 +- pv/views/trace/logicsignal.cpp | 26 ++++---- pv/views/trace/logicsignal.hpp | 12 ++-- pv/views/trace/signal.cpp | 2 +- pv/views/trace/timemarker.cpp | 14 ++--- pv/views/trace/timemarker.hpp | 6 +- pv/views/trace/trace.cpp | 60 +++++++++--------- pv/views/trace/trace.hpp | 14 ++--- pv/views/trace/tracegroup.cpp | 6 +- pv/views/trace/tracegroup.hpp | 2 +- pv/views/trace/tracepalette.cpp | 8 +-- pv/views/trace/tracepalette.hpp | 2 +- pv/views/trace/triggermarker.cpp | 4 +- pv/views/trace/triggermarker.hpp | 2 +- pv/views/trace/view.cpp | 10 +-- pv/views/trace/view.hpp | 12 ++-- pv/views/trace/viewitem.cpp | 2 +- pv/views/trace/viewitem.hpp | 8 +-- pv/views/trace/viewitempaintparams.cpp | 2 +- pv/views/trace/viewitempaintparams.hpp | 8 +-- .../{colourbutton.cpp => colorbutton.cpp} | 32 +++++----- .../{colourbutton.hpp => colorbutton.hpp} | 24 +++---- .../{colourpopup.cpp => colorpopup.cpp} | 10 +-- .../{colourpopup.hpp => colorpopup.hpp} | 12 ++-- test/CMakeLists.txt | 8 +-- 43 files changed, 271 insertions(+), 271 deletions(-) rename pv/widgets/{colourbutton.cpp => colorbutton.cpp} (75%) rename pv/widgets/{colourbutton.hpp => colorbutton.hpp} (72%) rename pv/widgets/{colourpopup.cpp => colorpopup.cpp} (84%) rename pv/widgets/{colourpopup.hpp => colorpopup.hpp} (81%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e81a60..252f902 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/pv/data/signalbase.cpp b/pv/data/signalbase.cpp index 5f6dc39..eb2996d 100644 --- a/pv/data/signalbase.cpp +++ b/pv/data/signalbase.cpp @@ -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 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()); + set_color(settings.value("color").value()); set_conversion_type((ConversionType)settings.value("conversion_type").toInt()); int conv_options = settings.value("conv_options").toInt(); diff --git a/pv/data/signalbase.hpp b/pv/data/signalbase.hpp index 3356af5..b6f69ef 100644 --- a/pv/data/signalbase.hpp +++ b/pv/data/signalbase.hpp @@ -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 diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index b0ef922..4744567 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -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) diff --git a/pv/dialogs/settings.hpp b/pv/dialogs/settings.hpp index 71fbaf4..f1925b4 100644 --- a/pv/dialogs/settings.hpp +++ b/pv/dialogs/settings.hpp @@ -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); diff --git a/pv/globalsettings.cpp b/pv/globalsettings.cpp index 088a6e2..9f20b26 100644 --- a/pv/globalsettings.cpp +++ b/pv/globalsettings.cpp @@ -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)) diff --git a/pv/globalsettings.hpp b/pv/globalsettings.hpp index 51212b0..b7f7af0 100644 --- a/pv/globalsettings.hpp +++ b/pv/globalsettings.hpp @@ -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; diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index c08576c..4fe483e 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -185,7 +185,7 @@ shared_ptr MainWindow::add_view(const QString &title, views::trace::View *tv = qobject_cast(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(viewbase.get()); if (view) - view->enable_coloured_bg(state); + view->enable_colored_bg(state); } } diff --git a/pv/mainwindow.hpp b/pv/mainwindow.hpp index 5f4609d..6d92b27 100644 --- a/pv/mainwindow.hpp +++ b/pv/mainwindow.hpp @@ -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_; diff --git a/pv/views/trace/analogsignal.cpp b/pv/views/trace/analogsignal.cpp index 43d1175..8a05572 100644 --- a/pv/views/trace/analogsignal.cpp +++ b/pv/views/trace/analogsignal.cpp @@ -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()); } } diff --git a/pv/views/trace/analogsignal.hpp b/pv/views/trace/analogsignal.hpp index 97d5160..6afc394 100644 --- a/pv/views/trace/analogsignal.hpp +++ b/pv/views/trace/analogsignal.hpp @@ -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; diff --git a/pv/views/trace/cursor.cpp b/pv/views/trace/cursor.cpp index 88c4ebf..7a375c7 100644 --- a/pv/views/trace/cursor.cpp +++ b/pv/views/trace/cursor.cpp @@ -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) { } diff --git a/pv/views/trace/cursor.hpp b/pv/views/trace/cursor.hpp index ad91b05..c3960d6 100644 --- a/pv/views/trace/cursor.hpp +++ b/pv/views/trace/cursor.hpp @@ -39,7 +39,7 @@ class Cursor : public TimeMarker Q_OBJECT public: - static const QColor FillColour; + static const QColor FillColor; public: /** diff --git a/pv/views/trace/cursorpair.cpp b/pv/views/trace/cursorpair.cpp index 2ddecb2..86198c5 100644 --- a/pv/views/trace/cursorpair.cpp +++ b/pv/views/trace/cursorpair.cpp @@ -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 offsets(get_cursor_offsets()); const int l = (int)max(min( diff --git a/pv/views/trace/cursorpair.hpp b/pv/views/trace/cursorpair.hpp index 5d53bac..12a9d7f 100644 --- a/pv/views/trace/cursorpair.hpp +++ b/pv/views/trace/cursorpair.hpp @@ -39,7 +39,7 @@ class CursorPair : public TimeItem { private: static const int DeltaPadding; - static const QColor ViewportFillColour; + static const QColor ViewportFillColor; public: /** diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index bf31a72..b05bcb0 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -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 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 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 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 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 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); } diff --git a/pv/views/trace/decodetrace.hpp b/pv/views/trace/decodetrace.hpp index 4347387..410ea62 100644 --- a/pv/views/trace/decodetrace.hpp +++ b/pv/views/trace/decodetrace.hpp @@ -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 signalbase, @@ -132,14 +132,14 @@ public: private: void draw_annotations(vector 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 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; diff --git a/pv/views/trace/flag.cpp b/pv/views/trace/flag.cpp index f5579ca..1cdaea8 100644 --- a/pv/views/trace/flag.cpp +++ b/pv/views/trace/flag.cpp @@ -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) { } diff --git a/pv/views/trace/flag.hpp b/pv/views/trace/flag.hpp index 2df13ca..150d37e 100644 --- a/pv/views/trace/flag.hpp +++ b/pv/views/trace/flag.hpp @@ -41,7 +41,7 @@ class Flag : public TimeMarker, public enable_shared_from_this Q_OBJECT public: - static const QColor FillColour; + static const QColor FillColor; public: /** diff --git a/pv/views/trace/logicsignal.cpp b/pv/views/trace/logicsignal.cpp index 10a5bd4..77e92c0 100644 --- a/pv/views/trace/logicsignal.cpp +++ b/pv/views/trace/logicsignal.cpp @@ -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; - 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); diff --git a/pv/views/trace/logicsignal.hpp b/pv/views/trace/logicsignal.hpp index 4a52d37..e49d69b 100644 --- a/pv/views/trace/logicsignal.hpp +++ b/pv/views/trace/logicsignal.hpp @@ -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]; diff --git a/pv/views/trace/signal.cpp b/pv/views/trace/signal.cpp index 1e277f0..e6c2594 100644 --- a/pv/views/trace/signal.cpp +++ b/pv/views/trace/signal.cpp @@ -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) diff --git a/pv/views/trace/timemarker.cpp b/pv/views/trace/timemarker.cpp index 0718f3c..65b9481 100644 --- a/pv/views/trace/timemarker.cpp +++ b/pv/views/trace/timemarker.cpp @@ -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())); } diff --git a/pv/views/trace/timemarker.hpp b/pv/views/trace/timemarker.hpp index 1a2abb3..48afc16 100644 --- a/pv/views/trace/timemarker.hpp +++ b/pv/views/trace/timemarker.hpp @@ -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_; diff --git a/pv/views/trace/trace.cpp b/pv/views/trace/trace.cpp index 91fde47..cc91fff 100644 --- a/pv/views/trace/trace.cpp +++ b/pv/views/trace/trace.cpp @@ -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 channel) : base_(channel), @@ -58,8 +58,8 @@ Trace::Trace(shared_ptr 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 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 diff --git a/pv/views/trace/trace.hpp b/pv/views/trace/trace.hpp index 134f110..a9ccd7b 100644 --- a/pv/views/trace/trace.hpp +++ b/pv/views/trace/trace.hpp @@ -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 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 base_; diff --git a/pv/views/trace/tracegroup.cpp b/pv/views/trace/tracegroup.cpp index daf0c67..3fbb864 100644 --- a/pv/views/trace/tracegroup.cpp +++ b/pv/views/trace/tracegroup.cpp @@ -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)); diff --git a/pv/views/trace/tracegroup.hpp b/pv/views/trace/tracegroup.hpp index 48b1bf2..a1cc6fd 100644 --- a/pv/views/trace/tracegroup.hpp +++ b/pv/views/trace/tracegroup.hpp @@ -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: /** diff --git a/pv/views/trace/tracepalette.cpp b/pv/views/trace/tracepalette.cpp index 762eafc..e049731 100644 --- a/pv/views/trace/tracepalette.cpp +++ b/pv/views/trace/tracepalette.cpp @@ -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 diff --git a/pv/views/trace/tracepalette.hpp b/pv/views/trace/tracepalette.hpp index c3a8701..7819ee6 100644 --- a/pv/views/trace/tracepalette.hpp +++ b/pv/views/trace/tracepalette.hpp @@ -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 diff --git a/pv/views/trace/triggermarker.cpp b/pv/views/trace/triggermarker.cpp index 031bc5d..7ef5454 100644 --- a/pv/views/trace/triggermarker.cpp +++ b/pv/views/trace/triggermarker.cpp @@ -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(); diff --git a/pv/views/trace/triggermarker.hpp b/pv/views/trace/triggermarker.hpp index f2cee26..9137f28 100644 --- a/pv/views/trace/triggermarker.hpp +++ b/pv/views/trace/triggermarker.hpp @@ -35,7 +35,7 @@ class TriggerMarker : public TimeItem Q_OBJECT public: - static const QColor Colour; + static const QColor Color; public: /** diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp index 8922922..861eac0 100644 --- a/pv/views/trace/view.cpp +++ b/pv/views/trace/view.cpp @@ -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 diff --git a/pv/views/trace/view.hpp b/pv/views/trace/view.hpp index a351fd9..8c41fd9 100644 --- a/pv/views/trace/view.hpp +++ b/pv/views/trace/view.hpp @@ -242,15 +242,15 @@ public: pair 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_; diff --git a/pv/views/trace/viewitem.cpp b/pv/views/trace/viewitem.cpp index 445f179..2141687 100644 --- a/pv/views/trace/viewitem.cpp +++ b/pv/views/trace/viewitem.cpp @@ -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; } diff --git a/pv/views/trace/viewitem.hpp b/pv/views/trace/viewitem.hpp index 39cf034..f3e0f9b 100644 --- a/pv/views/trace/viewitem.hpp +++ b/pv/views/trace/viewitem.hpp @@ -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); diff --git a/pv/views/trace/viewitempaintparams.cpp b/pv/views/trace/viewitempaintparams.cpp index 2d9cfbb..eb5a354 100644 --- a/pv/views/trace/viewitempaintparams.cpp +++ b/pv/views/trace/viewitempaintparams.cpp @@ -33,7 +33,7 @@ ViewItemPaintParams::ViewItemPaintParams( rect_(rect), scale_(scale), offset_(offset), - bg_colour_state_(false) + bg_color_state_(false) { assert(scale > 0.0); } diff --git a/pv/views/trace/viewitempaintparams.hpp b/pv/views/trace/viewitempaintparams.hpp index f39085c..725a433 100644 --- a/pv/views/trace/viewitempaintparams.hpp +++ b/pv/views/trace/viewitempaintparams.hpp @@ -75,9 +75,9 @@ public: return (offset_ / scale_).convert_to(); } - 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/colourbutton.cpp b/pv/widgets/colorbutton.cpp similarity index 75% rename from pv/widgets/colourbutton.cpp rename to pv/widgets/colorbutton.cpp index 01a22b6..c9230d9 100644 --- a/pv/widgets/colourbutton.cpp +++ b/pv/widgets/colorbutton.cpp @@ -17,7 +17,7 @@ * along with this program; if not, see . */ -#include "colourbutton.hpp" +#include "colorbutton.hpp" #include @@ -27,9 +27,9 @@ namespace pv { namespace widgets { -const int ColourButton::SwatchMargin = 7; +const int ColorButton::SwatchMargin = 7; -ColourButton::ColourButton(int rows, int cols, QWidget *parent) : +ColorButton::ColorButton(int rows, int cols, QWidget *parent) : QPushButton("", parent), popup_(rows, cols, this) { @@ -38,33 +38,33 @@ ColourButton::ColourButton(int rows, int cols, QWidget *parent) : this, SLOT(on_selected(int, int))); } -ColourPopup& ColourButton::popup() +ColorPopup& ColorButton::popup() { return popup_; } -const QColor& ColourButton::colour() const +const QColor& ColorButton::color() const { - return cur_colour_; + return cur_color_; } -void ColourButton::set_colour(QColor colour) +void ColorButton::set_color(QColor color) { - cur_colour_ = colour; + 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() == colour) { + if (popup_.well_array().cellBrush(r, c).color() == color) { popup_.well_array().setSelected(r, c); popup_.well_array().setCurrent(r, c); return; } } -void ColourButton::set_palette(const QColor *const palette) +void ColorButton::set_palette(const QColor *const palette) { assert(palette); @@ -77,19 +77,19 @@ void ColourButton::set_palette(const QColor *const palette) QBrush(palette[r * cols + c])); } -void ColourButton::on_clicked(bool) +void ColorButton::on_clicked(bool) { popup_.set_position(mapToGlobal(rect().center()), Popup::Bottom); popup_.show(); } -void ColourButton::on_selected(int row, int col) +void ColorButton::on_selected(int row, int col) { - cur_colour_ = popup_.well_array().cellBrush(row, col).color(); - selected(cur_colour_); + cur_color_ = popup_.well_array().cellBrush(row, col).color(); + selected(cur_color_); } -void ColourButton::paintEvent(QPaintEvent *event) +void ColorButton::paintEvent(QPaintEvent *event) { QPushButton::paintEvent(event); @@ -98,7 +98,7 @@ void ColourButton::paintEvent(QPaintEvent *event) const QRect r = rect().adjusted(SwatchMargin, SwatchMargin, -SwatchMargin, -SwatchMargin); p.setPen(QApplication::palette().color(QPalette::Dark)); - p.setBrush(QBrush(cur_colour_)); + p.setBrush(QBrush(cur_color_)); p.drawRect(r); } diff --git a/pv/widgets/colourbutton.hpp b/pv/widgets/colorbutton.hpp similarity index 72% rename from pv/widgets/colourbutton.hpp rename to pv/widgets/colorbutton.hpp index 9dbb2b2..37cd6e7 100644 --- a/pv/widgets/colourbutton.hpp +++ b/pv/widgets/colorbutton.hpp @@ -17,17 +17,17 @@ * along with this program; if not, see . */ -#ifndef PULSEVIEW_PV_WIDGETS_COLOURBUTTON_HPP -#define PULSEVIEW_PV_WIDGETS_COLOURBUTTON_HPP +#ifndef PULSEVIEW_PV_WIDGETS_COLORBUTTON_HPP +#define PULSEVIEW_PV_WIDGETS_COLORBUTTON_HPP #include -#include "colourpopup.hpp" +#include "colorpopup.hpp" namespace pv { namespace widgets { -class ColourButton : public QPushButton +class ColorButton : public QPushButton { Q_OBJECT; @@ -35,13 +35,13 @@ private: static const int SwatchMargin; public: - ColourButton(int rows, int cols, QWidget *parent); + ColorButton(int rows, int cols, QWidget *parent); - ColourPopup& popup(); + ColorPopup& popup(); - const QColor& colour() const; + const QColor& color() const; - void set_colour(QColor colour); + void set_color(QColor color); void set_palette(const QColor *const palette); @@ -54,14 +54,14 @@ private Q_SLOTS: void on_selected(int row, int col); Q_SIGNALS: - void selected(const QColor &colour); + void selected(const QColor &color); private: - ColourPopup popup_; - QColor cur_colour_; + ColorPopup popup_; + QColor cur_color_; }; } // namespace widgets } // namespace pv -#endif // PULSEVIEW_PV_WIDGETS_COLOURBUTTON_HPP +#endif // PULSEVIEW_PV_WIDGETS_COLORBUTTON_HPP diff --git a/pv/widgets/colourpopup.cpp b/pv/widgets/colorpopup.cpp similarity index 84% rename from pv/widgets/colourpopup.cpp rename to pv/widgets/colorpopup.cpp index 170385b..c4f914e 100644 --- a/pv/widgets/colourpopup.cpp +++ b/pv/widgets/colorpopup.cpp @@ -17,12 +17,12 @@ * along with this program; if not, see . */ -#include "colourpopup.hpp" +#include "colorpopup.hpp" namespace pv { namespace widgets { -ColourPopup::ColourPopup(int rows, int cols, QWidget *parent) : +ColorPopup::ColorPopup(int rows, int cols, QWidget *parent) : Popup(parent), well_array_(rows, cols, this), layout_(this) @@ -33,15 +33,15 @@ ColourPopup::ColourPopup(int rows, int cols, QWidget *parent) : 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))); + this, SLOT(color_selected(int, int))); } -WellArray& ColourPopup::well_array() +WellArray& ColorPopup::well_array() { return well_array_; } -void ColourPopup::colour_selected(int, int) +void ColorPopup::color_selected(int, int) { close(); } diff --git a/pv/widgets/colourpopup.hpp b/pv/widgets/colorpopup.hpp similarity index 81% rename from pv/widgets/colourpopup.hpp rename to pv/widgets/colorpopup.hpp index 6e4de20..23fd746 100644 --- a/pv/widgets/colourpopup.hpp +++ b/pv/widgets/colorpopup.hpp @@ -17,8 +17,8 @@ * along with this program; if not, see . */ -#ifndef PULSEVIEW_PV_WIDGETS_COLOURPOPUP_HPP -#define PULSEVIEW_PV_WIDGETS_COLOURPOPUP_HPP +#ifndef PULSEVIEW_PV_WIDGETS_COLORPOPUP_HPP +#define PULSEVIEW_PV_WIDGETS_COLORPOPUP_HPP #include "popup.hpp" #include "wellarray.hpp" @@ -28,12 +28,12 @@ namespace pv { namespace widgets { -class ColourPopup : public Popup +class ColorPopup : public Popup { Q_OBJECT public: - ColourPopup(int rows, int cols, QWidget *parent); + ColorPopup(int rows, int cols, QWidget *parent); WellArray& well_array(); @@ -41,7 +41,7 @@ Q_SIGNALS: void selected(int row, int col); private Q_SLOTS: - void colour_selected(int, int); + void color_selected(int, int); private: WellArray well_array_; @@ -51,4 +51,4 @@ private: } // namespace widgets } // namespace pv -#endif // PULSEVIEW_PV_WIDGETS_COLOURPOPUP_HPP +#endif // PULSEVIEW_PV_WIDGETS_COLORPOPUP_HPP diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b4d3458..5b38269 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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 -- 2.30.2