aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMitchell Foral <unknown>2022-12-01 15:50:34 +1100
committerMitchell Foral <unknown>2022-12-01 15:50:34 +1100
commitb80ca55f14fc7e0aa582a1b0b2117faf23ec29be (patch)
tree21f324e6c542f96f6544d117132e4afa87fb807b
parentfce791bd563134b793ddd79b45c91b7d59e14c7b (diff)
downloadscintilla-mirror-b80ca55f14fc7e0aa582a1b0b2117faf23ec29be.tar.gz
On Qt, allow string form XPM images for SCI_REGISTERIMAGE.
-rw-r--r--doc/ScintillaHistory.html3
-rw-r--r--qt/ScintillaEditBase/PlatQt.cpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 8bcd84c4b..1c919b7c2 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -621,6 +621,9 @@
<li>
On Qt, implement SCI_SETRECTANGULARSELECTIONMODIFIER for all platforms.
</li>
+ <li>
+ On Qt, allow string form XPM images for SCI_REGISTERIMAGE.
+ </li>
</ul>
<h3>
<a href="https://www.scintilla.org/scintilla531.zip">Release 5.3.1</a>
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp
index 233e114ff..42675933c 100644
--- a/qt/ScintillaEditBase/PlatQt.cpp
+++ b/qt/ScintillaEditBase/PlatQt.cpp
@@ -12,6 +12,7 @@
#include "PlatQt.h"
#include "Scintilla.h"
+#include "XPM.h"
#include "UniConversion.h"
#include "DBCS.h"
@@ -1146,7 +1147,9 @@ void ListBoxImpl::RegisterQPixmapImage(int type, const QPixmap& pm)
void ListBoxImpl::RegisterImage(int type, const char *xpmData)
{
- RegisterQPixmapImage(type, QPixmap(reinterpret_cast<const char * const *>(xpmData)));
+ XPM xpmImage(xpmData);
+ RGBAImage rgbaImage(xpmImage);
+ RegisterRGBAImage(type, rgbaImage.GetWidth(), rgbaImage.GetHeight(), rgbaImage.Pixels());
}
void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage)