add DepthButton
This commit is contained in:
parent
e758168757
commit
47234f1bc1
9 changed files with 304 additions and 62 deletions
26
src/Styles.gd
Normal file
26
src/Styles.gd
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue