diff --git a/src/dictlike.jl b/src/dictlike.jl index 9e1121dad..30f699f6c 100644 --- a/src/dictlike.jl +++ b/src/dictlike.jl @@ -60,7 +60,20 @@ function Base.copy(attributes::Attributes) result = Attributes() for (k, v) in attributes # We need to create a new Signal to have a real copy - result[k] = Observable{Any}(to_value(v)) + result[k] = copy(v) + end + return result +end + +function Base.deepcopy(obs::Observable) + return Observable{Any}(to_value(obs)) +end + +function Base.deepcopy(attributes::Attributes) + result = Attributes() + for (k, v) in attributes + # We need to create a new Signal to have a real copy + result[k] = deepcopy(v) end return result end diff --git a/src/theming.jl b/src/theming.jl index 8e0fdf749..869a110ba 100644 --- a/src/theming.jl +++ b/src/theming.jl @@ -105,7 +105,7 @@ const minimal_default = Attributes( ), ) -const _current_default_theme = copy(minimal_default) +const _current_default_theme = deepcopy(minimal_default) function current_default_theme(; kw_args...) return merge!(Attributes(kw_args), _current_default_theme) @@ -113,10 +113,11 @@ end function set_theme!(new_theme::Attributes) empty!(_current_default_theme) - new_theme = merge!(new_theme, minimal_default) + new_theme = merge!(new_theme, deepcopy(minimal_default)) merge!(_current_default_theme, new_theme) return end + function set_theme!(;kw_args...) set_theme!(Attributes(; kw_args...)) end diff --git a/test/ReferenceTests/src/image_download.jl b/test/ReferenceTests/src/image_download.jl index f843aecfe..3b0a2e25d 100644 --- a/test/ReferenceTests/src/image_download.jl +++ b/test/ReferenceTests/src/image_download.jl @@ -26,7 +26,7 @@ function download_refimages(tag=last_major_version()) images = basedir("refimages") isfile(images_tar) && rm(images_tar) isdir(images) && rm(images, recursive=true, force=true) - Downloads.download(url, images_tar) + Base.download(url, images_tar) Tar.extract(images_tar, images) return images end @@ -34,6 +34,5 @@ end # rm(joinpath(@__DIR__, "refimages"), force=true, recursive=true) -# +# # using Pkg.TOML -