You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Show "transparent background" texture only behind actual texture in TexturePreview class + add borders for readability
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user