Skip to content

Commit 55dc5b7

Browse files
authored
Merge pull request #712 from Jowan-Spooner/new_icons
New theme icons
2 parents 755f7c5 + fce82c9 commit 55dc5b7

File tree

362 files changed

+5561
-7303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+5561
-7303
lines changed

addons/flexible_layout/flexible_tab.gd

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ var updating : bool = false
66

77

88
func _ready():
9-
$Container/Close.texture_normal = get_theme_icon("close", "TabBar")
109
update()
1110

1211
func _notification(what):
@@ -23,6 +22,10 @@ func get_flex_layout():
2322
return flex_tab.flexible_layout
2423

2524
func update():
25+
$Container/Close.texture_normal = get_theme_icon("close", "MM_FlexibleTab")
26+
$Container/Close.modulate = get_theme_color("font_selected_color", "MM_FlexibleTab")
27+
$Container/Undock.texture_normal = get_theme_icon("undock", "MM_FlexibleTab")
28+
$Container/Undock.modulate = get_theme_color("font_selected_color", "MM_FlexibleTab")
2629
if not updating:
2730
updating = true
2831
var is_current: bool = (get_index() == get_parent().get_parent().current)

addons/flexible_layout/flexible_tab.tscn

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
[gd_scene load_steps=4 format=3 uid="uid://e06xegp2tp3f"]
1+
[gd_scene load_steps=3 format=3 uid="uid://e06xegp2tp3f"]
22

3-
[ext_resource type="Script" uid="uid://ywxnr7grll4s" path="res://addons/flexible_layout/flexible_tab.gd" id="1"]
4-
[ext_resource type="Texture2D" uid="uid://xuy6dfh1rsne" path="res://addons/flexible_layout/undock.png" id="2_nx0qp"]
3+
[ext_resource type="Script" path="res://addons/flexible_layout/flexible_tab.gd" id="1"]
54

65
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_bok24"]
76
size = Vector2(16, 16)
@@ -31,7 +30,6 @@ visible = false
3130
layout_mode = 2
3231
size_flags_horizontal = 4
3332
size_flags_vertical = 4
34-
texture_normal = ExtResource("2_nx0qp")
3533

3634
[node name="Close" type="TextureButton" parent="Container"]
3735
visible = false

material_maker/main_window.tscn

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
[ext_resource type="Script" uid="uid://ds4jcblbferbu" path="res://material_maker/tools/library_manager/library_manager.gd" id="14"]
1616
[ext_resource type="Texture2D" path="res://material_maker/icons/paste_none.tres" id="15"]
1717

18+
1819
[sub_resource type="GDScript" id="6"]
1920
script/source = "extends Label
2021

material_maker/main_window_projects_panel.gd

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ extends Control
99
@onready var preview_3d_background_panel = $PreviewUI/Panel
1010

1111

12+
func _notification(what: int) -> void:
13+
if what == NOTIFICATION_THEME_CHANGED:
14+
if not is_node_ready():
15+
await ready
16+
preview_2d_background_button.icon = get_theme_icon("2D_preview", "MM_Icons")
17+
preview_3d_background_button.icon = get_theme_icon("3D_preview", "MM_Icons")
18+
%ControlView.texture = get_theme_icon("3D_preview_control", "MM_Icons")
19+
1220
func get_projects():
1321
return projects
1422

material_maker/nodes/reroute/reroute.gd

+13-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const PREVIEW_SIZES : Array[int] = [ 0, 64, 128, 192]
77
func _ready() -> void:
88
super._ready()
99
close_button.visible = false
10-
set_theme_type("Reroute")
10+
theme_type_variation = "MM_Reroute"
11+
#set_theme_type("Reroute")
1112
on_connections_changed.call_deferred()
1213

1314
func set_generator(g : MMGenBase) -> void:
@@ -16,12 +17,13 @@ func set_generator(g : MMGenBase) -> void:
1617
await set_preview(g.get_parameter("preview"))
1718
update_node()
1819

19-
func set_theme_type(type : StringName):
20-
var current_theme : Theme = mm_globals.main_window.theme
21-
for constant in current_theme.get_constant_list(type):
22-
add_theme_constant_override(constant, current_theme.get_constant(constant, type))
23-
for stylebox in current_theme.get_stylebox_list(type):
24-
add_theme_stylebox_override(stylebox, current_theme.get_stylebox(stylebox, type))
20+
21+
#func set_theme_type(type : StringName):
22+
#var current_theme : Theme = mm_globals.main_window.theme
23+
#for constant in current_theme.get_constant_list(type):
24+
#add_theme_constant_override(constant, current_theme.get_constant(constant, type))
25+
#for stylebox in current_theme.get_stylebox_list(type):
26+
#add_theme_stylebox_override(stylebox, current_theme.get_stylebox(stylebox, type))
2527

2628
func on_connections_changed():
2729
var graph_edit = get_parent()
@@ -95,7 +97,8 @@ func set_preview(v : int):
9597
if v == 0:
9698
if preview:
9799
preview.queue_free()
98-
set_theme_type("Reroute")
100+
theme_type_variation = "MM_Reroute"
101+
#set_theme_type("Reroute")
99102
else:
100103
if ! preview:
101104
preview = preload("res://material_maker/panels/preview_2d/preview_2d_node.tscn").instantiate()
@@ -104,6 +107,7 @@ func set_preview(v : int):
104107
update_preview(preview)
105108
var preview_size : int = PREVIEW_SIZES[v]
106109
preview.custom_minimum_size = Vector2(preview_size, preview_size)
107-
set_theme_type("ReroutePreview")
110+
#set_theme_type("ReroutePreview")
111+
theme_type_variation = "MM_ReroutePreview"
108112
await get_tree().process_frame
109113
size = Vector2(0, 0)

material_maker/panels/library/library.gd

+11
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ func _ready() -> void:
3939
libraries_button.get_popup().id_pressed.connect(self._on_Libraries_id_pressed)
4040
init_expanded_items()
4141
update_tree()
42+
update_theme()
43+
44+
func _notification(what: int) -> void:
45+
if not is_node_ready():
46+
return
47+
48+
if what == NOTIFICATION_THEME_CHANGED:
49+
update_theme()
50+
51+
func update_theme() -> void:
52+
libraries_button.icon = get_theme_icon("settings", "MM_Icons")
4253

4354
func init_expanded_items() -> void:
4455
var f = FileAccess.open("user://expanded_items.bin", FileAccess.READ)

material_maker/panels/preview_3d/preview_3d_ui.gd

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ var target_node
55

66
func _ready() -> void:
77
target_node = get_node(target)
8+
9+
$Model.icon = get_theme_icon("model", "MM_Icons")
10+
$Environment.icon = get_theme_icon("environment", "MM_Icons")

material_maker/panels/preview_3d/preview_3d_ui.tscn

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
[gd_scene load_steps=4 format=3 uid="uid://brlp703awvxbn"]
1+
[gd_scene load_steps=5 format=3 uid="uid://brlp703awvxbn"]
22

3+
[ext_resource type="Script" path="res://material_maker/panels/preview_3d/preview_3d_ui.gd" id="1_oc43p"]
34
[ext_resource type="Texture2D" uid="uid://c0j4px4n72di5" path="res://material_maker/icons/icons.tres" id="2"]
45

56
[sub_resource type="AtlasTexture" id="1"]
@@ -15,6 +16,7 @@ anchors_preset = 10
1516
anchor_right = 1.0
1617
offset_bottom = 20.0
1718
size_flags_horizontal = 3
19+
script = ExtResource("1_oc43p")
1820

1921
[node name="Model" type="MenuButton" parent="."]
2022
layout_mode = 2

material_maker/projects_panel.tscn

+7-22
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
[gd_scene load_steps=12 format=3 uid="uid://bnqq3vhwmudkw"]
1+
[gd_scene load_steps=8 format=3 uid="uid://bnqq3vhwmudkw"]
22

33
[ext_resource type="Script" uid="uid://cryayuomvuwbo" path="res://material_maker/main_window_projects_panel.gd" id="1_m3usq"]
44
[ext_resource type="PackedScene" uid="uid://bb6iar0tbj2qt" path="res://material_maker/panels/preview_2d/preview_2d.tscn" id="2_oiaqi"]
55
[ext_resource type="PackedScene" uid="uid://dpaxvlnn2u1f6" path="res://material_maker/panels/preview_3d/preview_3d.tscn" id="3_qvj7k"]
6-
[ext_resource type="Script" uid="uid://bl15iwn2k8qm" path="res://material_maker/widgets/tabs/tabs.gd" id="4_mpinq"]
7-
[ext_resource type="Texture2D" uid="uid://c0j4px4n72di5" path="res://material_maker/icons/icons.tres" id="5_1qnqj"]
6+
[ext_resource type="Script" path="res://material_maker/widgets/tabs/tabs.gd" id="4_mpinq"]
87
[ext_resource type="PackedScene" uid="uid://brlp703awvxbn" path="res://material_maker/panels/preview_3d/preview_3d_ui.tscn" id="6_mpc0m"]
98

109
[sub_resource type="Shader" id="1"]
@@ -15,18 +14,6 @@ resource_local_to_scene = true
1514
render_priority = 0
1615
shader = SubResource("1")
1716

18-
[sub_resource type="AtlasTexture" id="3"]
19-
atlas = ExtResource("5_1qnqj")
20-
region = Rect2(96, 96, 32, 32)
21-
22-
[sub_resource type="AtlasTexture" id="4"]
23-
atlas = ExtResource("5_1qnqj")
24-
region = Rect2(96, 32, 32, 32)
25-
26-
[sub_resource type="AtlasTexture" id="5"]
27-
atlas = ExtResource("5_1qnqj")
28-
region = Rect2(96, 64, 32, 31)
29-
3017
[node name="ProjectsPanel" type="Control"]
3118
clip_contents = true
3219
custom_minimum_size = Vector2(100, 100)
@@ -118,24 +105,22 @@ layout_mode = 1
118105
anchors_preset = 2
119106
anchor_top = 1.0
120107
anchor_bottom = 1.0
121-
offset_left = 5.5
122-
offset_top = -53.5
123-
offset_right = 335.5
124-
offset_bottom = -13.5
108+
offset_left = 11.5
109+
offset_top = -24.5
110+
offset_right = 95.5
111+
offset_bottom = -16.5
125112
grow_vertical = 0
126113
mouse_filter = 2
127114

128115
[node name="Preview2DButton" type="Button" parent="PreviewUI"]
129116
layout_mode = 2
130117
tooltip_text = "Show 2D preview"
131118
toggle_mode = true
132-
icon = SubResource("3")
133119

134120
[node name="Preview3DButton" type="Button" parent="PreviewUI"]
135121
layout_mode = 2
136122
tooltip_text = "Show 3D preview"
137123
toggle_mode = true
138-
icon = SubResource("4")
139124

140125
[node name="Panel" type="PanelContainer" parent="PreviewUI"]
141126
visible = false
@@ -148,9 +133,9 @@ layout_mode = 2
148133
layout_mode = 2
149134

150135
[node name="ControlView" type="TextureRect" parent="PreviewUI/Panel/HBoxContainer"]
136+
unique_name_in_owner = true
151137
layout_mode = 2
152138
size_flags_vertical = 4
153-
texture = SubResource("5")
154139

155140
[node name="Preview3DUI" parent="PreviewUI/Panel/HBoxContainer" instance=ExtResource("6_mpc0m")]
156141
layout_mode = 2

0 commit comments

Comments
 (0)