diff --git a/cef/build.gradle.kts b/cef/build.gradle.kts index ac6730ba2f..0f432736ab 100644 --- a/cef/build.gradle.kts +++ b/cef/build.gradle.kts @@ -5,7 +5,7 @@ import kotlin.text.capitalize plugins { kotlin("jvm") version "1.4.0" - id("org.jetbrains.compose") version "0.1.0-unmerged30" + id("org.jetbrains.compose") version "0.1.0-dev97" id("de.undercouch.download") version "4.1.1" application } @@ -42,6 +42,8 @@ val cefUnZip = run { repositories { google() jcenter() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + // temp maven("https://packages.jetbrains.team/maven/p/ui/dev") } diff --git a/cef/settings.gradle.kts b/cef/settings.gradle.kts index e7f00ef208..ad4365a737 100644 --- a/cef/settings.gradle.kts +++ b/cef/settings.gradle.kts @@ -1,7 +1,7 @@ pluginManagement { repositories { gradlePluginPortal() - maven("https://packages.jetbrains.team/maven/p/ui/dev") + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") } } diff --git a/cef/src/main/kotlin/org/jetbrains/compose/desktop/App.kt b/cef/src/main/kotlin/org/jetbrains/compose/desktop/App.kt index 3e0d30e296..57aed65bdb 100644 --- a/cef/src/main/kotlin/org/jetbrains/compose/desktop/App.kt +++ b/cef/src/main/kotlin/org/jetbrains/compose/desktop/App.kt @@ -65,7 +65,6 @@ private fun AddressBar() { ) Spacer(Modifier.width(10.dp)) Button( - backgroundColor = Color(16, 180, 140), modifier = Modifier.preferredHeight(48.dp), shape = CircleShape, onClick = { BrowserState.loadURL(BrowserState.url.value) } diff --git a/cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/BrowserState.kt b/cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/BrowserState.kt index 8b9ffaa2dc..32558fdd1f 100644 --- a/cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/BrowserState.kt +++ b/cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/BrowserState.kt @@ -25,7 +25,7 @@ object BrowserState { fun loadURL(url: String) { if (!isReady.value) { - val app = AppManager.getCurrentFocusedWindow() + val app = AppManager.focusedWindow if (app != null) { init(app, url) } @@ -86,4 +86,4 @@ object BrowserState { } return null } -} \ No newline at end of file +} diff --git a/cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/CefView.kt b/cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/CefView.kt index 5c2809f937..546531a269 100644 --- a/cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/CefView.kt +++ b/cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/CefView.kt @@ -19,7 +19,7 @@ import androidx.compose.ui.Modifier import org.jetbrains.skija.IRect import org.jetbrains.skija.Bitmap -import androidx.compose.ui.graphics.drawscope.drawCanvas +import androidx.compose.ui.graphics.drawscope.drawIntoCanvas import androidx.compose.ui.graphics.nativeCanvas import androidx.compose.runtime.getValue @@ -87,7 +87,7 @@ fun CefCanvas(bitmap: Bitmap, browser: BrowserState) { .focus() .clickable(indication = null) { focusRequester.requestFocus() } ) { - drawCanvas { canvas, size -> + drawIntoCanvas { canvas -> canvas.nativeCanvas.drawBitmapRect(bitmap, IRect(0, 0, width.value, height.value).toRect()) } } @@ -103,4 +103,4 @@ private fun Modifier.onResized(browser: BrowserState) = Modifier.layout { measur layout(placeable.width, placeable.height) { placeable.placeRelative(0, 0) } -} \ No newline at end of file +}