Browse Source

Make codeviewer example more photogenic (top bar color and bottom margins) (#3174)

pjBooms/scroll-text-direction-ios-bench
Sebastian Aigner 2 years ago committed by GitHub
parent
commit
fc15726b62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      examples/codeviewer/iosApp/iosApp/ContentView.swift
  2. 5
      examples/codeviewer/iosApp/iosApp/iOSApp.swift
  3. 2
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/statusbar/StatusBar.kt

2
examples/codeviewer/iosApp/iosApp/ContentView.swift

@ -13,7 +13,7 @@ struct ComposeView: UIViewControllerRepresentable {
struct ContentView: View {
var body: some View {
ComposeView()
.ignoresSafeArea(.keyboard) // Compose has own keyboard handler
.ignoresSafeArea(.all, edges: .bottom) // Compose has own keyboard handler
}
}

5
examples/codeviewer/iosApp/iosApp/iOSApp.swift

@ -4,7 +4,10 @@ import SwiftUI
struct iOSApp: App {
var body: some Scene {
WindowGroup {
ContentView()
ZStack {
Color(#colorLiteral(red: 0.235, green: 0.247, blue: 0.255, alpha: 1)).ignoresSafeArea(.all)
ContentView()
}.preferredColorScheme(.dark)
}
}
}

2
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/statusbar/StatusBar.kt

@ -18,9 +18,9 @@ private val MaxFontSize = 40.sp
@Composable
fun StatusBar(settings: Settings) = Box(
Modifier
.padding(16.dp, 4.dp, 16.dp, 16.dp)
.height(32.dp)
.fillMaxWidth()
.padding(4.dp)
) {
Row(Modifier.fillMaxHeight().align(Alignment.CenterEnd)) {
Text(

Loading…
Cancel
Save