Click to reveal Click to hide

I absolutely detest flat themes. Over time, more and more people embrace flat themes. Every operating system, every desktop environment slowly losing their bumpy themes as more and more people make only flat themes and old themes simply doesn't work anymore. Well who can blame them, flat themes can look good with very little effort compared to 3D themes.

Flat themes are nice, only if I look at it for short period. However it's really boring, and it will make me puke over long period of time.

I am currently on a mission of customizing Godot 4 and make it look sexier. I'm creating theme using Vertex theme resource. Many are using png. However there is issue.
This theme only works when opening the project in which the theme are stored.

If I open another project, the theme doesn't get applied anymore, even though the setting is the same since editor settings are global.

Is there a way to fix this issue? What caused this?
I'm guessing it's because the image texture is not inside theme.tres and is just being referenced instead, but I don't know how to embed it.

Looks like I was right. It was because the image texture is not inside theme.tres
Heeey, this forum doesn't allow webp yet. I guess I'll upload big png for now.

I haven't found a proper way to put them in there, but I made a workaround using script below.
I will left it here in case anyone need to do this. Put this script inside TabContainer and make your theme there. Then press Generate Now and it will be generated in the inspector in which you can save afterwards.

I still haven't found a way to style the button in the middle, the one that says, "2D 3D Scripts AssetLib". But it's a problem for another time.
Thanks for visiting this thread and #RejectFlatTheme!!

@tool
extends TabContainer


@export var generated_theme:Theme

@export var generate_now:bool = false:
	set(new_value):
		if new_value == true:
			print("generating...")
			generate()
			print("finished!!")


func generate():
	
	var new_theme := theme.duplicate(true)
	
	# Duplicating Icon start!!
	var icon_address := []
	for icon_type in theme.get_icon_type_list():
		new_theme.add_type(icon_type)
		for icon_name in theme.get_icon_list(icon_type):
			icon_address.append([icon_type,icon_name])
	
	for icon_path in icon_address:
		var icon_type:String = icon_path[0]
		var icon_name:String = icon_path[1]
		
		printt("laundering1 ",icon_type,icon_name)
		new_theme.set_icon(icon_name,icon_type, launder_texture(theme.get_icon(icon_name,icon_type)) )
	# duplicating icon end
	
	# duplicating texture style start
	var style_address := []
	for style_type in theme.get_stylebox_type_list():
		new_theme.add_type(style_type)
		for style_name in theme.get_stylebox_list(style_type):
			if not theme.get_stylebox(style_name,style_type) is StyleBoxTexture:
				continue
			style_address.append([style_type,style_name])
	
	for style_path in style_address:
		var style_type = style_path[0]
		var style_name = style_path[1]
		
		var stylebox:StyleBoxTexture = theme.get_stylebox(style_name,style_type).duplicate(true)
		stylebox.texture = launder_texture(stylebox.texture)
		
		print("laundering2 ",style_type,style_name)
		new_theme.set_stylebox(style_name,style_type,stylebox)
	# duplicating texture style end
	
	generated_theme = new_theme


func launder_texture(texture:Texture2D) -> Texture2D:
	var image := texture.get_image()
	var image_data := image.get_data()
	var image_width := image.get_width()
	var image_height := image.get_height()
	
	# error??
	var image_mipmap := image.has_mipmaps()
	var image_format := image.get_format()
	
	var new_image := Image.new()
	new_image.set_data(image_width,image_height,image_mipmap,image_format,image_data)
	
	var new_texture := ImageTexture.create_from_image(new_image)
	return new_texture