-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved debug content to an overlay view
updated help text for presentation mode and debug options added presentation as an option to `--style`
- Loading branch information
1 parent
2c67586
commit 3c34188
Showing
7 changed files
with
87 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// DebugOverlay.swift | ||
// Dialog | ||
// | ||
// Created by Bart E Reardon on 29/5/2024. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct DebugOverlay: View { | ||
@ObservedObject var observedData: DialogUpdatableContent | ||
@State private var windowFrame: CGSize = CGSize(width: 0, height: 0) | ||
|
||
var body: some View { | ||
if observedData.args.debug.present { | ||
// Display window information in the title bar and keep it updated | ||
VStack { | ||
HStack { | ||
Text("DEBUG - Window height: \(Int(windowFrame.width)) width: \(Int(windowFrame.height)) - Icon width: \(Int(observedData.iconSize)) alpha: \(observedData.iconAlpha)") | ||
Spacer() | ||
Text("quitkey: cmd+\(observedData.args.quitKey.value.uppercased() == observedData.args.quitKey.value ? "shift+" : "")\(observedData.args.quitKey.value.lowercased())") | ||
} | ||
.foregroundColor(observedData.appProperties.titleFontColour.opacity(0.7)) | ||
.padding(.top, 5) | ||
.padding(.leading, observedData.args.windowButtonsEnabled.present ? 70 : 5) | ||
.padding(.trailing, 5) | ||
Spacer() | ||
} | ||
.background(GeometryReader {child -> Color in | ||
if observedData.args.debug.present { | ||
DispatchQueue.main.async { | ||
// update on next cycle with calculated height | ||
self.windowFrame = child.size | ||
} | ||
} | ||
return Color.clear | ||
}) | ||
.ignoresSafeArea() | ||
.frame(width: observedData.appProperties.windowWidth, height: observedData.appProperties.windowHeight) | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters