diff --git a/addons/icon_explorer/internal/scripts/database.gd b/addons/icon_explorer/internal/scripts/database.gd index 5dc67c2..482b240 100644 --- a/addons/icon_explorer/internal/scripts/database.gd +++ b/addons/icon_explorer/internal/scripts/database.gd @@ -126,23 +126,19 @@ func _load() -> void: for idx: int in range(self._collections.size()): var coll: Collection = self._collections[idx] if !self._loaded_collections.has(coll.id()) && coll.is_installed(): - var start_time: float = Time.get_unix_time_from_system() var res: Array = coll.load() loaded_icons.append_array(res[0]) buffers.append_array(res[1]) - print(coll.name, " loaded in: ", "%.1f" % (Time.get_unix_time_from_system() - start_time), "s") self._loaded_collections.append(coll.id()) self._load_done.bind(loaded_icons, buffers).call_deferred() func _load_done(loaded_icons: Array[Icon], buffers: PackedStringArray) -> void: - var start_time: float = Time.get_unix_time_from_system() for idx: int in range(loaded_icons.size()): if idx % 50 == 0: self._load_progress = float(idx + 1) / loaded_icons.size() * 100.0 await self._scene_tree.process_frame _load_texture(loaded_icons[idx], buffers[idx]) self._icons.append_array(loaded_icons) - print("load textures in: ", "%.1f" % (Time.get_unix_time_from_system() - start_time), "s") self.loaded.emit() static func _load_texture(icon: Icon, buffer: String) -> void: diff --git a/addons/icon_explorer/internal/scripts/tools/zip_unpacker.gd b/addons/icon_explorer/internal/scripts/tools/zip_unpacker.gd index 2bdb048..4708342 100644 --- a/addons/icon_explorer/internal/scripts/tools/zip_unpacker.gd +++ b/addons/icon_explorer/internal/scripts/tools/zip_unpacker.gd @@ -22,7 +22,6 @@ func _is_in_filter(path: String) -> bool: return false func unpack() -> bool: - var start_time: int = Time.get_ticks_msec() var reader := ZIPReader.new() var err: Error = reader.open(self._zip_path) if err != Error.OK: @@ -43,12 +42,10 @@ func unpack() -> bool: file.store_buffer(buffer) file = null reader.close() - print("unpacked (ST) in: ", Time.get_ticks_msec() - start_time, "ms") return true # Unpack with multiple threads. Is a blocking call nontheless. func unpack_mt(thread_count: int) -> bool: - var start_time: int = Time.get_ticks_msec() var threads: Array[Thread] = [] for idx: int in range(thread_count): threads.append(Thread.new()) @@ -72,7 +69,6 @@ func unpack_mt(thread_count: int) -> bool: threads[thread_idx].start(self._unpack_fn.bind(start_idx, end_idx)) for thread: Thread in threads: thread.wait_to_finish() - print("unpacked (MT) in: ", Time.get_ticks_msec() - start_time, "ms") return true func _create_directories(paths: PackedStringArray) -> bool: diff --git a/addons/icon_explorer/internal/ui/detail_panel/color_field.gd b/addons/icon_explorer/internal/ui/detail_panel/color_field.gd new file mode 100644 index 0000000..876d8d3 --- /dev/null +++ b/addons/icon_explorer/internal/ui/detail_panel/color_field.gd @@ -0,0 +1,29 @@ +@tool +extends "res://addons/icon_explorer/internal/ui/detail_panel/field.gd" + +@export var color: Color = Color.WHITE: + set = set_color + +@export var _color_rect: ColorRect +@export var _color_label: Label + +func set_color(new_color: Color) -> void: + color = new_color + if self._color_rect != null: + self._color_rect.color = new_color + self._color_label.text = "#" + new_color.to_html(false).to_upper() + if (new_color.r * 0.299 + new_color.g * 0.587 + new_color.b * 0.114) > 186.0 / 255.0: + self._color_label.add_theme_color_override(&"font_color", Color.BLACK) + else: + self._color_label.add_theme_color_override(&"font_color", Color.WHITE) + +func _ready() -> void: + super._ready() + self.color = self.color + self._color_rect.gui_input.connect(self._on_color_panel_gui_input) + +func _on_color_panel_gui_input(event: InputEvent) -> void: + if !((event is InputEventMouseButton) && (event as InputEventMouseButton).pressed && (event as InputEventMouseButton).button_index == MOUSE_BUTTON_LEFT): + return + self._color_rect.accept_event() + DisplayServer.clipboard_set("#" + self._color_rect.color.to_html(false).to_upper()) diff --git a/addons/icon_explorer/internal/ui/detail_panel/color_field.tscn b/addons/icon_explorer/internal/ui/detail_panel/color_field.tscn new file mode 100644 index 0000000..c3eb29e --- /dev/null +++ b/addons/icon_explorer/internal/ui/detail_panel/color_field.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=3 format=3 uid="uid://cadjan8ev877o"] + +[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/color_field.gd" id="1_vl8db"] +[ext_resource type="PackedScene" uid="uid://bonqki0uorlhq" path="res://addons/icon_explorer/internal/ui/detail_panel/field_title.tscn" id="2_2clk4"] + +[node name="color" type="VBoxContainer" node_paths=PackedStringArray("_color_rect", "_color_label")] +script = ExtResource("1_vl8db") +_color_rect = NodePath("margin_container/color_rect") +_color_label = NodePath("margin_container/color") +_title_path = NodePath("title_panel") + +[node name="title_panel" parent="." instance=ExtResource("2_2clk4")] +layout_mode = 2 + +[node name="margin_container" type="MarginContainer" parent="."] +layout_mode = 2 +theme_override_constants/margin_left = 16 + +[node name="color_rect" type="ColorRect" parent="margin_container"] +custom_minimum_size = Vector2(0, 32) +layout_mode = 2 +tooltip_text = "Click to copy!" +focus_mode = 2 +mouse_default_cursor_shape = 2 + +[node name="color" type="Label" parent="margin_container"] +layout_mode = 2 +size_flags_vertical = 1 +horizontal_alignment = 1 +vertical_alignment = 1 diff --git a/addons/icon_explorer/internal/ui/detail_panel/detail_panel.tscn b/addons/icon_explorer/internal/ui/detail_panel/detail_panel.tscn index 5a5f98c..19c9908 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/detail_panel.tscn +++ b/addons/icon_explorer/internal/ui/detail_panel/detail_panel.tscn @@ -1,12 +1,12 @@ [gd_scene load_steps=11 format=3 uid="uid://c3s1t8hiu6xll"] [ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/detail_panel.gd" id="1_2iwjs"] -[ext_resource type="PackedScene" uid="uid://bf2b6v68rufpn" path="res://addons/icon_explorer/internal/ui/detail_panel/material_design.tscn" id="2_ea6yg"] +[ext_resource type="PackedScene" uid="uid://bf2b6v68rufpn" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/material_design.tscn" id="2_ea6yg"] [ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/toolbar.gd" id="2_rtuoh"] -[ext_resource type="PackedScene" uid="uid://3hl6t03xllbp" path="res://addons/icon_explorer/internal/ui/detail_panel/simple_icons.tscn" id="4_em72e"] -[ext_resource type="PackedScene" uid="uid://dtcstt4vepa17" path="res://addons/icon_explorer/internal/ui/detail_panel/bootstrap.tscn" id="5_mxg1a"] -[ext_resource type="PackedScene" uid="uid://lk45nf0tqm80" path="res://addons/icon_explorer/internal/ui/detail_panel/tabler.tscn" id="7_2jw0k"] -[ext_resource type="PackedScene" uid="uid://wqlpitsynlfk" path="res://addons/icon_explorer/internal/ui/detail_panel/font_awesome.tscn" id="8_1041k"] +[ext_resource type="PackedScene" uid="uid://3hl6t03xllbp" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/simple_icons.tscn" id="4_em72e"] +[ext_resource type="PackedScene" uid="uid://dtcstt4vepa17" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/bootstrap.tscn" id="5_mxg1a"] +[ext_resource type="PackedScene" uid="uid://lk45nf0tqm80" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/tabler.tscn" id="7_2jw0k"] +[ext_resource type="PackedScene" uid="uid://wqlpitsynlfk" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/font_awesome.tscn" id="8_1041k"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_p1g3s"] diff --git a/addons/icon_explorer/internal/ui/detail_panel/field.gd b/addons/icon_explorer/internal/ui/detail_panel/field.gd new file mode 100644 index 0000000..2190683 --- /dev/null +++ b/addons/icon_explorer/internal/ui/detail_panel/field.gd @@ -0,0 +1,18 @@ +@tool +extends VBoxContainer + +const FieldTitle := preload("res://addons/icon_explorer/internal/ui/detail_panel/field_title.gd") + +@export var title: String: + set = set_title + +@export var _title_path: NodePath +@onready var _title: FieldTitle = self.get_node(self._title_path) + +func set_title(new_title: String) -> void: + title = new_title + if self._title != null: + self._title.text = new_title + +func _ready() -> void: + self.title = self.title diff --git a/addons/icon_explorer/internal/ui/detail_panel/field_title.gd b/addons/icon_explorer/internal/ui/detail_panel/field_title.gd new file mode 100644 index 0000000..a208b5a --- /dev/null +++ b/addons/icon_explorer/internal/ui/detail_panel/field_title.gd @@ -0,0 +1,21 @@ +@tool +extends PanelContainer + +@export var text: String: + set = set_text + +@export var _text_label: Label + +func set_text(new_text: String) -> void: + text = new_text + if self._text_label != null: + self._text_label.text = new_text + +func _ready() -> void: + if Engine.is_editor_hint(): + self._text_label.add_theme_font_override(&"font", self.get_theme_font(&"title", &"EditorFonts")) + var stylebox: StyleBox = self.get_theme_stylebox(&"PanelForeground", &"EditorStyles").duplicate() + stylebox.content_margin_bottom = 0 + stylebox.content_margin_top = 0 + self.add_theme_stylebox_override(&"panel", stylebox) + self.text = self.text diff --git a/addons/icon_explorer/internal/ui/detail_panel/field_title.tscn b/addons/icon_explorer/internal/ui/detail_panel/field_title.tscn new file mode 100644 index 0000000..d386055 --- /dev/null +++ b/addons/icon_explorer/internal/ui/detail_panel/field_title.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=2 format=3 uid="uid://bonqki0uorlhq"] + +[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/field_title.gd" id="1_unl3l"] + +[node name="title_panel" type="PanelContainer" node_paths=PackedStringArray("_text_label")] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_unl3l") +_text_label = NodePath("title") + +[node name="title" type="Label" parent="."] +layout_mode = 2 diff --git a/addons/icon_explorer/internal/ui/detail_panel/list_field.gd b/addons/icon_explorer/internal/ui/detail_panel/list_field.gd index a5392a9..7757c6e 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/list_field.gd +++ b/addons/icon_explorer/internal/ui/detail_panel/list_field.gd @@ -1,19 +1,10 @@ @tool -extends VBoxContainer +extends "res://addons/icon_explorer/internal/ui/detail_panel/field.gd" -@export var title: String: - set = set_title @export var items: PackedStringArray = []: set = set_items -@export var _title: Label @export var _list: ItemList -@export var _title_panel: PanelContainer - -func set_title(new_title: String) -> void: - title = new_title - if self._title != null: - self._title.text = new_title func set_items(new_items: PackedStringArray) -> void: items = new_items @@ -23,13 +14,6 @@ func set_items(new_items: PackedStringArray) -> void: self._list.add_item(item) self.visible = new_items.size() > 0 - func _ready() -> void: - if Engine.is_editor_hint(): - self._title.add_theme_font_override(&"font", self.get_theme_font(&"title", &"EditorFonts")) - self._title_panel.add_theme_stylebox_override(&"panel", self.get_theme_stylebox(&"PanelForeground", &"EditorStyles")) - var stylebox: StyleBox = self._title_panel.get_theme_stylebox(&"panel") - stylebox.content_margin_bottom = 0 - stylebox.content_margin_top = 0 - self.title = self.title + super._ready() self.items = self.items diff --git a/addons/icon_explorer/internal/ui/detail_panel/list_field.tscn b/addons/icon_explorer/internal/ui/detail_panel/list_field.tscn index 330f3d0..89665b1 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/list_field.tscn +++ b/addons/icon_explorer/internal/ui/detail_panel/list_field.tscn @@ -1,24 +1,21 @@ -[gd_scene load_steps=3 format=3 uid="uid://b813qk6u7eveh"] +[gd_scene load_steps=4 format=3 uid="uid://b813qk6u7eveh"] [ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/list_field.gd" id="1_wb7ty"] +[ext_resource type="PackedScene" uid="uid://bonqki0uorlhq" path="res://addons/icon_explorer/internal/ui/detail_panel/field_title.tscn" id="2_gcg2e"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wghjy"] -[node name="list_field" type="VBoxContainer" node_paths=PackedStringArray("_title", "_list", "_title_panel")] +[node name="list_field" type="VBoxContainer" node_paths=PackedStringArray("_list")] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_wb7ty") -_title = NodePath("title_panel/title") +_title_path = NodePath("title_panel") _list = NodePath("margin_container/item_list") -_title_panel = NodePath("title_panel") -[node name="title_panel" type="PanelContainer" parent="."] -layout_mode = 2 - -[node name="title" type="Label" parent="title_panel"] +[node name="title_panel" parent="." instance=ExtResource("2_gcg2e")] layout_mode = 2 [node name="margin_container" type="MarginContainer" parent="."] diff --git a/addons/icon_explorer/internal/ui/detail_panel/bootstrap.gd b/addons/icon_explorer/internal/ui/detail_panel/panels/bootstrap.gd similarity index 100% rename from addons/icon_explorer/internal/ui/detail_panel/bootstrap.gd rename to addons/icon_explorer/internal/ui/detail_panel/panels/bootstrap.gd diff --git a/addons/icon_explorer/internal/ui/detail_panel/bootstrap.tscn b/addons/icon_explorer/internal/ui/detail_panel/panels/bootstrap.tscn similarity index 94% rename from addons/icon_explorer/internal/ui/detail_panel/bootstrap.tscn rename to addons/icon_explorer/internal/ui/detail_panel/panels/bootstrap.tscn index 2c3e19c..8b5a4ab 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/bootstrap.tscn +++ b/addons/icon_explorer/internal/ui/detail_panel/panels/bootstrap.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://dtcstt4vepa17"] -[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/bootstrap.gd" id="1_s6ueg"] +[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/bootstrap.gd" id="1_s6ueg"] [ext_resource type="PackedScene" uid="uid://b813qk6u7eveh" path="res://addons/icon_explorer/internal/ui/detail_panel/list_field.tscn" id="2_n1r08"] [ext_resource type="PackedScene" uid="uid://b64tcvn5sw03h" path="res://addons/icon_explorer/internal/ui/detail_panel/text_field.tscn" id="3_5y6bb"] diff --git a/addons/icon_explorer/internal/ui/detail_panel/font_awesome.gd b/addons/icon_explorer/internal/ui/detail_panel/panels/font_awesome.gd similarity index 100% rename from addons/icon_explorer/internal/ui/detail_panel/font_awesome.gd rename to addons/icon_explorer/internal/ui/detail_panel/panels/font_awesome.gd diff --git a/addons/icon_explorer/internal/ui/detail_panel/font_awesome.tscn b/addons/icon_explorer/internal/ui/detail_panel/panels/font_awesome.tscn similarity index 93% rename from addons/icon_explorer/internal/ui/detail_panel/font_awesome.tscn rename to addons/icon_explorer/internal/ui/detail_panel/panels/font_awesome.tscn index ecb668b..6d1f4aa 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/font_awesome.tscn +++ b/addons/icon_explorer/internal/ui/detail_panel/panels/font_awesome.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://wqlpitsynlfk"] -[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/font_awesome.gd" id="1_uh5pp"] +[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/font_awesome.gd" id="1_uh5pp"] [ext_resource type="PackedScene" uid="uid://b64tcvn5sw03h" path="res://addons/icon_explorer/internal/ui/detail_panel/text_field.tscn" id="2_8xir3"] [ext_resource type="PackedScene" uid="uid://b813qk6u7eveh" path="res://addons/icon_explorer/internal/ui/detail_panel/list_field.tscn" id="3_fm2h0"] diff --git a/addons/icon_explorer/internal/ui/detail_panel/material_design.gd b/addons/icon_explorer/internal/ui/detail_panel/panels/material_design.gd similarity index 100% rename from addons/icon_explorer/internal/ui/detail_panel/material_design.gd rename to addons/icon_explorer/internal/ui/detail_panel/panels/material_design.gd diff --git a/addons/icon_explorer/internal/ui/detail_panel/material_design.tscn b/addons/icon_explorer/internal/ui/detail_panel/panels/material_design.tscn similarity index 96% rename from addons/icon_explorer/internal/ui/detail_panel/material_design.tscn rename to addons/icon_explorer/internal/ui/detail_panel/panels/material_design.tscn index 9384952..de29fa8 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/material_design.tscn +++ b/addons/icon_explorer/internal/ui/detail_panel/panels/material_design.tscn @@ -1,9 +1,10 @@ [gd_scene load_steps=5 format=3 uid="uid://bf2b6v68rufpn"] -[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/material_design.gd" id="1_7oq86"] +[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/material_design.gd" id="1_7oq86"] [ext_resource type="PackedScene" uid="uid://b813qk6u7eveh" path="res://addons/icon_explorer/internal/ui/detail_panel/list_field.tscn" id="2_sgh8u"] [ext_resource type="PackedScene" uid="uid://b64tcvn5sw03h" path="res://addons/icon_explorer/internal/ui/detail_panel/text_field.tscn" id="3_7hl4l"] + [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2aicr"] bg_color = Color(0.670588, 0, 0.0901961, 1) border_width_left = 4 diff --git a/addons/icon_explorer/internal/ui/detail_panel/simple_icons.gd b/addons/icon_explorer/internal/ui/detail_panel/panels/simple_icons.gd similarity index 55% rename from addons/icon_explorer/internal/ui/detail_panel/simple_icons.gd rename to addons/icon_explorer/internal/ui/detail_panel/panels/simple_icons.gd index 908a95a..72572cb 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/simple_icons.gd +++ b/addons/icon_explorer/internal/ui/detail_panel/panels/simple_icons.gd @@ -2,11 +2,12 @@ extends VBoxContainer const IconSimpleIcons := preload("res://addons/icon_explorer/internal/scripts/collections/icon_simple_icons.gd") +const ColorField := preload("res://addons/icon_explorer/internal/ui/detail_panel/color_field.gd") const TextField := preload("res://addons/icon_explorer/internal/ui/detail_panel/text_field.gd") const ListField := preload("res://addons/icon_explorer/internal/ui/detail_panel/list_field.gd") -@export var _color_panel: ColorRect -@export var _color_label: Label +@export var _color_path: NodePath +@onready var _color: ColorField = self.get_node(self._color_path) @export var _aliases_path: NodePath @onready var _aliases: ListField = self.get_node(self._aliases_path) @export var _guidelines_path: NodePath @@ -16,17 +17,8 @@ const ListField := preload("res://addons/icon_explorer/internal/ui/detail_panel/ @export var _source_path: NodePath @onready var _source: TextField = self.get_node(self._source_path) -func _ready() -> void: - self._color_panel.gui_input.connect(self._on_color_panel_gui_input) - func display(icon: IconSimpleIcons) -> void: - self._color_panel.color = icon.hex - self._color_label.text = "#" + icon.hex.to_html(false).to_upper() - if (icon.hex.r * 0.299 + icon.hex.g * 0.587 + icon.hex.b * 0.114) > 186.0 / 255.0: - self._color_label.add_theme_color_override(&"font_color", Color.BLACK) - else: - self._color_label.add_theme_color_override(&"font_color", Color.WHITE) - + self._color.color = icon.hex self._aliases.set_items(icon.aliases) self._guidelines.text = icon.guidelines self._guidelines.uri = icon.guidelines @@ -34,9 +26,3 @@ func display(icon: IconSimpleIcons) -> void: self._license.uri = icon.license_link self._source.text = icon.source self._source.uri = icon.source - -func _on_color_panel_gui_input(event: InputEvent) -> void: - if !((event is InputEventMouseButton) && (event as InputEventMouseButton).pressed && (event as InputEventMouseButton).button_index == MOUSE_BUTTON_LEFT): - return - self._color_panel.accept_event() - DisplayServer.clipboard_set("#" + self._color_panel.color.to_html(false).to_upper()) diff --git a/addons/icon_explorer/internal/ui/detail_panel/panels/simple_icons.tscn b/addons/icon_explorer/internal/ui/detail_panel/panels/simple_icons.tscn new file mode 100644 index 0000000..cb31d10 --- /dev/null +++ b/addons/icon_explorer/internal/ui/detail_panel/panels/simple_icons.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=5 format=3 uid="uid://3hl6t03xllbp"] + +[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/simple_icons.gd" id="1_icjlg"] +[ext_resource type="PackedScene" uid="uid://cadjan8ev877o" path="res://addons/icon_explorer/internal/ui/detail_panel/color_field.tscn" id="2_q8ihc"] +[ext_resource type="PackedScene" uid="uid://b813qk6u7eveh" path="res://addons/icon_explorer/internal/ui/detail_panel/list_field.tscn" id="3_ps7ly"] +[ext_resource type="PackedScene" uid="uid://b64tcvn5sw03h" path="res://addons/icon_explorer/internal/ui/detail_panel/text_field.tscn" id="4_soj3e"] + +[node name="simple_icons" type="VBoxContainer"] +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 297.0 +grow_horizontal = 2 +script = ExtResource("1_icjlg") +_color_path = NodePath("color") +_aliases_path = NodePath("aliases") +_guidelines_path = NodePath("guidelines") +_license_path = NodePath("license") +_source_path = NodePath("source") + +[node name="color" parent="." instance=ExtResource("2_q8ihc")] +layout_mode = 2 +title = "Color" + +[node name="aliases" parent="." instance=ExtResource("3_ps7ly")] +layout_mode = 2 +title = "Aliases" + +[node name="guidelines" parent="." instance=ExtResource("4_soj3e")] +layout_mode = 2 +title = "Brand Guidelines" + +[node name="license" parent="." instance=ExtResource("4_soj3e")] +layout_mode = 2 +title = "License" + +[node name="source" parent="." instance=ExtResource("4_soj3e")] +layout_mode = 2 +title = "Source" diff --git a/addons/icon_explorer/internal/ui/detail_panel/tabler.gd b/addons/icon_explorer/internal/ui/detail_panel/panels/tabler.gd similarity index 100% rename from addons/icon_explorer/internal/ui/detail_panel/tabler.gd rename to addons/icon_explorer/internal/ui/detail_panel/panels/tabler.gd diff --git a/addons/icon_explorer/internal/ui/detail_panel/tabler.tscn b/addons/icon_explorer/internal/ui/detail_panel/panels/tabler.tscn similarity index 94% rename from addons/icon_explorer/internal/ui/detail_panel/tabler.tscn rename to addons/icon_explorer/internal/ui/detail_panel/panels/tabler.tscn index b62f190..71c7627 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/tabler.tscn +++ b/addons/icon_explorer/internal/ui/detail_panel/panels/tabler.tscn @@ -1,9 +1,10 @@ [gd_scene load_steps=4 format=3 uid="uid://lk45nf0tqm80"] [ext_resource type="PackedScene" uid="uid://b813qk6u7eveh" path="res://addons/icon_explorer/internal/ui/detail_panel/list_field.tscn" id="1_muhea"] -[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/tabler.gd" id="1_te45c"] +[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/panels/tabler.gd" id="1_te45c"] [ext_resource type="PackedScene" uid="uid://b64tcvn5sw03h" path="res://addons/icon_explorer/internal/ui/detail_panel/text_field.tscn" id="2_u3ntg"] + [node name="tabler" type="VBoxContainer"] anchors_preset = 10 anchor_right = 1.0 diff --git a/addons/icon_explorer/internal/ui/detail_panel/simple_icons.tscn b/addons/icon_explorer/internal/ui/detail_panel/simple_icons.tscn deleted file mode 100644 index 8cb8b7f..0000000 --- a/addons/icon_explorer/internal/ui/detail_panel/simple_icons.tscn +++ /dev/null @@ -1,55 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://3hl6t03xllbp"] - -[ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/simple_icons.gd" id="1_aoonc"] -[ext_resource type="PackedScene" uid="uid://b64tcvn5sw03h" path="res://addons/icon_explorer/internal/ui/detail_panel/text_field.tscn" id="2_64an6"] -[ext_resource type="PackedScene" uid="uid://b813qk6u7eveh" path="res://addons/icon_explorer/internal/ui/detail_panel/list_field.tscn" id="2_vc8om"] - -[node name="simple_icons" type="VBoxContainer" node_paths=PackedStringArray("_color_panel", "_color_label")] -anchors_preset = 10 -anchor_right = 1.0 -offset_bottom = 297.0 -grow_horizontal = 2 -script = ExtResource("1_aoonc") -_color_panel = NodePath("margin_container/texture_rect") -_color_label = NodePath("margin_container/color") -_aliases_path = NodePath("aliases") -_guidelines_path = NodePath("guidelines") -_license_path = NodePath("license") -_source_path = NodePath("source") - -[node name="color_title" type="Label" parent="."] -layout_mode = 2 -text = "Color" - -[node name="margin_container" type="MarginContainer" parent="."] -layout_mode = 2 -theme_override_constants/margin_left = 16 - -[node name="texture_rect" type="ColorRect" parent="margin_container"] -custom_minimum_size = Vector2(0, 32) -layout_mode = 2 -tooltip_text = "Click to copy!" -focus_mode = 2 -mouse_default_cursor_shape = 2 - -[node name="color" type="Label" parent="margin_container"] -layout_mode = 2 -size_flags_vertical = 1 -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="aliases" parent="." instance=ExtResource("2_vc8om")] -layout_mode = 2 -title = "Aliases" - -[node name="guidelines" parent="." instance=ExtResource("2_64an6")] -layout_mode = 2 -title = "Brand Guidelines" - -[node name="license" parent="." instance=ExtResource("2_64an6")] -layout_mode = 2 -title = "License" - -[node name="source" parent="." instance=ExtResource("2_64an6")] -layout_mode = 2 -title = "Source" diff --git a/addons/icon_explorer/internal/ui/detail_panel/text_field.gd b/addons/icon_explorer/internal/ui/detail_panel/text_field.gd index ae41359..023ec19 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/text_field.gd +++ b/addons/icon_explorer/internal/ui/detail_panel/text_field.gd @@ -1,22 +1,13 @@ @tool -extends VBoxContainer +extends "res://addons/icon_explorer/internal/ui/detail_panel/field.gd" -@export var title: String: - set = set_title @export var text: String: set = set_text @export var uri: String: set = set_uri -@export var _title: Label @export var _label: Label @export var _button: Button -@export var _title_panel: PanelContainer - -func set_title(new_title: String) -> void: - title = new_title - if self._title != null: - self._title.text = new_title func set_text(new_text: String) -> void: text = new_text @@ -33,15 +24,10 @@ func set_uri(new_uri: String) -> void: self.visible = new_uri != "" || self.text != "" func _ready() -> void: + super._ready() if Engine.is_editor_hint(): - self._title.add_theme_font_override(&"font", self.get_theme_font(&"title", &"EditorFonts")) self._button.icon = self.get_theme_icon(&"ExternalLink", &"EditorIcons") - self._title_panel.add_theme_stylebox_override(&"panel", self.get_theme_stylebox(&"PanelForeground", &"EditorStyles")) - var stylebox: StyleBox = self._title_panel.get_theme_stylebox(&"panel") - stylebox.content_margin_bottom = 0 - stylebox.content_margin_top = 0 self._button.pressed.connect(self._on_pressed) - self.title = self.title self.text = self.text self.uri = self.uri diff --git a/addons/icon_explorer/internal/ui/detail_panel/text_field.tscn b/addons/icon_explorer/internal/ui/detail_panel/text_field.tscn index bc0fdff..dfa5740 100644 --- a/addons/icon_explorer/internal/ui/detail_panel/text_field.tscn +++ b/addons/icon_explorer/internal/ui/detail_panel/text_field.tscn @@ -1,35 +1,20 @@ -[gd_scene load_steps=4 format=3 uid="uid://b64tcvn5sw03h"] +[gd_scene load_steps=3 format=3 uid="uid://b64tcvn5sw03h"] [ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/detail_panel/text_field.gd" id="1_fhni0"] +[ext_resource type="PackedScene" uid="uid://bonqki0uorlhq" path="res://addons/icon_explorer/internal/ui/detail_panel/field_title.tscn" id="2_vjbmh"] -[sub_resource type="Image" id="Image_lydfp"] -data = { -"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 7, 224, 224, 224, 138, 224, 224, 224, 231, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 176, 255, 255, 255, 0, 224, 224, 224, 129, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 138, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 172, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 129, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 231, 224, 224, 224, 255, 224, 224, 224, 72, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 192, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 128, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 128, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 193, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 128, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 128, 255, 255, 255, 0, 224, 224, 224, 129, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 128, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 128, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 129, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 128, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 128, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 1, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 129, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 128, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 194, 224, 224, 224, 193, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 129, 224, 224, 224, 128, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 232, 224, 224, 224, 255, 225, 225, 225, 75, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 225, 225, 225, 76, 224, 224, 224, 255, 224, 224, 224, 230, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 137, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 132, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 6, 225, 225, 225, 135, 224, 224, 224, 230, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 230, 224, 224, 224, 132, 255, 255, 255, 6, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), -"format": "RGBA8", -"height": 16, -"mipmaps": false, -"width": 16 -} - -[sub_resource type="ImageTexture" id="ImageTexture_34aex"] -image = SubResource("Image_lydfp") - -[node name="text_field" type="VBoxContainer" node_paths=PackedStringArray("_title", "_label", "_button", "_title_panel")] +[node name="text_field" type="VBoxContainer" node_paths=PackedStringArray("_label", "_button")] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_fhni0") -_title = NodePath("title_panel/title") +_title_path = NodePath("title_panel") _label = NodePath("margin_container/h_box_container/label") _button = NodePath("margin_container/h_box_container/button") -_title_panel = NodePath("title_panel") - -[node name="title_panel" type="PanelContainer" parent="."] -layout_mode = 2 -[node name="title" type="Label" parent="title_panel"] +[node name="title_panel" parent="." instance=ExtResource("2_vjbmh")] layout_mode = 2 [node name="margin_container" type="MarginContainer" parent="."] @@ -40,10 +25,8 @@ theme_override_constants/margin_left = 16 layout_mode = 2 [node name="button" type="Button" parent="margin_container/h_box_container"] -visible = false layout_mode = 2 mouse_default_cursor_shape = 2 -icon = SubResource("ImageTexture_34aex") flat = true [node name="label" type="Label" parent="margin_container/h_box_container"] diff --git a/addons/icon_explorer/internal/ui/options/options.gd b/addons/icon_explorer/internal/ui/options/options.gd index d1f2caf..af58a0d 100644 --- a/addons/icon_explorer/internal/ui/options/options.gd +++ b/addons/icon_explorer/internal/ui/options/options.gd @@ -14,7 +14,9 @@ enum BUTTON_ID { @export var _load_on_startup: CheckBox @export var _collection_tree: Tree @export var _options_panel: PanelContainer +@export var _options_label: Label @export var _collections_panel: PanelContainer +@export var _collections_label: Label var _http_request: HTTPRequest @@ -46,6 +48,8 @@ func _process(delta: float) -> void: func _ready() -> void: if Engine.is_editor_hint(): + self._options_label.add_theme_font_override(&"font", self.get_theme_font(&"title", &"EditorFonts")) + self._collections_label.add_theme_font_override(&"font", self.get_theme_font(&"title", &"EditorFonts")) self.add_theme_stylebox_override(&"panel", self.get_theme_stylebox(&"Background", &"EditorStyles")) self._collections_panel.add_theme_stylebox_override(&"panel", self.get_theme_stylebox(&"PanelForeground", &"EditorStyles")) self._options_panel.add_theme_stylebox_override(&"panel", self.get_theme_stylebox(&"PanelForeground", &"EditorStyles")) diff --git a/addons/icon_explorer/internal/ui/options/options.tscn b/addons/icon_explorer/internal/ui/options/options.tscn index 2c95e1c..814dedd 100644 --- a/addons/icon_explorer/internal/ui/options/options.tscn +++ b/addons/icon_explorer/internal/ui/options/options.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://addons/icon_explorer/internal/ui/options/options.gd" id="1_hdn86"] -[node name="control" type="PanelContainer" node_paths=PackedStringArray("_load_on_startup", "_collection_tree", "_options_panel", "_collections_panel")] +[node name="control" type="PanelContainer" node_paths=PackedStringArray("_load_on_startup", "_collection_tree", "_options_panel", "_options_label", "_collections_panel", "_collections_label")] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -12,7 +12,9 @@ script = ExtResource("1_hdn86") _load_on_startup = NodePath("options/options/v_box_container/load_on_startup") _collection_tree = NodePath("options/options/tree") _options_panel = NodePath("options/options/options_panel") +_options_label = NodePath("options/options/options_panel/options") _collections_panel = NodePath("options/options/collections_panel") +_collections_label = NodePath("options/options/collections_panel/collections_title") [node name="options" type="ScrollContainer" parent="."] layout_mode = 2