bookmarks redesign

This commit is contained in:
Nordup 2024-11-22 12:20:49 +04:00
parent cce0bedbb1
commit ddae024043
4 changed files with 78 additions and 46 deletions

View file

@ -0,0 +1,8 @@
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://85ms8ndcmbn0"]
[ext_resource type="FontFile" uid="uid://c14w1y1r54wgi" path="res://assets/fonts/Inter-Bold.otf" id="1_eh4y8"]
[resource]
font = ExtResource("1_eh4y8")
font_size = 14
font_color = Color(0.831373, 0.831373, 0.831373, 1)

View file

@ -1,67 +1,61 @@
[gd_scene load_steps=6 format=3 uid="uid://82ca8so31njy"] [gd_scene load_steps=7 format=3 uid="uid://82ca8so31njy"]
[ext_resource type="Script" path="res://scripts/ui/menu/bookmark_ui.gd" id="1_bpkqj"] [ext_resource type="Script" path="res://scripts/ui/menu/bookmark_ui.gd" id="1_bpkqj"]
[ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_7i5yr"] [ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_7i5yr"]
[ext_resource type="Texture2D" uid="uid://cykx425p6ylwr" path="res://assets/textures/background.png" id="3_kgutt"] [ext_resource type="Texture2D" uid="uid://cykx425p6ylwr" path="res://assets/textures/background.png" id="3_kgutt"]
[ext_resource type="LabelSettings" uid="uid://85ms8ndcmbn0" path="res://assets/styles/text_small.tres" id="4_xqjm8"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_40hft"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_40hft"]
bg_color = Color(0.25098, 0.25098, 0.25098, 1) bg_color = Color(0.113725, 0.117647, 0.14902, 1)
corner_radius_top_left = 16 corner_radius_top_left = 25
corner_radius_top_right = 16 corner_radius_top_right = 25
corner_radius_bottom_right = 16 corner_radius_bottom_right = 25
corner_radius_bottom_left = 16 corner_radius_bottom_left = 25
shadow_color = Color(0.0862745, 0.0901961, 0.117647, 0.784314)
shadow_size = 4
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_od0ga"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_od0ga"]
corner_radius_top_left = 16 corner_radius_top_left = 20
corner_radius_top_right = 16 corner_radius_top_right = 20
corner_radius_bottom_right = 16 corner_radius_bottom_right = 20
corner_radius_bottom_left = 16 corner_radius_bottom_left = 20
[node name="Bookmark" type="Control" node_paths=PackedStringArray("image", "title")] [node name="Bookmark" type="Control" node_paths=PackedStringArray("image", "title")]
clip_children = 1 clip_children = 1
custom_minimum_size = Vector2(130, 166) custom_minimum_size = Vector2(180, 100)
layout_mode = 3 layout_mode = 3
anchors_preset = 0 anchors_preset = 0
offset_right = 130.0 offset_right = 180.0
offset_bottom = 160.0 offset_bottom = 100.0
script = ExtResource("1_bpkqj") script = ExtResource("1_bpkqj")
gate_events = ExtResource("2_7i5yr") gate_events = ExtResource("2_7i5yr")
image = NodePath("VBoxContainer/Panel/Mask/Image") image = NodePath("Mask/Image")
title = NodePath("VBoxContainer/Title") title = NodePath("Title")
[node name="VBoxContainer" type="VBoxContainer" parent="."] [node name="Panel" type="Panel" parent="."]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme_override_constants/separation = 10
[node name="Panel" type="Panel" parent="VBoxContainer"]
custom_minimum_size = Vector2(130, 130)
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_40hft") theme_override_styles/panel = SubResource("StyleBoxFlat_40hft")
[node name="Mask" type="Panel" parent="VBoxContainer/Panel"] [node name="Mask" type="Panel" parent="."]
clip_children = 1 clip_children = 1
custom_minimum_size = Vector2(87, 87)
layout_mode = 1 layout_mode = 1
anchors_preset = 8 anchors_preset = 5
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 0.5 offset_left = -20.0
offset_left = -43.5 offset_top = 15.0
offset_top = -43.5 offset_right = 20.0
offset_right = 43.5 offset_bottom = 55.0
offset_bottom = 43.5
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2
mouse_filter = 1 mouse_filter = 1
theme_override_styles/panel = SubResource("StyleBoxFlat_od0ga") theme_override_styles/panel = SubResource("StyleBoxFlat_od0ga")
[node name="Image" type="TextureRect" parent="VBoxContainer/Panel/Mask"] [node name="Image" type="TextureRect" parent="Mask"]
custom_minimum_size = Vector2(87, 87) custom_minimum_size = Vector2(87, 87)
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
@ -73,13 +67,22 @@ size_flags_horizontal = 4
size_flags_vertical = 4 size_flags_vertical = 4
texture = ExtResource("3_kgutt") texture = ExtResource("3_kgutt")
expand_mode = 1 expand_mode = 1
stretch_mode = 6 stretch_mode = 5
[node name="Title" type="Label" parent="VBoxContainer"] [node name="Title" type="Label" parent="."]
layout_mode = 2 layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -70.0
offset_top = 70.0
offset_right = 70.0
offset_bottom = 88.0
grow_horizontal = 2
theme_override_colors/font_color = Color(1, 1, 1, 0.8) theme_override_colors/font_color = Color(1, 1, 1, 0.8)
theme_override_font_sizes/font_size = 20 theme_override_font_sizes/font_size = 20
text = "Unnamed" text = "Unnamed"
label_settings = ExtResource("4_xqjm8")
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
text_overrun_behavior = 3 text_overrun_behavior = 3

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://ca647gp63bshc"] [gd_scene load_steps=7 format=3 uid="uid://ca647gp63bshc"]
[ext_resource type="Texture2D" uid="uid://bw1cffhlt112i" path="res://assets/textures/icon-round.svg" id="1_dh3vr"] [ext_resource type="Texture2D" uid="uid://bw1cffhlt112i" path="res://assets/textures/icon-round.svg" id="1_dh3vr"]
[ext_resource type="Script" path="res://scripts/ui/menu/bookmark_container.gd" id="1_g38mt"] [ext_resource type="Script" path="res://scripts/ui/menu/bookmark_container.gd" id="1_g38mt"]
[ext_resource type="Resource" uid="uid://bewhdj6jugt6q" path="res://resources/bookmarks.tres" id="2_2igc6"] [ext_resource type="Resource" uid="uid://bewhdj6jugt6q" path="res://resources/bookmarks.tres" id="2_2igc6"]
[ext_resource type="Script" path="res://addons/max_size_container/max_size_container.gd" id="2_ceb6w"] [ext_resource type="Script" path="res://addons/max_size_container/max_size_container.gd" id="2_ceb6w"]
[ext_resource type="PackedScene" uid="uid://ctam0fxigbefk" path="res://scenes/components/search.tscn" id="3_fcjeu"]
[ext_resource type="PackedScene" uid="uid://82ca8so31njy" path="res://scenes/components/bookmark.tscn" id="3_isdis"] [ext_resource type="PackedScene" uid="uid://82ca8so31njy" path="res://scenes/components/bookmark.tscn" id="3_isdis"]
[node name="Home" type="Control"] [node name="Home" type="Control"]
@ -32,7 +33,7 @@ size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="SpaceTop" type="Control" parent="ScrollContainer/VBoxContainer"] [node name="SpaceTop" type="Control" parent="ScrollContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 240) custom_minimum_size = Vector2(0, 300)
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
@ -59,27 +60,47 @@ size_flags_vertical = 3
[node name="SpaceLeft" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer"] [node name="SpaceLeft" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(200, 0) custom_minimum_size = Vector2(200, 0)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3
[node name="MaxSizeContainer" type="MarginContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(200, 400)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_stretch_ratio = 3.0
[node name="MaxSizeContainer2" type="MarginContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
custom_minimum_size = Vector2(300, 0)
layout_mode = 2
theme_override_constants/margin_left = 0 theme_override_constants/margin_left = 0
theme_override_constants/margin_top = 0 theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 0 theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0 theme_override_constants/margin_bottom = 0
script = ExtResource("2_ceb6w") script = ExtResource("2_ceb6w")
limit = Vector2(1200, -1) limit = Vector2(720, -1)
[node name="Search" parent="ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer/MaxSizeContainer2" instance=ExtResource("3_fcjeu")]
layout_mode = 2
[node name="SpaceMid" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 60)
layout_mode = 2
[node name="MaxSizeContainer" type="MarginContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
custom_minimum_size = Vector2(180, 400)
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 2.0
theme_override_constants/margin_left = 0
theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0
script = ExtResource("2_ceb6w")
limit = Vector2(950, -1)
valign = 0 valign = 0
[node name="Bookmarks" type="HFlowContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer/MaxSizeContainer"] [node name="Bookmarks" type="HFlowContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer/MaxSizeContainer"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
theme_override_constants/h_separation = 70 theme_override_constants/h_separation = 6
theme_override_constants/v_separation = 40 theme_override_constants/v_separation = 6
alignment = 1 alignment = 1
last_wrap_alignment = 1 last_wrap_alignment = 1
script = ExtResource("1_g38mt") script = ExtResource("1_g38mt")
@ -89,7 +110,6 @@ bookmark_scene = ExtResource("3_isdis")
[node name="SpaceRight" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer"] [node name="SpaceRight" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(200, 0) custom_minimum_size = Vector2(200, 0)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3
[node name="SpaceBottom" type="Control" parent="ScrollContainer/VBoxContainer"] [node name="SpaceBottom" type="Control" parent="ScrollContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 120) custom_minimum_size = Vector2(0, 120)

View file

@ -5,6 +5,7 @@ extends Control
func _ready() -> void: func _ready() -> void:
search_le.resized.connect(change_size) search_le.resized.connect(change_size)
search_le.focus_entered.connect(change_size)
func change_size() -> void: func change_size() -> void: