Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix theme undefined in dialog #177

Merged
merged 1 commit into from May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/input.jl
Expand Up @@ -69,8 +69,8 @@ julia> ui[]
0-element Array{String,1}
```
"""
opendialog(::WidgetTheme; value = String[], label = "Open", icon = "far fa-folder-open", kwargs...) =
dialog(js"showOpenDialog"; value = value, label = label, icon = icon, kwargs...)
opendialog(theme::WidgetTheme; value = String[], label = "Open", icon = "far fa-folder-open", kwargs...) =
dialog(theme, js"showOpenDialog"; value = value, label = label, icon = icon, kwargs...)

"""
`savedialog(; value = String[], label = "Open", icon = "far fa-folder-open", options...)`
Expand All @@ -88,10 +88,10 @@ julia> ui[]
""
```
"""
savedialog(::WidgetTheme; value = "", label = "Save", icon = "far fa-save", kwargs...) =
dialog(js"showSaveDialog"; value = value, label = label, icon = icon, kwargs...)
savedialog(theme::WidgetTheme; value = "", label = "Save", icon = "far fa-save", kwargs...) =
dialog(theme, js"showSaveDialog"; value = value, label = label, icon = icon, kwargs...)

function dialog(dialogtype; value, className = "", label = "dialog", icon = nothing, options...)
function dialog(theme::WidgetTheme, dialogtype; value, className = "", label = "dialog", icon = nothing, options...)
(value isa AbstractObservable) || (value = Observable(value))
scp = Scope()
setobservable!(scp, "output", value)
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Expand Up @@ -10,3 +10,4 @@ using Test
include("test_observables.jl")
include("test_theme.jl")
include("test_deps.jl")
include("test_dialog.jl")
7 changes: 7 additions & 0 deletions test/test_dialog.jl
@@ -0,0 +1,7 @@
using InteractBase
using Test

@testset "Dialog" begin
@test InteractBase.opendialog() isa Widget
@test InteractBase.savedialog() isa Widget
end