Files
MusicPlayer/statistics/StatisticsView.tscn
Sansan a4e6da4c28 Show every song in the statistics, as an alternative to the cards
A Soundtracks / Songs switch in the statistics toolbar shows a list of
every song with its soundtrack and how often it was played. It is searched
on both song and soundtrack names, filtered and sorted like the cards, and
clicking a song shows its soundtrack's popup.

The server has tens of thousands of songs, so the list only makes the rows
on screen and reuses them while scrolling, songs are sorted once per load,
and searching waits for a pause in typing.

Closes #47
2026-10-09 17:02:27 +02:00

174 lines
4.4 KiB
Plaintext

[gd_scene format=3]
[ext_resource type="Script" path="res://statistics/statistics_view.gd" id="view_script"]
[ext_resource type="PackedScene" path="res://statistics/SongStatsList.tscn" id="song_list_scene"]
[sub_resource type="ButtonGroup" id="ButtonGroup_mode"]
[node name="StatisticsView" type="Panel" unique_id=1212000001]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 56.0
grow_horizontal = 2
grow_vertical = 2
theme_type_variation = &"WindowBackground"
script = ExtResource("view_script")
[node name="Toolbar" type="HBoxContainer" parent="." unique_id=1212000002]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 32.0
offset_top = 16.0
offset_right = -32.0
offset_bottom = 56.0
grow_horizontal = 2
theme_override_constants/separation = 12
[node name="SoundtracksModeButton" type="Button" parent="Toolbar"]
unique_name_in_owner = true
custom_minimum_size = Vector2(120, 0)
layout_mode = 2
focus_mode = 0
theme_type_variation = &"TabButton"
toggle_mode = true
button_pressed = true
button_group = SubResource("ButtonGroup_mode")
text = "Soundtracks"
[node name="SongsModeButton" type="Button" parent="Toolbar"]
unique_name_in_owner = true
custom_minimum_size = Vector2(120, 0)
layout_mode = 2
focus_mode = 0
theme_type_variation = &"TabButton"
toggle_mode = true
button_group = SubResource("ButtonGroup_mode")
text = "Songs"
[node name="ModeSeparator" type="VSeparator" parent="Toolbar"]
layout_mode = 2
[node name="SearchField" type="LineEdit" parent="Toolbar" unique_id=1212000003]
unique_name_in_owner = true
custom_minimum_size = Vector2(480, 0)
layout_mode = 2
placeholder_text = "Search soundtracks"
clear_button_enabled = true
[node name="ClearButton" type="Button" parent="Toolbar" unique_id=1212000004]
unique_name_in_owner = true
layout_mode = 2
focus_mode = 0
text = "Clear"
[node name="CountLabel" type="Label" parent="Toolbar" unique_id=1212000005]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
horizontal_alignment = 1
[node name="ShowLabel" type="Label" parent="Toolbar" unique_id=1212000006]
layout_mode = 2
text = "Show"
[node name="ShowOption" type="OptionButton" parent="Toolbar" unique_id=1212000007]
unique_name_in_owner = true
custom_minimum_size = Vector2(160, 0)
layout_mode = 2
focus_mode = 0
selected = 0
item_count = 3
popup/item_0/text = "All"
popup/item_0/id = 0
popup/item_1/text = "Played"
popup/item_1/id = 1
popup/item_2/text = "Never played"
popup/item_2/id = 2
[node name="SortLabel" type="Label" parent="Toolbar" unique_id=1212000008]
layout_mode = 2
text = "Sort"
[node name="SortOption" type="OptionButton" parent="Toolbar" unique_id=1212000009]
unique_name_in_owner = true
custom_minimum_size = Vector2(160, 0)
layout_mode = 2
focus_mode = 0
selected = 0
item_count = 4
popup/item_0/text = "A-Z"
popup/item_0/id = 0
popup/item_1/text = "Z-A"
popup/item_1/id = 1
popup/item_2/text = "Most played"
popup/item_2/id = 2
popup/item_3/text = "Least played"
popup/item_3/id = 3
[node name="ScrollContainer" type="ScrollContainer" parent="." unique_id=1212000010]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 32.0
offset_top = 72.0
offset_right = -32.0
offset_bottom = -16.0
grow_horizontal = 2
grow_vertical = 2
horizontal_scroll_mode = 0
[node name="CardGrid" type="GridContainer" parent="ScrollContainer" unique_id=1212000011]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
theme_type_variation = &"StatisticsGrid"
columns = 6
[node name="SongList" parent="." instance=ExtResource("song_list_scene")]
unique_name_in_owner = true
visible = false
layout_mode = 1
offset_left = 32.0
offset_top = 72.0
offset_right = -32.0
offset_bottom = -16.0
[node name="SearchDelay" type="Timer" parent="."]
unique_name_in_owner = true
wait_time = 0.15
one_shot = true
[node name="StatusLabel" type="Label" parent="." unique_id=1212000012]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_top = -40.0
offset_bottom = -4.0
grow_horizontal = 2
grow_vertical = 2
theme_type_variation = &"Title"
horizontal_alignment = 1
[node name="RetryButton" type="Button" parent="." unique_id=1212000013]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -50.0
offset_top = 8.0
offset_right = 50.0
offset_bottom = 48.0
grow_horizontal = 2
grow_vertical = 2
focus_mode = 0
text = "Retry"