Skip to content

Add option to change label and label value fontsize in SligerGrid #4983

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/makielayout/blocks/slidergrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ function initialize_block!(sg::SliderGrid, nts::NamedTuple...)
range = nt.range
format = haskey(nt, :format) ? nt.format : default_format
remaining_pairs = filter(pair -> pair[1] ∉ (:label, :range, :format), pairs(nt))
l = Label(sg.layout[i, 1], label, halign = :left)
l = Label(sg.layout[i, 1], label, halign = :left, fontsize = sg.labelsize)
slider = Slider(sg.layout[i, 2]; range = range, remaining_pairs...)
vl = Label(sg.layout[i, 3],
lift(x -> apply_format(x, format), slider.value), halign = :right)
lift(x -> apply_format(x, format), slider.value), halign = :right,fontsize = sg.valuesize)
push!(sg.valuelabels, vl)
push!(sg.sliders, slider)
push!(sg.labels, l)
Expand Down
4 changes: 4 additions & 0 deletions src/makielayout/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,10 @@
alignmode = Inside()
"The width of the value label column. If `automatic`, the width is determined by sampling a few values from the slider ranges and picking the largest label size found."
value_column_width = automatic
"The font size of the entry labels."
labelsize = @inherit(:fontsize, 16f0)
"The font size of the entry value labels."
valuesize = @inherit(:fontsize, 16f0)
end
end

Expand Down Expand Up @@ -1372,7 +1376,7 @@
if hasfield(typeof(le), :plots)
return le.plots
else
@warn """LegendElements should now keep track of the plots they respresent in a `plots` field.

Check failure on line 1379 in src/makielayout/types.jl

View workflow job for this annotation

GitHub Actions / check

respresent ==> represent
This can be `nothing` or a `Vector{Plot}`. Without this, the Legend won't be able to
toggle visibility of the associated plots. The `plots` field is missing in: $(le)
"""
Expand Down
Loading