mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-05-08 15:51:08 +00:00
iMove to 0.3.0-build135 and Kotlin 1.4.21.
This commit is contained in:
@@ -13,7 +13,7 @@ import androidx.compose.material.icons.filled.ArrowForward
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.drawLayer
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.jetbrains.codeviewer.ui.editor.EditorEmptyView
|
||||
import org.jetbrains.codeviewer.ui.editor.EditorTabsView
|
||||
@@ -85,7 +85,7 @@ private fun ResizablePanel(
|
||||
val alpha = animate(if (state.isExpanded) 1f else 0f, SpringSpec(stiffness = StiffnessLow))
|
||||
|
||||
Box(modifier) {
|
||||
Box(Modifier.fillMaxSize().drawLayer(alpha = alpha)) {
|
||||
Box(Modifier.fillMaxSize().graphicsLayer(alpha = alpha)) {
|
||||
content()
|
||||
}
|
||||
|
||||
|
||||
@@ -13,13 +13,11 @@ import androidx.compose.runtime.key
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.draw.drawOpacity
|
||||
import androidx.compose.ui.platform.AmbientDensity
|
||||
import androidx.compose.ui.selection.DisableSelection
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
import androidx.compose.ui.text.annotatedString
|
||||
import androidx.compose.ui.text.withStyle
|
||||
import androidx.compose.ui.text.*
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.jetbrains.codeviewer.platform.SelectionContainer
|
||||
import org.jetbrains.codeviewer.platform.VerticalScrollbar
|
||||
@@ -104,7 +102,7 @@ private fun Line(modifier: Modifier, maxNum: String, line: Editor.Line, settings
|
||||
Row(modifier = modifier) {
|
||||
DisableSelection {
|
||||
Box {
|
||||
LineNumber(maxNum, Modifier.drawOpacity(0f), settings)
|
||||
LineNumber(maxNum, Modifier.alpha(0f), settings)
|
||||
LineNumber(line.number.toString(), Modifier.align(Alignment.CenterEnd), settings)
|
||||
}
|
||||
}
|
||||
@@ -133,7 +131,7 @@ private fun LineContent(content: Editor.Content, modifier: Modifier, settings: S
|
||||
text = if (content.isCode) {
|
||||
codeString(content.value.value)
|
||||
} else {
|
||||
annotatedString {
|
||||
buildAnnotatedString {
|
||||
withStyle(AppTheme.code.simple) {
|
||||
append(content.value.value)
|
||||
}
|
||||
@@ -145,7 +143,7 @@ private fun LineContent(content: Editor.Content, modifier: Modifier, settings: S
|
||||
softWrap = false
|
||||
)
|
||||
|
||||
private fun codeString(str: String) = annotatedString {
|
||||
private fun codeString(str: String) = buildAnnotatedString {
|
||||
withStyle(AppTheme.code.simple) {
|
||||
append(str.replace("\t", " "))
|
||||
addStyle(AppTheme.code.punctuation, ":")
|
||||
|
||||
@@ -16,14 +16,14 @@ fun LazyColumnFor(
|
||||
modifier: Modifier = Modifier,
|
||||
state: LazyListState = rememberLazyListState(),
|
||||
contentPadding: PaddingValues = PaddingValues(0.dp),
|
||||
horizontalGravity: Alignment.Horizontal = Alignment.Start,
|
||||
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
|
||||
itemContent: @Composable LazyItemScope.(index: Int) -> Unit
|
||||
) = LazyColumnForIndexed(
|
||||
UnitList(size),
|
||||
modifier,
|
||||
state,
|
||||
contentPadding,
|
||||
horizontalGravity,
|
||||
items = UnitList(size),
|
||||
modifier = modifier,
|
||||
state = state,
|
||||
contentPadding = contentPadding,
|
||||
horizontalAlignment = horizontalAlignment,
|
||||
) { index, _ ->
|
||||
itemContent(index)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user