Igor Demin
4 years ago
9 changed files with 25 additions and 44 deletions
@ -1,15 +1,15 @@ |
|||||||
package org.jetbrains.codeviewer.platform |
package org.jetbrains.codeviewer.platform |
||||||
|
|
||||||
import androidx.compose.runtime.Composable |
import androidx.compose.runtime.Composable |
||||||
import androidx.compose.ui.graphics.ImageAsset |
import androidx.compose.ui.graphics.ImageBitmap |
||||||
import androidx.compose.ui.text.font.Font |
import androidx.compose.ui.text.font.Font |
||||||
import androidx.compose.ui.text.font.FontStyle |
import androidx.compose.ui.text.font.FontStyle |
||||||
import androidx.compose.ui.text.font.FontWeight |
import androidx.compose.ui.text.font.FontWeight |
||||||
|
|
||||||
@Composable |
@Composable |
||||||
expect fun imageResource(res: String): ImageAsset |
expect fun imageResource(res: String): ImageBitmap |
||||||
|
|
||||||
expect suspend fun imageFromUrl(url: String): ImageAsset |
expect suspend fun imageFromUrl(url: String): ImageBitmap |
||||||
|
|
||||||
@Composable |
@Composable |
||||||
expect fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font |
expect fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font |
@ -1,14 +0,0 @@ |
|||||||
package org.jetbrains.codeviewer.util |
|
||||||
|
|
||||||
import androidx.compose.runtime.MutableState |
|
||||||
|
|
||||||
fun <T> MutableState<T>.afterSet( |
|
||||||
action: (T) -> Unit |
|
||||||
) = object : MutableState<T> by this { |
|
||||||
override var value: T |
|
||||||
get() = this@afterSet.value |
|
||||||
set(value) { |
|
||||||
this@afterSet.value = value |
|
||||||
action(value) |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue