Changed multiple elements colors
Button and log border
This commit is contained in:
parent
7a86ed8227
commit
82d9479e55
@ -10,6 +10,8 @@ val mainText = Color(0xFF212934)
|
|||||||
val mainTextDark = Color(0xFFFFFFFF)
|
val mainTextDark = Color(0xFFFFFFFF)
|
||||||
val secondaryText = Color(0xFF595858)
|
val secondaryText = Color(0xFF595858)
|
||||||
val secondaryTextDark = Color(0xFFCCCBCB)
|
val secondaryTextDark = Color(0xFFCCCBCB)
|
||||||
|
val borderColorLight = Color(0xFF989898)
|
||||||
|
val borderColorDark = Color(0xFF989898)
|
||||||
val errorColor = Color(0xFFc93838)
|
val errorColor = Color(0xFFc93838)
|
||||||
|
|
||||||
val backgroundColorLight = Color(0xFFFFFFFF)
|
val backgroundColorLight = Color(0xFFFFFFFF)
|
||||||
|
@ -54,11 +54,11 @@ val Colors.secondaryTextColor: Color
|
|||||||
get() = if (isLight) secondaryText else secondaryTextDark
|
get() = if (isLight) secondaryText else secondaryTextDark
|
||||||
|
|
||||||
@get:Composable
|
@get:Composable
|
||||||
val Colors.semiSecondaryTextColor: Color
|
val Colors.borderColor: Color
|
||||||
get() = if (isLight)
|
get() = if (isLight)
|
||||||
secondaryText.copy(alpha = 0.3f)
|
borderColorLight
|
||||||
else
|
else
|
||||||
secondaryTextDark.copy(alpha = 0.3f)
|
borderColorDark
|
||||||
|
|
||||||
@get:Composable
|
@get:Composable
|
||||||
val Colors.headerBackground: Color
|
val Colors.headerBackground: Color
|
||||||
@ -112,6 +112,12 @@ val Colors.stageButton: Color
|
|||||||
val Colors.unstageButton: Color
|
val Colors.unstageButton: Color
|
||||||
get() = error
|
get() = error
|
||||||
|
|
||||||
|
val Colors.abortButton: Color
|
||||||
|
get() = error
|
||||||
|
|
||||||
|
val Colors.confirmationButton: Color
|
||||||
|
get() = if (isLight) primary else primaryDark
|
||||||
|
|
||||||
val Colors.scrollbarUnhover: Color
|
val Colors.scrollbarUnhover: Color
|
||||||
get() = if (isLight) unhoverScrollbarColorLight else unhoverScrollbarColorDark
|
get() = if (isLight) unhoverScrollbarColorLight else unhoverScrollbarColorDark
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import androidx.compose.runtime.*
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import app.git.DiffEntryType
|
import app.git.DiffEntryType
|
||||||
|
import app.theme.borderColor
|
||||||
import app.ui.dialogs.NewBranchDialog
|
import app.ui.dialogs.NewBranchDialog
|
||||||
import app.ui.log.Log
|
import app.ui.log.Log
|
||||||
import app.viewmodels.TabViewModel
|
import app.viewmodels.TabViewModel
|
||||||
@ -83,8 +84,8 @@ fun RepositoryOpenPage(tabViewModel: TabViewModel) {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.border(
|
.border(
|
||||||
width = 2.dp,
|
width = 1.dp,
|
||||||
color = MaterialTheme.colors.primary,
|
color = MaterialTheme.colors.borderColor,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
when (diffSelected) {
|
when (diffSelected) {
|
||||||
|
@ -9,6 +9,7 @@ import androidx.compose.animation.fadeOut
|
|||||||
import androidx.compose.foundation.*
|
import androidx.compose.foundation.*
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.lazy.itemsIndexed
|
import androidx.compose.foundation.lazy.itemsIndexed
|
||||||
|
import androidx.compose.foundation.shape.CornerSize
|
||||||
import androidx.compose.material.*
|
import androidx.compose.material.*
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowDropDown
|
import androidx.compose.material.icons.filled.ArrowDropDown
|
||||||
@ -16,8 +17,10 @@ import androidx.compose.runtime.*
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
import androidx.compose.ui.ExperimentalComposeUiApi
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.RectangleShape
|
import androidx.compose.ui.graphics.RectangleShape
|
||||||
|
import androidx.compose.ui.graphics.Shape
|
||||||
import androidx.compose.ui.input.key.Key
|
import androidx.compose.ui.input.key.Key
|
||||||
import androidx.compose.ui.input.key.isCtrlPressed
|
import androidx.compose.ui.input.key.isCtrlPressed
|
||||||
import androidx.compose.ui.input.key.key
|
import androidx.compose.ui.input.key.key
|
||||||
@ -223,19 +226,28 @@ fun UncommitedChangesButtons(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(top = 2.dp)
|
.padding(top = 2.dp)
|
||||||
) {
|
) {
|
||||||
Button(
|
ConfirmationButton(
|
||||||
|
text = "Commit",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.height(40.dp),
|
.height(40.dp),
|
||||||
onClick = { onCommit(false) },
|
onClick = { onCommit(false) },
|
||||||
enabled = canCommit,
|
enabled = canCommit,
|
||||||
shape = RectangleShape,
|
shape = MaterialTheme.shapes.small.copy(topEnd = CornerSize(0.dp), bottomEnd = CornerSize(0.dp))
|
||||||
) {
|
)
|
||||||
Text(
|
// Button(
|
||||||
text = "Commit",
|
// modifier = Modifier
|
||||||
fontSize = 14.sp,
|
// .weight(1f)
|
||||||
)
|
// .height(40.dp),
|
||||||
}
|
// onClick = { onCommit(false) },
|
||||||
|
// enabled = canCommit,
|
||||||
|
// shape = RectangleShape,
|
||||||
|
// ) {
|
||||||
|
// Text(
|
||||||
|
// text = "Commit",
|
||||||
|
// fontSize = 14.sp,
|
||||||
|
// )
|
||||||
|
// }
|
||||||
Spacer(
|
Spacer(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.width(1.dp)
|
.width(1.dp)
|
||||||
@ -245,13 +257,14 @@ fun UncommitedChangesButtons(
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(40.dp)
|
.height(40.dp)
|
||||||
.background(MaterialTheme.colors.primary)
|
.clip(MaterialTheme.shapes.small.copy(topStart = CornerSize(0.dp), bottomStart = CornerSize(0.dp)))
|
||||||
.clickable { showDropDownMenu = true },
|
.background(MaterialTheme.colors.confirmationButton)
|
||||||
|
.clickable { showDropDownMenu = true }
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Default.ArrowDropDown,
|
Icons.Default.ArrowDropDown,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
tint = MaterialTheme.colors.inversePrimaryTextColor,
|
tint = Color.White,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 8.dp)
|
.padding(horizontal = 8.dp)
|
||||||
.align(Alignment.Center),
|
.align(Alignment.Center),
|
||||||
@ -273,9 +286,7 @@ fun UncommitedChangesButtons(
|
|||||||
},
|
},
|
||||||
expanded = showDropDownMenu,
|
expanded = showDropDownMenu,
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,19 +306,14 @@ fun MergeButtons(
|
|||||||
onClick = onAbort
|
onClick = onAbort
|
||||||
)
|
)
|
||||||
|
|
||||||
Button(
|
ConfirmationButton(
|
||||||
onClick = onMerge,
|
text = "Merge",
|
||||||
enabled = haveConflictsBeenSolved,
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(start = 8.dp, end = 4.dp),
|
.padding(start = 8.dp, end = 4.dp),
|
||||||
) {
|
enabled = haveConflictsBeenSolved,
|
||||||
Text(
|
onClick = onMerge,
|
||||||
text = "Merge",
|
)
|
||||||
fontSize = 14.sp,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,30 +336,22 @@ fun RebasingButtons(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (canContinue) {
|
if (canContinue) {
|
||||||
Button(
|
ConfirmationButton(
|
||||||
onClick = onContinue,
|
text = "Continue",
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.padding(start = 8.dp, end = 4.dp),
|
||||||
enabled = haveConflictsBeenSolved,
|
enabled = haveConflictsBeenSolved,
|
||||||
modifier = Modifier
|
onClick = onContinue,
|
||||||
.weight(1f)
|
)
|
||||||
.padding(start = 8.dp, end = 4.dp),
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = "Continue",
|
|
||||||
fontSize = 14.sp,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Button(
|
ConfirmationButton(
|
||||||
onClick = onSkip,
|
text = "Skip",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(start = 8.dp, end = 4.dp),
|
.padding(start = 8.dp, end = 4.dp),
|
||||||
) {
|
onClick = onSkip,
|
||||||
Text(
|
)
|
||||||
text = "Skip",
|
|
||||||
fontSize = 14.sp,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -365,7 +363,7 @@ fun AbortButton(modifier: Modifier, onClick: () -> Unit) {
|
|||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
colors = ButtonDefaults.buttonColors(
|
colors = ButtonDefaults.buttonColors(
|
||||||
backgroundColor = MaterialTheme.colors.unstageButton,
|
backgroundColor = MaterialTheme.colors.abortButton,
|
||||||
contentColor = Color.White
|
contentColor = Color.White
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@ -376,6 +374,32 @@ fun AbortButton(modifier: Modifier, onClick: () -> Unit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun ConfirmationButton(
|
||||||
|
text: String,
|
||||||
|
modifier: Modifier,
|
||||||
|
enabled: Boolean = true,
|
||||||
|
shape: Shape = MaterialTheme.shapes.small,
|
||||||
|
onClick: () -> Unit,
|
||||||
|
) {
|
||||||
|
Button(
|
||||||
|
onClick = onClick,
|
||||||
|
modifier = modifier,
|
||||||
|
enabled = enabled,
|
||||||
|
shape = shape,
|
||||||
|
colors = ButtonDefaults.buttonColors(
|
||||||
|
backgroundColor = MaterialTheme.colors.confirmationButton,
|
||||||
|
contentColor = Color.White
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = text,
|
||||||
|
fontSize = 14.sp,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: This logic should be part of the diffViewModel where it gets the latest version of the diffEntry
|
// TODO: This logic should be part of the diffViewModel where it gets the latest version of the diffEntry
|
||||||
fun checkIfSelectedEntryShouldBeUpdated(
|
fun checkIfSelectedEntryShouldBeUpdated(
|
||||||
selectedEntryType: DiffEntryType,
|
selectedEntryType: DiffEntryType,
|
||||||
|
@ -19,7 +19,7 @@ import androidx.compose.ui.text.TextStyle
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import app.theme.primaryTextColor
|
import app.theme.primaryTextColor
|
||||||
import app.theme.secondaryTextColor
|
import app.theme.secondaryTextColor
|
||||||
import app.theme.semiSecondaryTextColor
|
import app.theme.borderColor
|
||||||
import app.viewmodels.RemotesViewModel
|
import app.viewmodels.RemotesViewModel
|
||||||
import org.eclipse.jgit.transport.RemoteConfig
|
import org.eclipse.jgit.transport.RemoteConfig
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ fun EditRemotesDialog(
|
|||||||
.border(
|
.border(
|
||||||
width = 1.dp,
|
width = 1.dp,
|
||||||
shape = RoundedCornerShape(5.dp),
|
shape = RoundedCornerShape(5.dp),
|
||||||
color = MaterialTheme.colors.semiSecondaryTextColor,
|
color = MaterialTheme.colors.borderColor,
|
||||||
)
|
)
|
||||||
.background(MaterialTheme.colors.surface)
|
.background(MaterialTheme.colors.surface)
|
||||||
) {
|
) {
|
||||||
@ -190,7 +190,7 @@ fun EditRemotesDialog(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxHeight()
|
.fillMaxHeight()
|
||||||
.width(1.dp)
|
.width(1.dp)
|
||||||
.background(MaterialTheme.colors.semiSecondaryTextColor)
|
.background(MaterialTheme.colors.borderColor)
|
||||||
)
|
)
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
|
Loading…
Reference in New Issue
Block a user