Merge pull request #19 from G-e-n-e-v-e-n-s-i-S/remove-editable-text

Remove text on editable:false image fields
This commit is contained in:
GenevensiS
2024-09-27 14:04:04 +02:00
committed by GitHub
+2 -2
View File
@@ -43,7 +43,7 @@ void ImageValueViewer::draw(RotatedDC& dc) {
image = style().default_image.generate(GeneratedImage::Options(w, h, &getStylePackage(), &getLocalPackage())); image = style().default_image.generate(GeneratedImage::Options(w, h, &getStylePackage(), &getLocalPackage()));
is_default = true; is_default = true;
if (what & DRAW_EDITING) { if (what & DRAW_EDITING) {
bitmap = imagePlaceholder(dc, w, h, image, what & DRAW_EDITING); bitmap = imagePlaceholder(dc, w, h, image, (what & DRAW_EDITING) && field().editable);
if (alpha_mask.isLoaded() || !is_rad0(a)) { if (alpha_mask.isLoaded() || !is_rad0(a)) {
image = bitmap.ConvertToImage(); // we need to convert back to an image image = bitmap.ConvertToImage(); // we need to convert back to an image
} else { } else {
@@ -54,7 +54,7 @@ void ImageValueViewer::draw(RotatedDC& dc) {
// checkerboard placeholder // checkerboard placeholder
if (!image.Ok() && !bitmap.Ok() && style().width > 40) { if (!image.Ok() && !bitmap.Ok() && style().width > 40) {
// placeholder bitmap // placeholder bitmap
bitmap = imagePlaceholder(dc, w, h, wxNullImage, what & DRAW_EDITING); bitmap = imagePlaceholder(dc, w, h, wxNullImage, (what & DRAW_EDITING) && field().editable);
if (alpha_mask.isLoaded() || !is_rad0(a)) { if (alpha_mask.isLoaded() || !is_rad0(a)) {
// we need to convert back to an image // we need to convert back to an image
image = bitmap.ConvertToImage(); image = bitmap.ConvertToImage();