Set resolution text

This commit is contained in:
Jarrod Doyle 2024-09-08 19:27:51 +01:00
parent 0a71be4731
commit 56614d3b1d
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,7 @@ public partial class TextureBrowser : Node
private LineEdit _texturePath;
private OptionButton _filterOptions;
private LineEdit _fileType;
private LineEdit _resolutionBox;
private string _searchFilterPrefix = "";
@ -46,6 +47,7 @@ public partial class TextureBrowser : Node
_texturePath = GetNode<LineEdit>("%PathBox");
_filterOptions = GetNode<OptionButton>("%FilterOptions");
_fileType = GetNode<LineEdit>("%FileTypeBox");
_resolutionBox = GetNode<LineEdit>("%ResolutionBox");
_searchBar.TextChanged += ApplySearchFilter;
_sortMenu.GetPopup().IdPressed += ApplySortMode;
@ -130,6 +132,8 @@ public partial class TextureBrowser : Node
_previewTexture.Texture = texture;
_texturePath.Text = name;
_fileType.Text = Path.GetExtension(path).ToUpper();
var resolution = texture.GetSize();
_resolutionBox.Text = $"{resolution.X}x{resolution.Y}";
}
private void ApplySearchFilter(string filter)

View File

@ -287,6 +287,7 @@ layout_mode = 2
text = "Resolution"
[node name="ResolutionBox" type="LineEdit" parent="TabContainer/Textures/VBoxContainer/HSplitContainer/HSplitContainer/Preview/VBoxContainer/PanelContainer/MarginContainer/Details"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
editable = false