Browse Source

CEF to dev97

pull/35/head
Nikolay Igotti 4 years ago
parent
commit
765c1fd86d
  1. 4
      cef/build.gradle.kts
  2. 2
      cef/settings.gradle.kts
  3. 1
      cef/src/main/kotlin/org/jetbrains/compose/desktop/App.kt
  4. 2
      cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/BrowserState.kt
  5. 4
      cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/CefView.kt

4
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")
}

2
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")
}
}

1
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) }

2
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)
}

4
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())
}
}

Loading…
Cancel
Save