From d3be9f51cfa13f69c6b1e9da5e75055990f4525d Mon Sep 17 00:00:00 2001 From: Nordup Date: Thu, 20 Mar 2025 04:08:00 +0400 Subject: [PATCH] hires tab icon --- app/assets/textures/icon_round_32.png | Bin 0 -> 1509 bytes app/assets/textures/icon_round_32.png.import | 34 +++++++++++++++++++ app/scenes/components/tab.tscn | 22 ++++++++++-- app/scripts/ui/tabs/tab_icon.gd | 13 +++++++ 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 app/assets/textures/icon_round_32.png create mode 100644 app/assets/textures/icon_round_32.png.import create mode 100644 app/scripts/ui/tabs/tab_icon.gd diff --git a/app/assets/textures/icon_round_32.png b/app/assets/textures/icon_round_32.png new file mode 100644 index 0000000000000000000000000000000000000000..69a9c04499a531805860d84ab1d02f0e53ab4bac GIT binary patch literal 1509 zcmVh8GC>|FMo^IZBcmz~SmoK)z*Fo$8@ z=l6gA&*eSGP*wb&m*-X%Z{OZCZ1d(w^{vD(N_8L+Qv2=ihIkBG&KeLZ;ODPJK^(qte3==cUWY!kb+6TB#`uX@x8`{xY-}0jqCSL zj^4C@P{^6XwtT@Xlb8i1!n3~#$rWO}xOLCnNB*;bP{>}+j)s_|A{Xv8757f{VN|V& z5hFY>48`>@qx-UrpH9RP>2nIjF|n*`Zn>|iWC5X&{R}($Ig=Q<@EJ3Gm|I^Czu#~b zO{DnlSQKBj^un?8ol%xGI}T5K_l5#??Q&)bNo(QG=RZ=0S#!#={|omJ!aW3GMOC#I zwRJuiX=zyc-_5@X4(ucjX!Qb0=!{Lwz^Y+=qPOfs>ku@V5#dzEl_ zUj!E~Sa~_WBWR-W`5-3VQw{()5W0fn2YWMcFe!wjFJW1e_nnw~EyK*41N{-}HMfGR ze>4@eKPuS$@wFnjkf8gLg&i9&q4R;cC9P&WV|P-$YuL&J078L_V~ zo83C5NPv|{Ji#o%!d4r9mlpuQtmybL0TscsuLRMsq8fpK0n=;X$;KMI`Sy5teZaZX zF0v0I;4jZFQer<*X4WK5e?fpHW3_;5ofb~krpPjeSG ztvZj23J)GzSOX@(`QH-&fYEhjMe)*;b8)c%(t5YSQd#Lq=bs^@xPL|fXHLb@(`94Y zgB6%Fe>h@MLhI3Mm^p7am;{lu10zOyi{YtHy6-6ouw$^aZIK~S5R$-xy02@p0=8|tHiAipxs6w( zyHqt*Or{AqwxG7ohmQ6rI!;9~daNIgEik<)ph{*Dh8WulgLG_GKs;`mL(TTgoKQ_U z001fiRe;h%Mnoa387Bt?0IqN*0g0Mf0c+P*^)XA*?O+*nARSx*Va2)AF(mp4OoE?J zL|g@A))c~p1e~PK{2Fki%k5Otv;vh>3ep{eKYooN5hE}uI!;C)EZH6BI^YT?v0G#9 z;ruROZF4(Pvy(cL0#&GF+I4WqJ+p*r%b3k4Z=EqB&jCv@;^=5A3-m)WpD;X>7hHMdvLRj!w^Ch?Oit}e<*s|)k z{2G8u7qGCS&cO^f>p)XeuwR(B6b3GIzztrs!yE?+;1JSKd$RGbA^`y4_axq9lJ4Aq z`E7V(cwXHAd2l94vZEVvnRx=%e>645q%Q~w4W?kwfl}a1nyrCs3ewL6;>gN&U3_s! z0RXUd@8qLIx+b&mde}ivmyJl+E(y*gh=y%kzL3C`i^;(U5|;Pdb?GOCydfV-Uv21E zO(dI`)KlutT?#G@*AFI&^VU9H&Ls-~fR~^6Wg(I5VUp^bgeTdNH%{r&PlsaM@Wtfm zd2KbOnyZy$C6knw2p1vQ4@XzG>5>co7Qf_Ivt_ee#~2ot5a|*osTYz!;do_|lfrz6 z)HrZ5*>Jv;xFriHycX4c6SUZ_byQ7H-0D6aTXf}S;@q@=+jac|A4JIRRd;mF00000 LNkvXXu0mjfLGr(x literal 0 HcmV?d00001 diff --git a/app/assets/textures/icon_round_32.png.import b/app/assets/textures/icon_round_32.png.import new file mode 100644 index 0000000..055d5e0 --- /dev/null +++ b/app/assets/textures/icon_round_32.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cwclokgfijavb" +path="res://.godot/imported/icon_round_32.png-94be4e4ec9838a368ee616a959216155.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/textures/icon_round_32.png" +dest_files=["res://.godot/imported/icon_round_32.png-94be4e4ec9838a368ee616a959216155.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/app/scenes/components/tab.tscn b/app/scenes/components/tab.tscn index d11610b..3f5d696 100644 --- a/app/scenes/components/tab.tscn +++ b/app/scenes/components/tab.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=9 format=3 uid="uid://dkfy3rcfbxqc6"] +[gd_scene load_steps=11 format=3 uid="uid://dkfy3rcfbxqc6"] [ext_resource type="StyleBox" uid="uid://cf4jgdfsjmjxl" path="res://assets/styles/tab.stylebox" id="1_8hbf0"] +[ext_resource type="Script" path="res://scripts/ui/tabs/tab_icon.gd" id="2_2mqph"] [ext_resource type="LabelSettings" uid="uid://bo2334w4lf3ug" path="res://assets/styles/text.tres" id="2_gll4d"] [ext_resource type="Texture2D" uid="uid://db7adnvbsxena" path="res://assets/textures/icon_round_16.png" id="2_pitbs"] [ext_resource type="Texture2D" uid="uid://cli88m5w3op6l" path="res://assets/textures/close_tab.svg" id="2_y6odh"] +[ext_resource type="Texture2D" uid="uid://cwclokgfijavb" path="res://assets/textures/icon_round_32.png" id="3_p1x2u"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_rxuw8"] @@ -47,11 +49,14 @@ theme_override_constants/margin_right = 10 layout_mode = 2 theme_override_constants/separation = 7 -[node name="Panel" type="Panel" parent="MarginContainer/HBoxContainer"] +[node name="Panel" type="Panel" parent="MarginContainer/HBoxContainer" node_paths=PackedStringArray("icon", "icon_hires")] custom_minimum_size = Vector2(16, 16) layout_mode = 2 size_flags_vertical = 4 theme_override_styles/panel = SubResource("StyleBoxEmpty_rxuw8") +script = ExtResource("2_2mqph") +icon = NodePath("TextureRect") +icon_hires = NodePath("TextureRectHiRes") [node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/Panel"] texture_filter = 6 @@ -66,6 +71,19 @@ texture = ExtResource("2_pitbs") expand_mode = 1 stretch_mode = 5 +[node name="TextureRectHiRes" type="TextureRect" parent="MarginContainer/HBoxContainer/Panel"] +texture_filter = 6 +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_vertical = 4 +texture = ExtResource("3_p1x2u") +expand_mode = 1 +stretch_mode = 5 + [node name="Label" type="Label" parent="MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 diff --git a/app/scripts/ui/tabs/tab_icon.gd b/app/scripts/ui/tabs/tab_icon.gd new file mode 100644 index 0000000..43a3112 --- /dev/null +++ b/app/scripts/ui/tabs/tab_icon.gd @@ -0,0 +1,13 @@ +extends Panel + +@export var icon: TextureRect +@export var icon_hires: TextureRect + + +func _ready() -> void: + if DisplayServer.screen_get_scale() == 2.0: + icon.hide() + icon_hires.show() + else: + icon.show() + icon_hires.hide()