Add texture path copy button functionality
This commit is contained in:
parent
fbacfccd13
commit
4b2dfaa5bd
|
@ -25,6 +25,7 @@ public partial class TextureBrowser : Node
|
||||||
private HFlowContainer _textureList;
|
private HFlowContainer _textureList;
|
||||||
private TextureRect _previewTexture;
|
private TextureRect _previewTexture;
|
||||||
private LineEdit _texturePath;
|
private LineEdit _texturePath;
|
||||||
|
private Button _texturePathCopyButton;
|
||||||
private OptionButton _filterOptions;
|
private OptionButton _filterOptions;
|
||||||
private LineEdit _fileType;
|
private LineEdit _fileType;
|
||||||
private LineEdit _resolutionBox;
|
private LineEdit _resolutionBox;
|
||||||
|
@ -46,6 +47,7 @@ public partial class TextureBrowser : Node
|
||||||
_textureList = GetNode<HFlowContainer>("%TextureList");
|
_textureList = GetNode<HFlowContainer>("%TextureList");
|
||||||
_previewTexture = GetNode<TextureRect>("%PreviewTexture");
|
_previewTexture = GetNode<TextureRect>("%PreviewTexture");
|
||||||
_texturePath = GetNode<LineEdit>("%PathBox");
|
_texturePath = GetNode<LineEdit>("%PathBox");
|
||||||
|
_texturePathCopyButton = GetNode<Button>("%PathCopyButton");
|
||||||
_filterOptions = GetNode<OptionButton>("%FilterOptions");
|
_filterOptions = GetNode<OptionButton>("%FilterOptions");
|
||||||
_fileType = GetNode<LineEdit>("%FileTypeBox");
|
_fileType = GetNode<LineEdit>("%FileTypeBox");
|
||||||
_resolutionBox = GetNode<LineEdit>("%ResolutionBox");
|
_resolutionBox = GetNode<LineEdit>("%ResolutionBox");
|
||||||
|
@ -55,11 +57,17 @@ public partial class TextureBrowser : Node
|
||||||
_sortMenu.GetPopup().IdPressed += ApplySortMode;
|
_sortMenu.GetPopup().IdPressed += ApplySortMode;
|
||||||
_folderTree.ItemSelected += SetActiveFolder;
|
_folderTree.ItemSelected += SetActiveFolder;
|
||||||
_filterOptions.ItemSelected += SetPreviewTextureFilter;
|
_filterOptions.ItemSelected += SetPreviewTextureFilter;
|
||||||
|
_texturePathCopyButton.Pressed += CopyTexturePath;
|
||||||
|
|
||||||
BuildFolderTree();
|
BuildFolderTree();
|
||||||
BuildTextureList(); // TODO: This should be triggered on folder change
|
BuildTextureList(); // TODO: This should be triggered on folder change
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CopyTexturePath()
|
||||||
|
{
|
||||||
|
DisplayServer.ClipboardSet(_texturePath.Text);
|
||||||
|
}
|
||||||
|
|
||||||
private void BuildFolderTree()
|
private void BuildFolderTree()
|
||||||
{
|
{
|
||||||
_folderTree.Clear();
|
_folderTree.Clear();
|
||||||
|
|
|
@ -268,6 +268,7 @@ size_flags_horizontal = 3
|
||||||
editable = false
|
editable = false
|
||||||
|
|
||||||
[node name="PathCopyButton" type="Button" parent="TabContainer/Textures/VBoxContainer/HSplitContainer/HSplitContainer/Preview/VBoxContainer/PanelContainer/MarginContainer/Details/HBoxContainer"]
|
[node name="PathCopyButton" type="Button" parent="TabContainer/Textures/VBoxContainer/HSplitContainer/HSplitContainer/Preview/VBoxContainer/PanelContainer/MarginContainer/Details/HBoxContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
icon = ExtResource("7_2pq2g")
|
icon = ExtResource("7_2pq2g")
|
||||||
flat = true
|
flat = true
|
||||||
|
|
Loading…
Reference in New Issue