Open EmilyV99 opened 1 month ago
This is because TextEdit
draws both its normal and read-only styles when non-editable, but LineEdit
draws only its read-only one, changing this would potentially break existing use though so it's something to discuss how to navigate and either fix or document
This is because
TextEdit
draws both its normal and read-only styles when non-editable, butLineEdit
draws only its read-only one, changing this would potentially break existing use though so it's something to discuss how to navigate and either fix or document
Certianly something to be fixed. Could always offer a checkbox for the old behavior to keep existing uses working.
That's what should be discussed, it's been this way since before 4.0 was released so it's very well established, it's not as trivial to just change IMO, or something that's necessarily broken
These are still pretty different classes and exact equivalence isn't necessarily guaranteed or expected
These are still pretty different classes and exact equivalence isn't necessarily guaranteed or expected
At the very least OptionButton works the same way as LineEdit, and offhand I would bet most other controls do as well. TextEdit acting this way is an outlier, and completely prevents the use case of wanting something to be more transparent when disabled; a use case I very much want to use, and therefore something that seems broken to me.
But it doesn't have to be critical either way, but I'd say this is more proposal territory as this is by design and would break existing code unless done carefully and correctly, ~the standard theme uses the exact same style box for both and it's opaque~
But important to discuss and come to a solution that works for everyone
the standard theme uses the exact same style box for both and it's opaque
err, what? Is what I'm using not the standard theme somehow then, because it is definitely not opaque by default; thus how I even noticed this issue... (It is hard to notice without changing the color behind it, as it is a transparent color that is very similar to the default panel color, but it is still transparent; see the MRP / the screenshot I posted- that is default, except for a light-colored panel added behind the widgets)
My bad it is in fact transparent, it was just declared elsewhere, I'd say the read-only style for LineEdit
should be made opaque then
But for the specific side of how to draw this I'd say a proposal is the way to go
We don't have just this issue, we have a lot of issues since the c++ file has 8500 lines written by many contributers.
Line highlighter doesn't respect the content margins! It even draws over the focus style!
This is just a TextEdit
in readonly mode! it's using calculation for both normal and readonly styles! I have made the normal StyleBox transparent, and just have edited both normal and readonly content margins!
The minimap background draws over the text in RTL layout!
I will try to fix and clean the code as much as i can.
Tested versions
System information
Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated AMD Radeon RX 6600 (Advanced Micro Devices, Inc.; 32.0.11029.1008) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)
Issue description
A TextEdit and LineEdit do not draw their StyleBoxes in the same way when
editable = false
. I would expect these to look visually more similar than they do.Steps to reproduce
editable
for bothMinimal reproduction project (MRP)
mrp_textedit.zip