read text aloud
This commit is contained in:
@@ -132,13 +132,14 @@ private struct PaneToggles: View {
|
||||
}
|
||||
|
||||
/// Search ⌘F · Fluid ⌘L · Hidden ⌘. · Note ⌘N, then `?`. Search and Note are actions; Fluid and Hidden toggle.
|
||||
/// While Helder reads aloud, a Stop toggle leads the group; switching it off stops the reading.
|
||||
private struct TitleToolbar: View {
|
||||
let model: WorkspaceModel
|
||||
|
||||
var body: some View {
|
||||
let layout = model.layout
|
||||
HStack(spacing: Metrics.toolbarIconGap) {
|
||||
ButtonGroup([
|
||||
ButtonGroup(stop + [
|
||||
GroupItem("Search", keys: "⌘F", kind: .action,
|
||||
tip: Text("Search the open file, the project and the file names.")) { model.perform(.showSearch(seed: "")) },
|
||||
GroupItem("Fluid", keys: "⌘L", kind: .toggle(isOn: layout.fluid),
|
||||
@@ -161,4 +162,11 @@ private struct TitleToolbar: View {
|
||||
}
|
||||
.fixedSize()
|
||||
}
|
||||
|
||||
private var stop: [GroupItem] {
|
||||
guard model.readAloud.isReading else { return [] }
|
||||
return [GroupItem("Stop", kind: .toggle(isOn: true), tip: Tooltip.stated("Read aloud: ", "playing", ". Click to stop.")) {
|
||||
model.perform(.stopReading)
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user