Show "transparent background" texture only behind actual texture in TexturePreview class + add borders for readability
This commit is contained in:
parent
bdf625bd54
commit
db4ae2a91c
3 changed files with 57 additions and 7 deletions
|
|
@ -36,6 +36,8 @@
|
|||
#include "scene/gui/margin_container.h"
|
||||
#include "scene/resources/texture.h"
|
||||
|
||||
class AspectRatioContainer;
|
||||
class ColorRect;
|
||||
class TextureRect;
|
||||
|
||||
class TexturePreview : public MarginContainer {
|
||||
|
|
@ -44,13 +46,20 @@ class TexturePreview : public MarginContainer {
|
|||
private:
|
||||
TextureRect *texture_display = nullptr;
|
||||
|
||||
MarginContainer *margin_container = nullptr;
|
||||
AspectRatioContainer *centering_container = nullptr;
|
||||
ColorRect *bg_rect = nullptr;
|
||||
TextureRect *checkerboard = nullptr;
|
||||
Label *metadata_label = nullptr;
|
||||
|
||||
Color cached_outline_color;
|
||||
|
||||
void _draw_outline();
|
||||
void _update_metadata_label_text();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
void _update_texture_display_ratio();
|
||||
|
||||
public:
|
||||
TextureRect *get_texture_display();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue