diff options
Diffstat (limited to 'qt/ScintillaEditBase')
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 52 | ||||
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.h | 20 | ||||
-rw-r--r-- | qt/ScintillaEditBase/ScintillaEditBase.cpp | 8 |
3 files changed, 40 insertions, 40 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index ee4d7be80..d5475f4bd 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -230,24 +230,24 @@ bool SurfaceImpl::Initialised() return device != nullptr; } -void SurfaceImpl::PenColour(ColourAlpha fore) +void SurfaceImpl::PenColour(ColourRGBA fore) { - QPen penOutline(QColorFromColourAlpha(fore)); + QPen penOutline(QColorFromColourRGBA(fore)); penOutline.setCapStyle(Qt::FlatCap); GetPainter()->setPen(penOutline); } -void SurfaceImpl::PenColourWidth(ColourAlpha fore, XYPOSITION strokeWidth) { - QPen penOutline(QColorFromColourAlpha(fore)); +void SurfaceImpl::PenColourWidth(ColourRGBA fore, XYPOSITION strokeWidth) { + QPen penOutline(QColorFromColourRGBA(fore)); penOutline.setCapStyle(Qt::FlatCap); penOutline.setJoinStyle(Qt::MiterJoin); penOutline.setWidthF(strokeWidth); GetPainter()->setPen(penOutline); } -void SurfaceImpl::BrushColour(ColourAlpha back) +void SurfaceImpl::BrushColour(ColourRGBA back) { - GetPainter()->setBrush(QBrush(QColorFromColourAlpha(back))); + GetPainter()->setBrush(QBrush(QColorFromColourRGBA(back))); } void SurfaceImpl::SetCodec(const Font *font) @@ -334,7 +334,7 @@ void SurfaceImpl::RectangleFrame(PRectangle rc, Stroke stroke) { void SurfaceImpl::FillRectangle(PRectangle rc, Fill fill) { - GetPainter()->fillRect(QRectFFromPRect(rc), QColorFromColourAlpha(fill.colour)); + GetPainter()->fillRect(QRectFFromPRect(rc), QColorFromColourRGBA(fill.colour)); } void SurfaceImpl::FillRectangleAligned(PRectangle rc, Fill fill) @@ -370,7 +370,7 @@ void SurfaceImpl::RoundedRectangle(PRectangle rc, FillStroke fillStroke) void SurfaceImpl::AlphaRectangle(PRectangle rc, XYPOSITION cornerSize, FillStroke fillStroke) { - QColor qFill = QColorFromColourAlpha(fillStroke.fill.colour); + QColor qFill = QColorFromColourRGBA(fillStroke.fill.colour); QBrush brushFill(qFill); GetPainter()->setBrush(brushFill); if (fillStroke.fill.colour == fillStroke.stroke.colour) { @@ -384,7 +384,7 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, XYPOSITION cornerSize, FillStrok GetPainter()->fillRect(rect, brushFill); } } else { - QColor qOutline = QColorFromColourAlpha(fillStroke.stroke.colour); + QColor qOutline = QColorFromColourRGBA(fillStroke.stroke.colour); QPen penOutline(qOutline); penOutline.setWidthF(fillStroke.stroke.width); GetPainter()->setPen(penOutline); @@ -414,7 +414,7 @@ void SurfaceImpl::GradientRectangle(PRectangle rc, const std::vector<ColourStop> } linearGradient.setSpread(QGradient::RepeatSpread); for (const ColourStop &stop : stops) { - linearGradient.setColorAt(stop.position, QColorFromColourAlpha(stop.colour)); + linearGradient.setColorAt(stop.position, QColorFromColourRGBA(stop.colour)); } QBrush brush = QBrush(linearGradient); GetPainter()->fillRect(rect, brush); @@ -521,13 +521,13 @@ void SurfaceImpl::DrawTextNoClip(PRectangle rc, const Font *font, XYPOSITION ybase, std::string_view text, - ColourAlpha fore, - ColourAlpha back) + ColourRGBA fore, + ColourRGBA back) { SetFont(font); PenColour(fore); - GetPainter()->setBackground(QColorFromColourAlpha(back)); + GetPainter()->setBackground(QColorFromColourRGBA(back)); GetPainter()->setBackgroundMode(Qt::OpaqueMode); QString su = UnicodeFromText(codec, text); GetPainter()->drawText(QPointF(rc.left, ybase), su); @@ -537,8 +537,8 @@ void SurfaceImpl::DrawTextClipped(PRectangle rc, const Font *font, XYPOSITION ybase, std::string_view text, - ColourAlpha fore, - ColourAlpha back) + ColourRGBA fore, + ColourRGBA back) { SetClip(rc); DrawTextNoClip(rc, font, ybase, text, fore, back); @@ -549,7 +549,7 @@ void SurfaceImpl::DrawTextTransparent(PRectangle rc, const Font *font, XYPOSITION ybase, std::string_view text, - ColourAlpha fore) + ColourRGBA fore) { SetFont(font); PenColour(fore); @@ -633,13 +633,13 @@ void SurfaceImpl::DrawTextNoClipUTF8(PRectangle rc, const Font *font, XYPOSITION ybase, std::string_view text, - ColourAlpha fore, - ColourAlpha back) + ColourRGBA fore, + ColourRGBA back) { SetFont(font); PenColour(fore); - GetPainter()->setBackground(QColorFromColourAlpha(back)); + GetPainter()->setBackground(QColorFromColourRGBA(back)); GetPainter()->setBackgroundMode(Qt::OpaqueMode); QString su = QString::fromUtf8(text.data(), static_cast<int>(text.length())); GetPainter()->drawText(QPointF(rc.left, ybase), su); @@ -649,8 +649,8 @@ void SurfaceImpl::DrawTextClippedUTF8(PRectangle rc, const Font *font, XYPOSITION ybase, std::string_view text, - ColourAlpha fore, - ColourAlpha back) + ColourRGBA fore, + ColourRGBA back) { SetClip(rc); DrawTextNoClip(rc, font, ybase, text, fore, back); @@ -661,7 +661,7 @@ void SurfaceImpl::DrawTextTransparentUTF8(PRectangle rc, const Font *font, XYPOSITION ybase, std::string_view text, - ColourAlpha fore) + ColourRGBA fore) { SetFont(font); PenColour(fore); @@ -1284,16 +1284,16 @@ void Menu::Show(Point pt, const Window & /*w*/) //---------------------------------------------------------------------- -ColourAlpha Platform::Chrome() +ColourRGBA Platform::Chrome() { QColor c(Qt::gray); - return ColourAlpha(c.red(), c.green(), c.blue()); + return ColourRGBA(c.red(), c.green(), c.blue()); } -ColourAlpha Platform::ChromeHighlight() +ColourRGBA Platform::ChromeHighlight() { QColor c(Qt::lightGray); - return ColourAlpha(c.red(), c.green(), c.blue()); + return ColourRGBA(c.red(), c.green(), c.blue()); } const char *Platform::DefaultFont() diff --git a/qt/ScintillaEditBase/PlatQt.h b/qt/ScintillaEditBase/PlatQt.h index 3b74a1306..446e07ebb 100644 --- a/qt/ScintillaEditBase/PlatQt.h +++ b/qt/ScintillaEditBase/PlatQt.h @@ -31,7 +31,7 @@ namespace Scintilla { const char *CharacterSetID(int characterSet); -inline QColor QColorFromColourAlpha(ColourAlpha ca) +inline QColor QColorFromColourRGBA(ColourRGBA ca) { return QColor(ca.GetRed(), ca.GetGreen(), ca.GetBlue(), ca.GetAlpha()); } @@ -91,8 +91,8 @@ public: void Release() noexcept override; int Supports(int feature) noexcept override; bool Initialised() override; - void PenColour(ColourAlpha fore); - void PenColourWidth(ColourAlpha fore, XYPOSITION strokeWidth); + void PenColour(ColourRGBA fore); + void PenColourWidth(ColourRGBA fore, XYPOSITION strokeWidth); int LogPixelsY() override; int PixelDivisions() override; int DeviceHeightFont(int points) override; @@ -116,21 +116,21 @@ public: std::unique_ptr<IScreenLineLayout> Layout(const IScreenLine *screenLine) override; void DrawTextNoClip(PRectangle rc, const Font *font, XYPOSITION ybase, - std::string_view text, ColourAlpha fore, ColourAlpha back) override; + std::string_view text, ColourRGBA fore, ColourRGBA back) override; void DrawTextClipped(PRectangle rc, const Font *font, XYPOSITION ybase, - std::string_view text, ColourAlpha fore, ColourAlpha back) override; + std::string_view text, ColourRGBA fore, ColourRGBA back) override; void DrawTextTransparent(PRectangle rc, const Font *font, XYPOSITION ybase, - std::string_view text, ColourAlpha fore) override; + std::string_view text, ColourRGBA fore) override; void MeasureWidths(const Font *font, std::string_view text, XYPOSITION *positions) override; XYPOSITION WidthText(const Font *font, std::string_view text) override; void DrawTextNoClipUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, - std::string_view text, ColourAlpha fore, ColourAlpha back) override; + std::string_view text, ColourRGBA fore, ColourRGBA back) override; void DrawTextClippedUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, - std::string_view text, ColourAlpha fore, ColourAlpha back) override; + std::string_view text, ColourRGBA fore, ColourRGBA back) override; void DrawTextTransparentUTF8(PRectangle rc, const Font *font_, XYPOSITION ybase, - std::string_view text, ColourAlpha fore) override; + std::string_view text, ColourRGBA fore) override; void MeasureWidthsUTF8(const Font *font_, std::string_view text, XYPOSITION *positions) override; XYPOSITION WidthTextUTF8(const Font *font_, std::string_view text) override; @@ -146,7 +146,7 @@ public: void FlushCachedState() override; void FlushDrawing() override; - void BrushColour(ColourAlpha back); + void BrushColour(ColourRGBA back); void SetCodec(const Font *font); void SetFont(const Font *font); diff --git a/qt/ScintillaEditBase/ScintillaEditBase.cpp b/qt/ScintillaEditBase/ScintillaEditBase.cpp index f6da07fe9..c94cd13f7 100644 --- a/qt/ScintillaEditBase/ScintillaEditBase.cpp +++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp @@ -59,10 +59,10 @@ ScintillaEditBase::ScintillaEditBase(QWidget *parent) setAttribute(Qt::WA_KeyCompression); setAttribute(Qt::WA_InputMethodEnabled); - sqt->vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourAlpha(0, 0, 0xff)); - sqt->vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourAlpha(0, 0, 0xff)); - sqt->vs.indicators[SC_INDICATOR_CONVERTED] = Indicator(INDIC_COMPOSITIONTHICK, ColourAlpha(0, 0, 0xff)); - sqt->vs.indicators[SC_INDICATOR_TARGET] = Indicator(INDIC_STRAIGHTBOX, ColourAlpha(0, 0, 0xff)); + sqt->vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourRGBA(0, 0, 0xff)); + sqt->vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourRGBA(0, 0, 0xff)); + sqt->vs.indicators[SC_INDICATOR_CONVERTED] = Indicator(INDIC_COMPOSITIONTHICK, ColourRGBA(0, 0, 0xff)); + sqt->vs.indicators[SC_INDICATOR_TARGET] = Indicator(INDIC_STRAIGHTBOX, ColourRGBA(0, 0, 0xff)); connect(sqt, SIGNAL(notifyParent(SCNotification)), this, SLOT(notifyParent(SCNotification))); |