Reformated project's code

This commit is contained in:
Abdelilah El Aissaoui 2021-12-12 19:49:46 +01:00
parent 912397b257
commit 31b692e581
56 changed files with 214 additions and 186 deletions

View File

@ -68,7 +68,7 @@ class Main {
var showSettingsDialog by remember { mutableStateOf(false) } var showSettingsDialog by remember { mutableStateOf(false) }
AppTheme(theme = theme) { AppTheme(theme = theme) {
Box (modifier = Modifier.background(MaterialTheme.colors.background)) { Box(modifier = Modifier.background(MaterialTheme.colors.background)) {
AppTabs( AppTabs(
onOpenSettings = { onOpenSettings = {
showSettingsDialog = true showSettingsDialog = true
@ -76,7 +76,7 @@ class Main {
) )
} }
if(showSettingsDialog) { if (showSettingsDialog) {
SettingsDialog( SettingsDialog(
appPreferences = appPreferences, appPreferences = appPreferences,
onDismiss = { showSettingsDialog = false } onDismiss = { showSettingsDialog = false }
@ -88,8 +88,6 @@ class Main {
} }
@Composable @Composable
fun AppTabs( fun AppTabs(
onOpenSettings: () -> Unit, onOpenSettings: () -> Unit,

View File

@ -69,7 +69,7 @@ class AppStateManager @Inject constructor(
} }
val repositoriesPathsSaved = appPreferences.latestOpenedRepositoriesPath val repositoriesPathsSaved = appPreferences.latestOpenedRepositoriesPath
if(repositoriesPathsSaved.isNotEmpty()) { if (repositoriesPathsSaved.isNotEmpty()) {
val repositories = Json.decodeFromString<List<String>>(repositoriesPathsSaved) val repositories = Json.decodeFromString<List<String>>(repositoriesPathsSaved)
_latestOpenedRepositoriesPaths.addAll(repositories) _latestOpenedRepositoriesPaths.addAll(repositories)
} }

View File

@ -6,7 +6,7 @@ class CommitNode(val revCommit: RevCommit) {
private val children = mutableListOf<CommitNode>() private val children = mutableListOf<CommitNode>()
fun addChild(node: CommitNode) { fun addChild(node: CommitNode) {
if(children.find { it.revCommit.id == node.revCommit.id } == null) { if (children.find { it.revCommit.id == node.revCommit.id } == null) {
children.add(node) children.add(node)
} }
} }

View File

@ -31,4 +31,4 @@ class ErrorsManager @Inject constructor() {
data class Error(val date: Long, val exception: Exception, val message: String) data class Error(val date: Long, val exception: Exception, val message: String)
fun newErrorNow(exception: Exception,message: String) = Error(System.currentTimeMillis(), exception, message) fun newErrorNow(exception: Exception, message: String) = Error(System.currentTimeMillis(), exception, message)

View File

@ -71,7 +71,7 @@ class GRemoteSession @Inject constructor(
credentials = credentialsStateManager.currentCredentialsState credentials = credentialsStateManager.currentCredentialsState
} }
if(credentials !is CredentialsState.SshCredentialsAccepted) if (credentials !is CredentialsState.SshCredentialsAccepted)
null null
else else
credentials.password credentials.password

View File

@ -30,12 +30,13 @@ class HttpCredentialsProvider : CredentialsProvider() {
credentials = credentialsStateManager.currentCredentialsState credentials = credentialsStateManager.currentCredentialsState
} }
if(credentials is CredentialsState.HttpCredentialsAccepted) { if (credentials is CredentialsState.HttpCredentialsAccepted) {
val userItem = items.firstOrNull { it?.promptText == "Username" } val userItem = items.firstOrNull { it?.promptText == "Username" }
val passwordItem = items.firstOrNull { it?.promptText == "Password" } val passwordItem = items.firstOrNull { it?.promptText == "Password" }
if(userItem is CredentialItem.Username && if (userItem is CredentialItem.Username &&
passwordItem is CredentialItem.Password) { passwordItem is CredentialItem.Password
) {
userItem.value = credentials.user userItem.value = credentials.user
passwordItem.value = credentials.password.toCharArray() passwordItem.value = credentials.password.toCharArray()

View File

@ -15,11 +15,12 @@ fun Date.toSmartSystemString(): String {
val currentTime = LocalDate.now(zoneId) val currentTime = LocalDate.now(zoneId)
var result = sdf.format(this) var result = sdf.format(this)
if(localDate.year == currentTime.year && if (localDate.year == currentTime.year &&
localDate.month == currentTime.month) { localDate.month == currentTime.month
if(localDate.dayOfMonth == currentTime.dayOfMonth) ) {
if (localDate.dayOfMonth == currentTime.dayOfMonth)
result = "Today" result = "Today"
else if(localDate.dayOfMonth == currentTime.dayOfMonth - 1) else if (localDate.dayOfMonth == currentTime.dayOfMonth - 1)
result = "Yesterday" result = "Yesterday"
} }

View File

@ -9,9 +9,9 @@ import androidx.compose.material.icons.filled.Refresh
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import org.eclipse.jgit.diff.DiffEntry
import app.theme.addFile import app.theme.addFile
import app.theme.modifyFile import app.theme.modifyFile
import org.eclipse.jgit.diff.DiffEntry
val DiffEntry.filePath: String val DiffEntry.filePath: String
get() { get() {

View File

@ -56,10 +56,10 @@ val Ref.isRemote: Boolean
fun Ref.isSameBranch(otherRef: Ref?): Boolean { fun Ref.isSameBranch(otherRef: Ref?): Boolean {
if(this.name == "HEAD" && otherRef == null) if (this.name == "HEAD" && otherRef == null)
return true return true
if(otherRef == null) if (otherRef == null)
return false return false
return this.name == otherRef.name return this.name == otherRef.name

View File

@ -4,7 +4,7 @@ import org.eclipse.jgit.lib.Repository
import org.eclipse.jgit.revwalk.RevCommit import org.eclipse.jgit.revwalk.RevCommit
fun RevCommit.fullData(repository: Repository): RevCommit? { fun RevCommit.fullData(repository: Repository): RevCommit? {
return if(this.tree == null) return if (this.tree == null)
repository.parseCommit(this) repository.parseCommit(this)
else else
this this

View File

@ -4,28 +4,28 @@ import java.math.BigInteger
import java.security.MessageDigest import java.security.MessageDigest
val String.md5: String val String.md5: String
get() { get() {
val md = MessageDigest.getInstance("MD5") val md = MessageDigest.getInstance("MD5")
return BigInteger(1, md.digest(this.toByteArray())).toString(16).padStart(32, '0') return BigInteger(1, md.digest(this.toByteArray())).toString(16).padStart(32, '0')
} }
val String.dirName: String val String.dirName: String
get() { get() {
val parts = this.split("/") val parts = this.split("/")
return if(parts.isNotEmpty()) return if (parts.isNotEmpty())
parts.last() parts.last()
else else
this this
} }
val String.dirPath: String val String.dirPath: String
get() { get() {
val parts = this.split("/").toMutableList() val parts = this.split("/").toMutableList()
return if(parts.count() > 1) { return if (parts.count() > 1) {
parts.removeLast() parts.removeLast()
parts.joinToString("/") parts.joinToString("/")
} else } else
this this
} }

View File

@ -3,7 +3,7 @@ package app.git
import org.eclipse.jgit.diff.DiffEntry import org.eclipse.jgit.diff.DiffEntry
sealed class DiffEntryType(val diffEntry: DiffEntry) { sealed class DiffEntryType(val diffEntry: DiffEntry) {
class CommitDiff(diffEntry: DiffEntry): DiffEntryType(diffEntry) class CommitDiff(diffEntry: DiffEntry) : DiffEntryType(diffEntry)
class UnstagedDiff(diffEntry: DiffEntry): DiffEntryType(diffEntry) class UnstagedDiff(diffEntry: DiffEntry) : DiffEntryType(diffEntry)
class StagedDiff(diffEntry: DiffEntry): DiffEntryType(diffEntry) class StagedDiff(diffEntry: DiffEntry) : DiffEntryType(diffEntry)
} }

View File

@ -55,7 +55,6 @@ class DiffManager @Inject constructor() {
} }
suspend fun commitDiffEntries(git: Git, commit: RevCommit): List<DiffEntry> = withContext(Dispatchers.IO) { suspend fun commitDiffEntries(git: Git, commit: RevCommit): List<DiffEntry> = withContext(Dispatchers.IO) {
val fullCommit = commit.fullData(git.repository) ?: return@withContext emptyList() val fullCommit = commit.fullData(git.repository) ?: return@withContext emptyList()

View File

@ -27,7 +27,7 @@ class FileChangesWatcher @Inject constructor() {
override fun preVisitDirectory(dir: Path, attrs: BasicFileAttributes): FileVisitResult { override fun preVisitDirectory(dir: Path, attrs: BasicFileAttributes): FileVisitResult {
val isIgnoredDirectory = ignoredDirsPath.any { "$pathStr/$it" == dir.toString() } val isIgnoredDirectory = ignoredDirsPath.any { "$pathStr/$it" == dir.toString() }
return if(!isIgnoredDirectory) { return if (!isIgnoredDirectory) {
dir.register(watchService, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY) dir.register(watchService, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY)
FileVisitResult.CONTINUE FileVisitResult.CONTINUE
} else { } else {

View File

@ -1,22 +1,21 @@
package app.git package app.git
import app.AppStateManager
import app.app.ErrorsManager
import app.app.newErrorNow
import app.credentials.CredentialsState import app.credentials.CredentialsState
import app.credentials.CredentialsStateManager import app.credentials.CredentialsStateManager
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.collect
import org.eclipse.jgit.api.Git import org.eclipse.jgit.api.Git
import org.eclipse.jgit.diff.DiffEntry import org.eclipse.jgit.diff.DiffEntry
import org.eclipse.jgit.lib.ObjectId
import org.eclipse.jgit.lib.Ref import org.eclipse.jgit.lib.Ref
import org.eclipse.jgit.lib.Repository import org.eclipse.jgit.lib.Repository
import org.eclipse.jgit.revwalk.RevCommit import org.eclipse.jgit.revwalk.RevCommit
import org.eclipse.jgit.storage.file.FileRepositoryBuilder import org.eclipse.jgit.storage.file.FileRepositoryBuilder
import app.AppStateManager
import app.app.ErrorsManager
import app.app.newErrorNow
import kotlinx.coroutines.flow.collect
import org.eclipse.jgit.lib.ObjectId
import org.eclipse.jgit.transport.RemoteConfig
import java.io.File import java.io.File
import javax.inject.Inject import javax.inject.Inject
@ -323,7 +322,7 @@ class GitManager @Inject constructor(
} catch (ex: Exception) { } catch (ex: Exception) {
ex.printStackTrace() ex.printStackTrace()
if(showError) if (showError)
errorsManager.addError(newErrorNow(ex, ex.localizedMessage)) errorsManager.addError(newErrorNow(ex, ex.localizedMessage))
} finally { } finally {
_processing.value = false _processing.value = false

View File

@ -13,7 +13,6 @@ import org.eclipse.jgit.api.CreateBranchCommand
import org.eclipse.jgit.api.Git import org.eclipse.jgit.api.Git
import org.eclipse.jgit.api.ResetCommand import org.eclipse.jgit.api.ResetCommand
import org.eclipse.jgit.lib.Constants import org.eclipse.jgit.lib.Constants
import org.eclipse.jgit.lib.ObjectId
import org.eclipse.jgit.lib.Ref import org.eclipse.jgit.lib.Ref
import org.eclipse.jgit.revwalk.RevCommit import org.eclipse.jgit.revwalk.RevCommit
import javax.inject.Inject import javax.inject.Inject
@ -64,14 +63,14 @@ class LogManager @Inject constructor(
suspend fun checkoutRef(git: Git, ref: Ref) = withContext(Dispatchers.IO) { suspend fun checkoutRef(git: Git, ref: Ref) = withContext(Dispatchers.IO) {
git.checkout().apply { git.checkout().apply {
setName(ref.name) setName(ref.name)
if(ref.isBranch && ref.name.startsWith("refs/remotes/")) { if (ref.isBranch && ref.name.startsWith("refs/remotes/")) {
setCreateBranch(true) setCreateBranch(true)
setName(ref.simpleName) setName(ref.simpleName)
setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK) setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK)
}
call()
} }
call()
}
} }
suspend fun revertCommit(git: Git, revCommit: RevCommit) = withContext(Dispatchers.IO) { suspend fun revertCommit(git: Git, revCommit: RevCommit) = withContext(Dispatchers.IO) {
@ -82,7 +81,7 @@ class LogManager @Inject constructor(
} }
suspend fun resetToCommit(git: Git, revCommit: RevCommit, resetType: ResetType) = withContext(Dispatchers.IO) { suspend fun resetToCommit(git: Git, revCommit: RevCommit, resetType: ResetType) = withContext(Dispatchers.IO) {
val reset = when(resetType) { val reset = when (resetType) {
ResetType.SOFT -> ResetCommand.ResetType.SOFT ResetType.SOFT -> ResetCommand.ResetType.SOFT
ResetType.MIXED -> ResetCommand.ResetType.MIXED ResetType.MIXED -> ResetCommand.ResetType.MIXED
ResetType.HARD -> ResetCommand.ResetType.HARD ResetType.HARD -> ResetCommand.ResetType.HARD
@ -94,6 +93,7 @@ class LogManager @Inject constructor(
.call() .call()
} }
} }
// TODO Move this to // TODO Move this to
enum class ResetType { enum class ResetType {
SOFT, SOFT,

View File

@ -1,6 +1,7 @@
package app.git package app.git
import app.credentials.* import app.credentials.GSessionManager
import app.credentials.HttpCredentialsProvider
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow
@ -8,7 +9,10 @@ import kotlinx.coroutines.isActive
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import org.eclipse.jgit.api.Git import org.eclipse.jgit.api.Git
import org.eclipse.jgit.lib.ProgressMonitor import org.eclipse.jgit.lib.ProgressMonitor
import org.eclipse.jgit.transport.* import org.eclipse.jgit.transport.CredentialsProvider
import org.eclipse.jgit.transport.HttpTransport
import org.eclipse.jgit.transport.RefSpec
import org.eclipse.jgit.transport.SshTransport
import java.io.File import java.io.File
import javax.inject.Inject import javax.inject.Inject

View File

@ -9,7 +9,6 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import org.eclipse.jgit.api.Git import org.eclipse.jgit.api.Git
import org.eclipse.jgit.diff.DiffEntry import org.eclipse.jgit.diff.DiffEntry
import org.eclipse.jgit.lib.Constants
import javax.inject.Inject import javax.inject.Inject
class StatusManager @Inject constructor() { class StatusManager @Inject constructor() {
@ -54,7 +53,7 @@ class StatusManager @Inject constructor() {
ensureActive() ensureActive()
_stageStatus.value = StageStatus.Loaded(staged, unstaged) _stageStatus.value = StageStatus.Loaded(staged, unstaged)
} catch(ex: Exception) { } catch (ex: Exception) {
_stageStatus.value = previousStatus _stageStatus.value = previousStatus
throw ex throw ex
} }

View File

@ -1,12 +1,11 @@
package app.git.graph package app.git.graph
import org.eclipse.jgit.revwalk.RevCommitList
import java.lang.ClassCastException
import java.text.MessageFormat
import org.eclipse.jgit.internal.JGitText import org.eclipse.jgit.internal.JGitText
import org.eclipse.jgit.lib.AnyObjectId import org.eclipse.jgit.lib.AnyObjectId
import org.eclipse.jgit.revwalk.RevCommit import org.eclipse.jgit.revwalk.RevCommit
import org.eclipse.jgit.revwalk.RevCommitList
import org.eclipse.jgit.revwalk.RevWalk import org.eclipse.jgit.revwalk.RevWalk
import java.text.MessageFormat
import java.util.* import java.util.*
/** /**

View File

@ -8,7 +8,6 @@ import org.eclipse.jgit.lib.Ref
import org.eclipse.jgit.lib.Repository import org.eclipse.jgit.lib.Repository
import org.eclipse.jgit.revwalk.* import org.eclipse.jgit.revwalk.*
import java.io.IOException import java.io.IOException
import java.util.*
/** /**
* Specialized RevWalk for visualization of a commit graph. * Specialized RevWalk for visualization of a commit graph.

View File

@ -23,8 +23,8 @@ object NetworkImageLoader {
try { try {
val cachedImage = cache.getCachedImage(url) val cachedImage = cache.getCachedImage(url)
if(cachedImage != null) if (cachedImage != null)
return@withContext cachedImage.toComposeImage() return@withContext cachedImage.toComposeImage()
loadingImagesSemaphore.acquireAndUse { loadingImagesSemaphore.acquireAndUse {
val imageByteArray = loadImage(url) val imageByteArray = loadImage(url)
@ -50,7 +50,6 @@ object NetworkImageLoader {
} }
@Composable @Composable
fun rememberNetworkImage(url: String): ImageBitmap { fun rememberNetworkImage(url: String): ImageBitmap {
val networkImageLoader = NetworkImageLoader val networkImageLoader = NetworkImageLoader
@ -64,7 +63,7 @@ fun rememberNetworkImage(url: String): ImageBitmap {
LaunchedEffect(url) { LaunchedEffect(url) {
val networkImage = networkImageLoader.loadImageNetwork(url) val networkImage = networkImageLoader.loadImageNetwork(url)
if(networkImage != null) if (networkImage != null)
image = networkImage image = networkImage
} }

View File

@ -1,6 +1,9 @@
package app.theme package app.theme
import androidx.compose.material.* import androidx.compose.material.Colors
import androidx.compose.material.MaterialTheme
import androidx.compose.material.darkColors
import androidx.compose.material.lightColors
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
@ -26,7 +29,7 @@ private val LightColorPalette = lightColors(
@Composable @Composable
fun AppTheme(theme: Themes = Themes.LIGHT, content: @Composable() () -> Unit) { fun AppTheme(theme: Themes = Themes.LIGHT, content: @Composable() () -> Unit) {
val colors = when(theme) { val colors = when (theme) {
Themes.LIGHT -> LightColorPalette Themes.LIGHT -> LightColorPalette
Themes.DARK -> DarkColorPalette Themes.DARK -> DarkColorPalette
} }

View File

@ -134,7 +134,7 @@ fun AppTab(
) { ) {
Column( Column(
modifier = Modifier modifier = Modifier
.padding(horizontal = 32.dp) .padding(horizontal = 32.dp)
) { ) {
Text( Text(
text = "Error", text = "Error",

View File

@ -2,42 +2,32 @@ package app.ui
import androidx.compose.foundation.ContextMenuArea import androidx.compose.foundation.ContextMenuArea
import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
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.material.* import androidx.compose.material.Icon
import androidx.compose.material.icons.Icons import androidx.compose.material.MaterialTheme
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import app.MAX_SIDE_PANEL_ITEMS_HEIGHT import app.MAX_SIDE_PANEL_ITEMS_HEIGHT
import app.extensions.isLocal import app.extensions.isLocal
import app.ui.components.ScrollableLazyColumn
import app.extensions.simpleName import app.extensions.simpleName
import app.git.GitManager import app.git.GitManager
import org.eclipse.jgit.lib.Ref import app.ui.components.ScrollableLazyColumn
import app.theme.headerBackground
import app.theme.headerText
import app.ui.components.SideMenuEntry import app.ui.components.SideMenuEntry
import app.ui.components.SideMenuSubentry import app.ui.components.SideMenuSubentry
import app.ui.components.entryHeight import app.ui.components.entryHeight
import app.ui.context_menu.branchContextMenuItems import app.ui.context_menu.branchContextMenuItems
import app.ui.dialogs.MergeDialog import app.ui.dialogs.MergeDialog
import org.eclipse.jgit.lib.Ref
@Composable @Composable
fun Branches( fun Branches(
gitManager: GitManager, gitManager: GitManager,
onBranchClicked: (Ref) -> Unit, onBranchClicked: (Ref) -> Unit,
) { ) {
val branches by gitManager.branches.collectAsState() val branches by gitManager.branches.collectAsState()
val currentBranch by gitManager.currentBranch.collectAsState() val currentBranch by gitManager.currentBranch.collectAsState()
val (mergeBranch, setMergeBranch) = remember { mutableStateOf<Ref?>(null) } val (mergeBranch, setMergeBranch) = remember { mutableStateOf<Ref?>(null) }
@ -67,7 +57,7 @@ fun Branches(
} }
} }
if(mergeBranch != null) { if (mergeBranch != null) {
MergeDialog( MergeDialog(
currentBranch, currentBranch,
mergeBranchName = mergeBranch.name, mergeBranchName = mergeBranch.name,

View File

@ -1,26 +1,27 @@
package app.ui package app.ui
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.* 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.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material.* import androidx.compose.material.ButtonDefaults
import androidx.compose.runtime.Composable import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.LaunchedEffect import androidx.compose.material.OutlinedButton
import androidx.compose.runtime.mutableStateOf import androidx.compose.material.Text
import androidx.compose.runtime.remember import androidx.compose.runtime.*
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import app.ui.components.ScrollableLazyColumn
import app.git.DiffEntryType import app.git.DiffEntryType
import app.git.GitManager import app.git.GitManager
import app.theme.primaryTextColor import app.theme.primaryTextColor
import app.ui.components.ScrollableLazyColumn
@Composable @Composable
fun Diff(gitManager: GitManager, diffEntryType: DiffEntryType, onCloseDiffView: () -> Unit) { fun Diff(gitManager: GitManager, diffEntryType: DiffEntryType, onCloseDiffView: () -> Unit) {
@ -30,7 +31,7 @@ fun Diff(gitManager: GitManager, diffEntryType: DiffEntryType, onCloseDiffView:
text = gitManager.diffFormat(diffEntryType) text = gitManager.diffFormat(diffEntryType)
if(text.isEmpty()) onCloseDiffView() if (text.isEmpty()) onCloseDiffView()
} }
Column( Column(

View File

@ -4,17 +4,15 @@ package app.ui
import androidx.compose.foundation.Image import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CornerSize import androidx.compose.material.MaterialTheme
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.OutlinedButton
import androidx.compose.material.* import androidx.compose.material.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
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.graphics.ColorFilter import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.layout.HorizontalAlignmentLine
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp

View File

@ -1,6 +1,9 @@
package app.ui package app.ui
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
@ -8,10 +11,10 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import app.MAX_SIDE_PANEL_ITEMS_HEIGHT import app.MAX_SIDE_PANEL_ITEMS_HEIGHT
import app.ui.components.ScrollableLazyColumn
import app.extensions.simpleVisibleName import app.extensions.simpleVisibleName
import app.git.GitManager import app.git.GitManager
import app.git.RemoteInfo import app.git.RemoteInfo
import app.ui.components.ScrollableLazyColumn
import app.ui.components.SideMenuEntry import app.ui.components.SideMenuEntry
import app.ui.components.SideMenuSubentry import app.ui.components.SideMenuSubentry
import app.ui.components.entryHeight import app.ui.components.entryHeight
@ -25,7 +28,7 @@ fun Remotes(gitManager: GitManager) {
val allBranches = remotes.map { it.branchesList }.flatten() val allBranches = remotes.map { it.branchesList }.flatten()
val remotesHeight = (allBranches.count() + remotes.count()) * entryHeight val remotesHeight = (allBranches.count() + remotes.count()) * entryHeight
val maxHeight = if(remotesHeight < MAX_SIDE_PANEL_ITEMS_HEIGHT) val maxHeight = if (remotesHeight < MAX_SIDE_PANEL_ITEMS_HEIGHT)
remotesHeight remotesHeight
else else
MAX_SIDE_PANEL_ITEMS_HEIGHT MAX_SIDE_PANEL_ITEMS_HEIGHT

View File

@ -1,15 +1,9 @@
package app.ui package app.ui
import androidx.compose.animation.Crossfade import androidx.compose.animation.Crossfade
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.input.pointer.PointerIcon
import androidx.compose.ui.input.pointer.pointerHoverIcon
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import app.git.DiffEntryType import app.git.DiffEntryType
import app.git.GitManager import app.git.GitManager
@ -20,7 +14,6 @@ import org.eclipse.jgit.revwalk.RevCommit
import org.jetbrains.compose.splitpane.ExperimentalSplitPaneApi import org.jetbrains.compose.splitpane.ExperimentalSplitPaneApi
import org.jetbrains.compose.splitpane.HorizontalSplitPane import org.jetbrains.compose.splitpane.HorizontalSplitPane
import org.jetbrains.compose.splitpane.rememberSplitPaneState import org.jetbrains.compose.splitpane.rememberSplitPaneState
import java.awt.Cursor
@OptIn(ExperimentalSplitPaneApi::class, androidx.compose.ui.ExperimentalComposeUiApi::class) @OptIn(ExperimentalSplitPaneApi::class, androidx.compose.ui.ExperimentalComposeUiApi::class)
@ -38,7 +31,7 @@ fun RepositoryOpenPage(gitManager: GitManager) {
diffSelected = null diffSelected = null
} }
if(showNewBranchDialog) { if (showNewBranchDialog) {
NewBranchDialog( NewBranchDialog(
onReject = { onReject = {
showNewBranchDialog = false showNewBranchDialog = false
@ -144,7 +137,7 @@ fun RepositoryOpenPage(gitManager: GitManager) {
diffSelected = DiffEntryType.UnstagedDiff(diffEntry) diffSelected = DiffEntryType.UnstagedDiff(diffEntry)
} }
) )
} else if(selectedItem is SelectedItem.CommitBasedItem) { } else if (selectedItem is SelectedItem.CommitBasedItem) {
CommitChanges( CommitChanges(
gitManager = gitManager, gitManager = gitManager,
commit = selectedItem.revCommit, commit = selectedItem.revCommit,

View File

@ -1,8 +1,5 @@
import app.AppStateManager
import app.extensions.runCommand import app.extensions.runCommand
import app.git.GitManager import app.git.GitManager
import java.io.IOException
import java.util.*
import javax.swing.JFileChooser import javax.swing.JFileChooser
@ -12,16 +9,16 @@ fun openRepositoryDialog(gitManager: GitManager) {
val latestDirectoryOpened = appStateManager.latestOpenedRepositoryPath val latestDirectoryOpened = appStateManager.latestOpenedRepositoryPath
if(os.lowercase() == "linux") { if (os.lowercase() == "linux") {
val checkZenityInstalled = runCommand("which zenity 2>/dev/null") val checkZenityInstalled = runCommand("which zenity 2>/dev/null")
val isZenityInstalled = !checkZenityInstalled.isNullOrEmpty() val isZenityInstalled = !checkZenityInstalled.isNullOrEmpty()
if(isZenityInstalled) { if (isZenityInstalled) {
val openDirectory = runCommand( val openDirectory = runCommand(
"zenity --file-selection --title=Open --directory --filename=\"$latestDirectoryOpened\"" "zenity --file-selection --title=Open --directory --filename=\"$latestDirectoryOpened\""
)?.replace("\n", "") )?.replace("\n", "")
if(!openDirectory.isNullOrEmpty()) if (!openDirectory.isNullOrEmpty())
gitManager.openRepository(openDirectory) gitManager.openRepository(openDirectory)
} else } else
openRepositoryDialog(gitManager, latestDirectoryOpened) openRepositoryDialog(gitManager, latestDirectoryOpened)

View File

@ -2,7 +2,10 @@ package app.ui
import androidx.compose.foundation.ContextMenuArea import androidx.compose.foundation.ContextMenuArea
import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
@ -10,8 +13,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import app.MAX_SIDE_PANEL_ITEMS_HEIGHT import app.MAX_SIDE_PANEL_ITEMS_HEIGHT
import app.extensions.simpleName import app.extensions.simpleName
import app.ui.components.ScrollableLazyColumn
import app.git.GitManager import app.git.GitManager
import app.ui.components.ScrollableLazyColumn
import app.ui.components.SideMenuEntry import app.ui.components.SideMenuEntry
import app.ui.components.SideMenuSubentry import app.ui.components.SideMenuSubentry
import app.ui.components.entryHeight import app.ui.components.entryHeight

View File

@ -29,16 +29,16 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import app.ui.components.ScrollableLazyColumn
import app.extensions.filePath import app.extensions.filePath
import app.extensions.icon import app.extensions.icon
import app.extensions.iconColor import app.extensions.iconColor
import app.git.GitManager import app.git.GitManager
import app.git.StageStatus import app.git.StageStatus
import org.eclipse.jgit.diff.DiffEntry
import app.theme.headerBackground import app.theme.headerBackground
import app.theme.headerText import app.theme.headerText
import app.theme.primaryTextColor import app.theme.primaryTextColor
import app.ui.components.ScrollableLazyColumn
import org.eclipse.jgit.diff.DiffEntry
@OptIn(ExperimentalAnimationApi::class, androidx.compose.ui.ExperimentalComposeUiApi::class) @OptIn(ExperimentalAnimationApi::class, androidx.compose.ui.ExperimentalComposeUiApi::class)
@Composable @Composable
@ -141,9 +141,8 @@ fun UncommitedChanges(
if (it.isCtrlPressed && it.key == Key.Enter && canCommit) { if (it.isCtrlPressed && it.key == Key.Enter && canCommit) {
doCommit() doCommit()
true true
} } else
else false
false
}, },
value = commitMessage, value = commitMessage,
onValueChange = { commitMessage = it }, onValueChange = { commitMessage = it },

View File

@ -50,7 +50,7 @@ fun WelcomePage(
horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center,
verticalAlignment = BiasAlignment.Vertical(-0.5f), verticalAlignment = BiasAlignment.Vertical(-0.5f),
) { ) {
Column( Column(
modifier = Modifier modifier = Modifier
.padding(end = 32.dp), .padding(end = 32.dp),
@ -159,7 +159,7 @@ fun WelcomePage(
} }
if(showCloneView) if (showCloneView)
MaterialDialog { MaterialDialog {
CloneDialog(gitManager, onClose = { showCloneView = false }) CloneDialog(gitManager, onClose = { showCloneView = false })
} }

View File

@ -1,14 +1,14 @@
package app.ui.components package app.ui.components
import androidx.compose.foundation.HorizontalScrollbar
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.LazyRow import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollbarAdapter
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.* import androidx.compose.material.*
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons

View File

@ -52,7 +52,7 @@ fun SideMenuSubentry(
modifier = Modifier.weight(1f, fill = true), modifier = Modifier.weight(1f, fill = true),
maxLines = 1, maxLines = 1,
fontSize = 14.sp, fontSize = 14.sp,
fontWeight = if(bold) FontWeight.SemiBold else FontWeight.Normal, fontWeight = if (bold) FontWeight.SemiBold else FontWeight.Normal,
color = MaterialTheme.colors.primaryTextColor, color = MaterialTheme.colors.primaryTextColor,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
) )

View File

@ -44,7 +44,7 @@ fun TooltipText(
) { ) {
TooltipArea( TooltipArea(
tooltip = { tooltip = {
Card ( Card(
backgroundColor = MaterialTheme.colors.background, backgroundColor = MaterialTheme.colors.background,
elevation = 10.dp, elevation = 10.dp,
) { ) {
@ -53,7 +53,7 @@ fun TooltipText(
modifier = Modifier.padding(10.dp) modifier = Modifier.padding(10.dp)
) )
} }
}, },
) { ) {
Text( Text(
text = text, text = text,

View File

@ -2,7 +2,6 @@ package app.ui.context_menu
import androidx.compose.foundation.ContextMenuItem import androidx.compose.foundation.ContextMenuItem
import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.ExperimentalFoundationApi
import app.extensions.isLocal
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)
fun tagContextMenuItems( fun tagContextMenuItems(

View File

@ -26,9 +26,9 @@ fun CloneDialog(
var directory by remember { mutableStateOf("") } var directory by remember { mutableStateOf("") }
var url by remember { mutableStateOf("") } var url by remember { mutableStateOf("") }
Column { Column {
if(cloneStatusValue is CloneStatus.Cloning || cloneStatusValue == CloneStatus.CheckingOut) if (cloneStatusValue is CloneStatus.Cloning || cloneStatusValue == CloneStatus.CheckingOut)
LinearProgressIndicator(modifier = Modifier.width(500.dp)) LinearProgressIndicator(modifier = Modifier.width(500.dp))
else if(cloneStatusValue == CloneStatus.Completed) { else if (cloneStatusValue == CloneStatus.Completed) {
gitManager.openRepository(directory) gitManager.openRepository(directory)
onClose() onClose()
} }

View File

@ -5,15 +5,11 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Card
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.* import androidx.compose.ui.unit.*
import androidx.compose.ui.window.Popup import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.PopupPositionProvider import androidx.compose.ui.window.PopupPositionProvider
@ -26,7 +22,7 @@ fun MaterialDialog(
) { ) {
Popup( Popup(
focusable = true, focusable = true,
popupPositionProvider = object: PopupPositionProvider { popupPositionProvider = object : PopupPositionProvider {
override fun calculatePosition( override fun calculatePosition(
anchorBounds: IntRect, anchorBounds: IntRect,
windowSize: IntSize, windowSize: IntSize,

View File

@ -2,19 +2,18 @@ package app.ui.dialogs
import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.mouseClickable import androidx.compose.foundation.mouseClickable
import androidx.compose.material.* import androidx.compose.material.*
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusOrder
import androidx.compose.ui.input.pointer.isPrimaryPressed import androidx.compose.ui.input.pointer.isPrimaryPressed
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import app.theme.primaryTextColor import app.theme.primaryTextColor
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)

View File

@ -3,18 +3,17 @@ package app.ui.dialogs
import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.mouseClickable import androidx.compose.foundation.mouseClickable
import androidx.compose.material.* import androidx.compose.material.*
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusOrder
import androidx.compose.ui.input.pointer.isPrimaryPressed import androidx.compose.ui.input.pointer.isPrimaryPressed
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import app.git.ResetType import app.git.ResetType
import app.theme.primaryTextColor import app.theme.primaryTextColor
@ -92,7 +91,7 @@ fun RadioButtonText(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
modifier = Modifier modifier = Modifier
.mouseClickable { .mouseClickable {
if(this.buttons.isPrimaryPressed) { if (this.buttons.isPrimaryPressed) {
if (onClick != null) { if (onClick != null) {
onClick() onClick()
} }

View File

@ -5,11 +5,10 @@ package app.ui.dialogs
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.material.* import androidx.compose.material.*
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import app.AppPreferences import app.AppPreferences
import androidx.compose.ui.Alignment
import app.theme.Themes
import app.theme.primaryTextColor import app.theme.primaryTextColor
import app.theme.themesList import app.theme.themesList

View File

@ -78,19 +78,20 @@ fun Log(
val showLogDialog = remember { mutableStateOf<LogDialog>(LogDialog.None) } val showLogDialog = remember { mutableStateOf<LogDialog>(LogDialog.None) }
val selectedCommit = if (selectedItem is SelectedItem.CommitBasedItem) { val selectedCommit = if (selectedItem is SelectedItem.CommitBasedItem) {
selectedItem.revCommit selectedItem.revCommit
} else { } else {
null null
} }
if (logStatus is LogStatus.Loaded) { if (logStatus is LogStatus.Loaded) {
val commitList = logStatus.plotCommitList val commitList = logStatus.plotCommitList
val scrollState = rememberLazyListState() val scrollState = rememberLazyListState()
LaunchedEffect(selectedCommit) { LaunchedEffect(selectedCommit) {
if(selectedItem is SelectedItem.Ref) // Scroll to commit if a Ref is selected
if (selectedItem is SelectedItem.Ref)
scrollState.scrollToItem(commitList.indexOfFirst { it.name == selectedCommit?.name }) scrollState.scrollToItem(commitList.indexOfFirst { it.name == selectedCommit?.name })
} }
@ -722,7 +723,7 @@ fun RefChip(
modifier = modifier, modifier = modifier,
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Box (modifier = Modifier.background(color = color)) { Box(modifier = Modifier.background(color = color)) {
Icon( Icon(
modifier = Modifier modifier = Modifier
.padding(6.dp) .padding(6.dp)

View File

@ -4,9 +4,9 @@ import app.git.graph.GraphNode
import org.eclipse.jgit.lib.Ref import org.eclipse.jgit.lib.Ref
sealed class LogDialog { sealed class LogDialog {
object None: LogDialog() object None : LogDialog()
data class NewBranch(val graphNode: GraphNode): LogDialog() data class NewBranch(val graphNode: GraphNode) : LogDialog()
data class NewTag(val graphNode: GraphNode): LogDialog() data class NewTag(val graphNode: GraphNode) : LogDialog()
data class ResetBranch(val graphNode: GraphNode): LogDialog() data class ResetBranch(val graphNode: GraphNode) : LogDialog()
data class MergeBranch(val ref: Ref): LogDialog() data class MergeBranch(val ref: Ref) : LogDialog()
} }

View File

@ -1,4 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19 12V19H5V12H3V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V12H19ZM19 12V19H5V12H3V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V12" fill="black"/> <path d="M19 12V19H5V12H3V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V12H19ZM19 12V19H5V12H3V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V12"
<path d="M8.40975 9.41L10.9998 6.83L10.9998 16.5H12.9998L12.9998 6.83L15.5898 9.41L16.9998 8L11.9998 3L6.99975 8L8.40975 9.41Z" fill="black"/> fill="black"/>
<path d="M8.40975 9.41L10.9998 6.83L10.9998 16.5H12.9998L12.9998 6.83L15.5898 9.41L16.9998 8L11.9998 3L6.99975 8L8.40975 9.41Z"
fill="black"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 436 B

View File

@ -1 +1,4 @@
<?xml version="1.0" ?><svg height="1024" width="640" xmlns="http://www.w3.org/2000/svg"><path d="M512 192c-70.625 0-128 57.344-128 128 0 47.219 25.875 88.062 64 110.281V448c0 0 0 128-128 128-53.062 0-94.656 11.375-128 28.812V302.28099999999995c38.156-22.219 64-63.062 64-110.281 0-70.656-57.344-128-128-128S0 121.34400000000005 0 192c0 47.219 25.844 88.062 64 110.281V721.75C25.844 743.938 0 784.75 0 832c0 70.625 57.344 128 128 128s128-57.375 128-128c0-33.5-13.188-63.75-34.25-86.625C240.375 722.5 270.656 704 320 704c254 0 256-256 256-256v-17.719c38.125-22.219 64-63.062 64-110.281C640 249.34400000000005 582.625 192 512 192zM128 128c35.406 0 64 28.594 64 64s-28.594 64-64 64-64-28.594-64-64S92.594 128 128 128zM128 896c-35.406 0-64-28.625-64-64 0-35.312 28.594-64 64-64s64 28.688 64 64C192 867.375 163.406 896 128 896zM512 384c-35.375 0-64-28.594-64-64s28.625-64 64-64 64 28.594 64 64S547.375 384 512 384z"/></svg> <?xml version="1.0" ?>
<svg height="1024" width="640" xmlns="http://www.w3.org/2000/svg">
<path d="M512 192c-70.625 0-128 57.344-128 128 0 47.219 25.875 88.062 64 110.281V448c0 0 0 128-128 128-53.062 0-94.656 11.375-128 28.812V302.28099999999995c38.156-22.219 64-63.062 64-110.281 0-70.656-57.344-128-128-128S0 121.34400000000005 0 192c0 47.219 25.844 88.062 64 110.281V721.75C25.844 743.938 0 784.75 0 832c0 70.625 57.344 128 128 128s128-57.375 128-128c0-33.5-13.188-63.75-34.25-86.625C240.375 722.5 270.656 704 320 704c254 0 256-256 256-256v-17.719c38.125-22.219 64-63.062 64-110.281C640 249.34400000000005 582.625 192 512 192zM128 128c35.406 0 64 28.594 64 64s-28.594 64-64 64-64-28.594-64-64S92.594 128 128 128zM128 896c-35.406 0-64-28.625-64-64 0-35.312 28.594-64 64-64s64 28.688 64 64C192 867.375 163.406 896 128 896zM512 384c-35.375 0-64-28.594-64-64s28.625-64 64-64 64 28.594 64 64S547.375 384 512 384z"/>
</svg>

Before

Width:  |  Height:  |  Size: 917 B

After

Width:  |  Height:  |  Size: 924 B

View File

@ -1 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/>
</svg>

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 542 B

View File

@ -1 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"/>
</svg>

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 320 B

View File

@ -1 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
<path d="M0 0h24v24H0V0z" fill="none"/>
<path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/>
</svg>

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 260 B

View File

@ -1 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><path d="M5,20h14v-2H5V20z M19,9h-4V3H9v6H5l7,7L19,9z"/></g></svg> <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px"
fill="#000000">
<g>
<rect fill="none" height="24" width="24"/>
</g>
<g>
<path d="M5,20h14v-2H5V20z M19,9h-4V3H9v6H5l7,7L19,9z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 298 B

View File

@ -1 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="12px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="12px" fill="#000000">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2z"/>
</svg>

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 234 B

View File

@ -1,5 +1,7 @@
<svg width="480" height="480" viewBox="0 0 480 480" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="480" height="480" viewBox="0 0 480 480" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="480" height="480" rx="55" fill="white"/> <rect width="480" height="480" rx="55" fill="white"/>
<path d="M258.281 263.125C250.688 272.219 239.953 279.297 226.078 284.359C212.203 289.328 196.828 291.812 179.953 291.812C162.234 291.812 146.672 287.969 133.266 280.281C119.953 272.5 109.641 261.25 102.328 246.531C95.1094 231.812 91.4062 214.516 91.2188 194.641V180.719C91.2188 160.281 94.6406 142.609 101.484 127.703C108.422 112.703 118.359 101.266 131.297 93.3906C144.328 85.4219 159.562 81.4375 177 81.4375C201.281 81.4375 220.266 87.25 233.953 98.875C247.641 110.406 255.75 127.234 258.281 149.359H217.219C215.344 137.641 211.172 129.062 204.703 123.625C198.328 118.187 189.516 115.469 178.266 115.469C163.922 115.469 153 120.859 145.5 131.641C138 142.422 134.203 158.453 134.109 179.734V192.812C134.109 214.281 138.188 230.5 146.344 241.469C154.5 252.438 166.453 257.922 182.203 257.922C198.047 257.922 209.344 254.547 216.094 247.797V212.5H177.703V181.422H258.281V263.125Z" fill="#0194FF"/> <path d="M258.281 263.125C250.688 272.219 239.953 279.297 226.078 284.359C212.203 289.328 196.828 291.812 179.953 291.812C162.234 291.812 146.672 287.969 133.266 280.281C119.953 272.5 109.641 261.25 102.328 246.531C95.1094 231.812 91.4062 214.516 91.2188 194.641V180.719C91.2188 160.281 94.6406 142.609 101.484 127.703C108.422 112.703 118.359 101.266 131.297 93.3906C144.328 85.4219 159.562 81.4375 177 81.4375C201.281 81.4375 220.266 87.25 233.953 98.875C247.641 110.406 255.75 127.234 258.281 149.359H217.219C215.344 137.641 211.172 129.062 204.703 123.625C198.328 118.187 189.516 115.469 178.266 115.469C163.922 115.469 153 120.859 145.5 131.641C138 142.422 134.203 158.453 134.109 179.734V192.812C134.109 214.281 138.188 230.5 146.344 241.469C154.5 252.438 166.453 257.922 182.203 257.922C198.047 257.922 209.344 254.547 216.094 247.797V212.5H177.703V181.422H258.281V263.125Z"
<path d="M382.781 386.2H340.594L258.469 251.481V386.2H216.281V181.45H258.469L340.734 316.45V181.45H382.781V386.2Z" fill="#0194FF"/> fill="#0194FF"/>
<path d="M382.781 386.2H340.594L258.469 251.481V386.2H216.281V181.45H258.469L340.734 316.45V181.45H382.781V386.2Z"
fill="#0194FF"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"/>
</svg>

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 275 B

View File

@ -1 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><path d="M0,0h24v24H0V0z" fill="none"/><path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/></g></svg> <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px"
fill="#000000">
<g>
<path d="M0,0h24v24H0V0z" fill="none"/>
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"/>
</svg>

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 282 B

View File

@ -1 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z"/>
</svg>

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 417 B

View File

@ -1 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><path d="M5,20h14v-2H5V20z M5,10h4v6h6v-6h4l-7-7L5,10z"/></g></svg> <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px"
fill="#000000">
<g>
<rect fill="none" height="24" width="24"/>
</g>
<g>
<path d="M5,20h14v-2H5V20z M5,10h4v6h6v-6h4l-7-7L5,10z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 299 B