Skip to content

Commit

Permalink
Fix Legend constructor compatibility with Makie 0.20.
Browse files Browse the repository at this point in the history
  • Loading branch information
ztangent committed Jan 12, 2024
1 parent 1ca026d commit 41d322e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/control.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,21 @@ function render_controls!(
append!(buttons, controller.extrakeys)
append!(labels, fill(' '^40, length(controller.extrakeys)))
markers = _keyboard_button_marker.(buttons)


entries = [LegendEntry(m, Attributes(label=l, labelcolor=:black))
for (l, m) in zip(labels, markers)]
entrygroups = Observable(Makie.EntryGroup[("Controls", entries)])
controls = Legend(figure[1, end+1], entrygroups;
framevisible=false, labelsize=14,
halign=:left, titlehalign=:left)
controls = nothing
try
controls = Legend(figure[1, end+1], entrygroups;
framevisible=false, labelsize=14,
halign=:left, titlehalign=:left)
catch
controls = Legend(figure[1, end+1]; entrygroups=entrygroups,
framevisible=false, labelsize=14,
halign=:left, titlehalign=:left)
end
resize_to_layout!(figure)
# Extract observables from entries
label_obs = Observable[]
Expand Down

0 comments on commit 41d322e

Please sign in to comment.