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. 3
      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 { struct ContentView: View {
var body: some View { var body: some View {
ComposeView() ComposeView()
.ignoresSafeArea(.keyboard) // Compose has own keyboard handler .ignoresSafeArea(.all, edges: .bottom) // Compose has own keyboard handler
} }
} }

3
examples/codeviewer/iosApp/iosApp/iOSApp.swift

@ -4,7 +4,10 @@ import SwiftUI
struct iOSApp: App { struct iOSApp: App {
var body: some Scene { var body: some Scene {
WindowGroup { WindowGroup {
ZStack {
Color(#colorLiteral(red: 0.235, green: 0.247, blue: 0.255, alpha: 1)).ignoresSafeArea(.all)
ContentView() 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 @Composable
fun StatusBar(settings: Settings) = Box( fun StatusBar(settings: Settings) = Box(
Modifier Modifier
.padding(16.dp, 4.dp, 16.dp, 16.dp)
.height(32.dp) .height(32.dp)
.fillMaxWidth() .fillMaxWidth()
.padding(4.dp)
) { ) {
Row(Modifier.fillMaxHeight().align(Alignment.CenterEnd)) { Row(Modifier.fillMaxHeight().align(Alignment.CenterEnd)) {
Text( Text(

Loading…
Cancel
Save