Skip to content

Commit

Permalink
More icon changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jowan-Spooner committed Sep 4, 2024
1 parent 526a3f9 commit 424fc3d
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 26 deletions.
34 changes: 13 additions & 21 deletions material_maker/nodes/edit_buttons.tscn
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
[gd_scene load_steps=6 format=3 uid="uid://cit68cso5187c"]
[gd_scene load_steps=3 format=3 uid="uid://cit68cso5187c"]

[ext_resource type="Script" path="res://material_maker/nodes/edit_buttons.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://c0j4px4n72di5" path="res://material_maker/icons/icons.tres" id="2"]

[sub_resource type="AtlasTexture" id="1"]
atlas = ExtResource("2")
region = Rect2(16, 16, 16, 16)
filter_clip = true

[sub_resource type="AtlasTexture" id="2"]
atlas = ExtResource("2")
region = Rect2(48, 16, 16, 16)

[sub_resource type="AtlasTexture" id="3"]
atlas = ExtResource("2")
region = Rect2(32, 16, 16, 16)
[ext_resource type="Script" path="res://material_maker/widgets/button_with_icon.gd" id="2_wosi8"]

[node name="NodeEditButtons" type="HBoxContainer"]
offset_right = 65.0
offset_bottom = 22.0
size_flags_horizontal = 3
alignment = 2
script = ExtResource("1")

[node name="Edit" type="Button" parent="."]
layout_mode = 2
icon = SubResource("1")
flat = true
tooltip_text = "Edit"
script = ExtResource("2_wosi8")
mm_icon = "Edit"

[node name="Load" type="Button" parent="."]
layout_mode = 2
icon = SubResource("2")
flat = true
tooltip_text = "Load"
script = ExtResource("2_wosi8")
mm_icon = "Folder"

[node name="Save" type="Button" parent="."]
layout_mode = 2
icon = SubResource("3")
flat = true
tooltip_text = "Save"
script = ExtResource("2_wosi8")
mm_icon = "Save"
6 changes: 3 additions & 3 deletions material_maker/nodes/generic/generic.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var preview_timer : Timer = Timer.new()
var generic_button : Button


const GENERIC_ICON := "Generic"#= preload("res://material_maker/icons/add_generic.tres")
const GENERIC_ICON := "Variadic"#= preload("res://material_maker/icons/add_generic.tres")


func _ready() -> void:
Expand Down Expand Up @@ -582,8 +582,8 @@ func update_node() -> void:
hsizer.custom_minimum_size.y = item_min_height if !generator.minimized else 12 * mm_globals.ui_scale
# Edit buttons
if generator.is_editable():
for theme_stylebox in ["frame", "selected_frame"]:
remove_theme_stylebox_override(theme_stylebox)
#for theme_stylebox in ["frame", "selected_frame"]:
#remove_theme_stylebox_override(theme_stylebox)
var edit_buttons = preload("res://material_maker/nodes/edit_buttons.tscn").instantiate()
add_child(edit_buttons)
edit_buttons.connect_buttons(self, "edit_generator", "load_generator", "save_generator")
Expand Down
2 changes: 1 addition & 1 deletion material_maker/nodes/minimal.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var buttons : HBoxContainer = null
var close_button : Button


const CLOSE_ICON := "Cross"
const CLOSE_ICON := "Node_Delete"


func _ready() -> void:
Expand Down
1 change: 1 addition & 0 deletions material_maker/nodes/node_button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func _notification(what: int) -> void:
if what == NOTIFICATION_THEME_CHANGED:
if mm_icon:
icon = get_theme_icon(mm_icon, "MM_Icons")
custom_minimum_size = Vector2(25, 25) * mm_globals.ui_scale


func _on_gui_input(event):
Expand Down
2 changes: 2 additions & 0 deletions material_maker/nodes/node_button.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ offset_bottom = 3.5
grow_horizontal = 2
grow_vertical = 2
size_flags_vertical = 4
focus_mode = 0
theme_type_variation = &"MM_NodeButton"
flat = true
expand_icon = true
script = ExtResource("1_f00x4")

[connection signal="gui_input" from="." to="." method="_on_gui_input"]
24 changes: 23 additions & 1 deletion material_maker/theme/modern.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="Theme" load_steps=95 format=3 uid="uid://b628lwfk6ig2c"]
[gd_resource type="Theme" load_steps=98 format=3 uid="uid://b628lwfk6ig2c"]

[ext_resource type="FontFile" uid="uid://dgkwr5jydtk6p" path="res://material_maker/theme/font_rubik/Rubik-VariableFont_wght.ttf" id="1_hqoqt"]
[ext_resource type="FontFile" uid="uid://btybkvkb8rtol" path="res://material_maker/fonts/DroidSansFallback.ttf" id="2_1xp11"]
Expand Down Expand Up @@ -230,10 +230,12 @@ corner_detail = 4
[sub_resource type="AtlasTexture" id="AtlasTexture_wv1k3"]
atlas = ExtResource("2_uo7ch")
region = Rect2(0, 80, 16, 16)
metadata/scale = 2.0

[sub_resource type="AtlasTexture" id="AtlasTexture_5mpy4"]
atlas = ExtResource("2_uo7ch")
region = Rect2(16, 80, 16, 16)
metadata/scale = 2.0

[sub_resource type="AtlasTexture" id="AtlasTexture_yl83e"]
atlas = ExtResource("2_uo7ch")
Expand All @@ -246,10 +248,12 @@ region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_wg25g"]
atlas = ExtResource("2_uo7ch")
region = Rect2(96, 64, 16, 16)
metadata/scale = 2.0

[sub_resource type="AtlasTexture" id="AtlasTexture_5laiy"]
atlas = ExtResource("2_uo7ch")
region = Rect2(112, 64, 16, 16)
metadata/scale = 2.0

[sub_resource type="AtlasTexture" id="AtlasTexture_kxvq8"]
atlas = ExtResource("2_uo7ch")
Expand All @@ -263,6 +267,10 @@ region = Rect2(64, 0, 16, 16)
atlas = ExtResource("2_uo7ch")
region = Rect2(16, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_2jd0a"]
atlas = ExtResource("2_uo7ch")
region = Rect2(0, 32, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_dqmkr"]
atlas = ExtResource("2_uo7ch")
region = Rect2(80, 80, 16, 16)
Expand All @@ -274,6 +282,12 @@ region = Rect2(32, 64, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_3dq6o"]
atlas = ExtResource("2_uo7ch")
region = Rect2(112, 48, 16, 16)
metadata/scale = 2.0

[sub_resource type="AtlasTexture" id="AtlasTexture_yjtbp"]
atlas = ExtResource("2_uo7ch")
region = Rect2(48, 0, 16, 16)
metadata/scale = 2.0

[sub_resource type="AtlasTexture" id="AtlasTexture_458ks"]
atlas = ExtResource("2_uo7ch")
Expand Down Expand Up @@ -343,6 +357,11 @@ region = Rect2(96, 80, 16, 16)
atlas = ExtResource("2_uo7ch")
region = Rect2(16, 64, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_2xv0q"]
atlas = ExtResource("2_uo7ch")
region = Rect2(32, 80, 16, 16)
metadata/scale = 2.0

[sub_resource type="AtlasTexture" id="AtlasTexture_ik36r"]
atlas = ExtResource("2_uo7ch")
region = Rect2(0, 0, 16, 16)
Expand Down Expand Up @@ -776,9 +795,11 @@ MM_Icons/icons/DiceLocked = SubResource("AtlasTexture_5laiy")
MM_Icons/icons/Download = SubResource("AtlasTexture_kxvq8")
MM_Icons/icons/Edit = SubResource("AtlasTexture_7er1n")
MM_Icons/icons/Export = SubResource("AtlasTexture_c6qxj")
MM_Icons/icons/Folder = SubResource("AtlasTexture_2jd0a")
MM_Icons/icons/Locked = SubResource("AtlasTexture_dqmkr")
MM_Icons/icons/Login = SubResource("AtlasTexture_qbea1")
MM_Icons/icons/Minimize = SubResource("AtlasTexture_3dq6o")
MM_Icons/icons/Node_Delete = SubResource("AtlasTexture_yjtbp")
MM_Icons/icons/Save = SubResource("AtlasTexture_458ks")
MM_Icons/icons/Search = SubResource("AtlasTexture_8xo65")
MM_Icons/icons/Section_3D = SubResource("AtlasTexture_yefe5")
Expand All @@ -794,6 +815,7 @@ MM_Icons/icons/Settings = SubResource("AtlasTexture_ujx26")
MM_Icons/icons/Undock = SubResource("AtlasTexture_emila")
MM_Icons/icons/Unlocked = SubResource("AtlasTexture_ucdk6")
MM_Icons/icons/Upload = SubResource("AtlasTexture_xwma0")
MM_Icons/icons/Variadic = SubResource("AtlasTexture_2xv0q")
MM_Icons/icons/View = SubResource("AtlasTexture_ik36r")
MM_MainBackground/base_type = &"PanelContainer"
MM_MainBackground/styles/panel = SubResource("StyleBoxFlat_wqwm5")
Expand Down

0 comments on commit 424fc3d

Please sign in to comment.