add DepthButton

This commit is contained in:
Fabien Freling 2020-05-28 19:03:23 +02:00
parent e758168757
commit 47234f1bc1
9 changed files with 304 additions and 62 deletions

26
src/Styles.gd Normal file
View file

@ -0,0 +1,26 @@
extends Node
enum CornerType {
SINGLE,
LEFT,
MIDDLE,
RIGHT
}
var _rounded_styles = {}
func _ready():
pass # Replace with function body.
func get_key(name: String, corner_type) -> String:
return "%s_%s" % [name, CornerType.keys()[corner_type]]
func get_stylebox_flat(original: StyleBoxFlat, name: String, corner_type) -> StyleBoxFlat:
var key = get_key(name, corner_type)
if _rounded_styles.has(key):
return _rounded_styles[key]
if original != null:
return original.duplicate() as StyleBoxFlat
return StyleBoxFlat.new()