Changed log to use the new design
This commit is contained in:
parent
b394d9f33b
commit
a89317305e
1 changed files with 51 additions and 53 deletions
|
@ -1,10 +1,7 @@
|
|||
package app.ui
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.setValue
|
||||
|
@ -33,19 +30,21 @@ fun Diff(gitManager: GitManager, diffEntryType: DiffEntryType, onCloseDiffView:
|
|||
text = gitManager.diffFormat(diffEntryType)
|
||||
}
|
||||
|
||||
|
||||
Card(
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(8.dp)
|
||||
.background(MaterialTheme.colors.surface)
|
||||
.background(MaterialTheme.colors.background)
|
||||
.fillMaxSize()
|
||||
) {
|
||||
Column {
|
||||
OutlinedButton(
|
||||
modifier = Modifier
|
||||
.padding(vertical = 16.dp, horizontal = 16.dp)
|
||||
.align(Alignment.End),
|
||||
onClick = onCloseDiffView,
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = MaterialTheme.colors.background,
|
||||
contentColor = MaterialTheme.colors.primary,
|
||||
)
|
||||
) {
|
||||
Text("Close diff")
|
||||
}
|
||||
|
@ -56,7 +55,7 @@ fun Diff(gitManager: GitManager, diffEntryType: DiffEntryType, onCloseDiffView:
|
|||
.padding(16.dp)
|
||||
) {
|
||||
items(text) { line ->
|
||||
val isHunkLine = line.startsWith("@@") && line.endsWith("@@")
|
||||
val isHunkLine = line.startsWith("@@")
|
||||
|
||||
val backgroundColor = when {
|
||||
line.startsWith("+") -> {
|
||||
|
@ -66,10 +65,10 @@ fun Diff(gitManager: GitManager, diffEntryType: DiffEntryType, onCloseDiffView:
|
|||
Color(0x77dea2a2)
|
||||
}
|
||||
isHunkLine -> {
|
||||
MaterialTheme.colors.background
|
||||
MaterialTheme.colors.surface
|
||||
}
|
||||
else -> {
|
||||
MaterialTheme.colors.surface
|
||||
MaterialTheme.colors.background
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,5 +94,4 @@ fun Diff(gitManager: GitManager, diffEntryType: DiffEntryType, onCloseDiffView:
|
|||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue