Skip to content

Commit

Permalink
Label style
Browse files Browse the repository at this point in the history
  • Loading branch information
garynewby committed Jan 4, 2024
1 parent 80fa07c commit 29c579f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Source/Styles/ClassicStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public struct ClassicStyle: KeyboardStyle {
let sfKeyHeightMultiplier: CGFloat
let sfKeyInsetMultiplier: CGFloat
let cornerRadiusMultiplier: CGFloat
let labelFont: Font
let labelColor: Color

public let naturalKeySpace: CGFloat
Expand All @@ -22,13 +23,15 @@ public struct ClassicStyle: KeyboardStyle {
sfKeyInsetMultiplier: CGFloat = 0.15,
cornerRadiusMultiplier: CGFloat = 0.008,
naturalKeySpace: CGFloat = 3,
labelColor: Color = .black
labelFont: Font = .title3.bold(),
labelColor: Color = .gray
) {
self.sfKeyWidthMultiplier = sfKeyWidthMultiplier
self.sfKeyHeightMultiplier = sfKeyHeightMultiplier
self.sfKeyInsetMultiplier = sfKeyInsetMultiplier
self.cornerRadiusMultiplier = cornerRadiusMultiplier
self.naturalKeySpace = naturalKeySpace
self.labelFont = labelFont
self.labelColor = labelColor
}

Expand Down Expand Up @@ -86,7 +89,7 @@ public struct ClassicStyle: KeyboardStyle {
if viewModel.showLabels {
let color = key.name.prefix(1) == "C" ? labelColor : .clear
context.draw(
Text(key.name).font(.headline).bold().foregroundColor(color),
Text(key.name).font(labelFont).foregroundColor(color),
at: CGPoint(x: rect.origin.x + rect.width / 2.0, y: rect.origin.y + rect.height * 0.88)
)
}
Expand Down

0 comments on commit 29c579f

Please sign in to comment.