Create hello-platform for Linux (#13)

Co-authored-by: Михаил Капелько <kornerr@gmail.com>
This commit is contained in:
kornerr authored and Михаил Капелько committed 2026-11-02 21:40:55 +01:00
1 parent 45ca185094
commit 614392c921
23 files changed
+4720 -7

No files matched your search

+1
View File
@@ -0,0 +1 @@
../hp.swift
+11
View File
@@ -0,0 +1,11 @@
import SwiftCrossUI
final class HPVM: ObservableObject {
@Published var countText = ""
static private(set) weak var shared: HPVM?
init() {
Self.shared = self
}
}
+22
View File
@@ -0,0 +1,22 @@
import SwiftCrossUI
struct HPView: View {
@State var vm: HPVM
init(_ vm: HPVM) {
self.vm = vm
}
var body: some View {
VStack(spacing: 16) {
Text("Hello, platform!")
.font(.largeTitle)
Text(vm.countText)
.font(.title3.monospaced())
Button("Increment") {
hpSet(F.didClickIncrement, true)
}
}
.padding(40)
}
}
+1 -1
View File
@@ -12,7 +12,7 @@ struct HPView: View {
Text("Hello, platform!")
.font(.largeTitle)
Text(vm.countText)
.font(.title3.monospacedDigit())
.font(.title3.monospaced())
Button("Increment") {
hpSet(F.didClickIncrement, true)
}