only draw text if field is editable

This commit is contained in:
GenevensiS
2024-09-27 14:00:30 +02:00
parent 96fd385962
commit 6d9e536df6
+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();