Просмотр исходного кода

update

update

update

update

update

update

update

update

update

update

update

update

update

update

update

update

update

update
Milan Jurkulak 2 лет назад
Родитель
Сommit
f75a35cfe8
21 измененных файлов с 163 добавлено и 120 удалено
  1. 37 32
      build.gradle.kts
  2. 4 4
      buildSrc/build.gradle.kts
  3. 3 3
      buildSrc/src/main/kotlin/org/mjdev/gradle/extensions/ProjectExt.kt
  4. 5 1
      gradle/libs.versions.toml
  5. 2 3
      gradle/wrapper/gradle-wrapper.properties
  6. 2 2
      src/main/kotlin/eu/mjdev/desktop/components/appsmenu/AppsMenuApp.kt
  7. 20 6
      src/main/kotlin/eu/mjdev/desktop/components/card/CompactCard.kt
  8. 3 3
      src/main/kotlin/eu/mjdev/desktop/components/card/FocusableCard.kt
  9. 9 5
      src/main/kotlin/eu/mjdev/desktop/components/card/base/CardDefaults.kt
  10. 8 12
      src/main/kotlin/eu/mjdev/desktop/components/input/PasswordTextView.kt
  11. 0 5
      src/main/kotlin/eu/mjdev/desktop/components/input/SelectableOutlineEditText.kt
  12. 21 14
      src/main/kotlin/eu/mjdev/desktop/components/surface/Surface.kt
  13. 13 9
      src/main/kotlin/eu/mjdev/desktop/components/surface/base/ClickableSurfaceDefaults.kt
  14. 7 2
      src/main/kotlin/eu/mjdev/desktop/components/surface/base/SurfaceGlow.kt
  15. 1 1
      src/main/kotlin/eu/mjdev/desktop/components/text/TextAny.kt
  16. 4 4
      src/main/kotlin/eu/mjdev/desktop/data/App.kt
  17. 5 6
      src/main/kotlin/eu/mjdev/desktop/data/DesktopFile.kt
  18. 2 2
      src/main/kotlin/eu/mjdev/desktop/extensions/Custom.kt
  19. 1 0
      src/main/kotlin/eu/mjdev/desktop/extensions/Locale.kt
  20. 1 1
      src/main/kotlin/eu/mjdev/desktop/helpers/application/ApplicationScope.kt
  21. 15 5
      src/main/kotlin/eu/mjdev/desktop/helpers/system/LinuxIni.kt

+ 37 - 32
build.gradle.kts

@@ -1,9 +1,18 @@
+@file:Suppress("UnstableApiUsage")
+
 import org.jetbrains.compose.desktop.application.dsl.TargetFormat
-import org.jetbrains.kotlin.config.JvmTarget
+//import org.jetbrains.kotlin.config.JvmTarget
 import org.mjdev.gradle.extensions.ProjectExt.createTask
 import org.mjdev.gradle.extensions.ProjectExt.resolve
 
 plugins {
+//    java
+//    application
+
+//    kotlin("multiplatform") version "2.0.20"
+//    alias(libs.plugins.jetbrainsCompose) apply false
+//    alias(libs.plugins.compose.compiler) apply false
+
     alias(libs.plugins.kotlin.jvm)
     alias(libs.plugins.compose.desktop)
     alias(libs.plugins.kotlin.serialization)
@@ -18,30 +27,25 @@ group = libs.versions.packageName.get()
 version = libs.versions.packageVersion.get()
 
 kotlin {
-//    compilerOptions.jvmTarget = JvmTarget.JVM_17
-//    jvm {
-//        jvmToolchain(11)
-//        withJava()
-//    }
-//    sourceSets {
-//        val jvmMain by getting {
-//            dependencies {
-//                implementation(compose.desktop.currentOs)
-//            }
-//        }
-//        val jvmTest by getting
+//    jvm()
+//    linuxX64() {
+        /* Specify additional settings for the 'linux' target here */
 //    }
+    jvmToolchain {
+        languageVersion.set(JavaLanguageVersion.of(21))
+    }
+    jvmToolchain(21)
 }
 
-//configurations {
-//    "implementation" {
-//        exclude(group = "androidx.compose.animation")
-//        exclude(group = "androidx.compose.foundation")
-//        exclude(group = "androidx.compose.material")
-//        exclude(group = "androidx.compose.runtime")
-//        exclude(group = "androidx.compose.ui")
-//    }
-//}
+configurations {
+    "implementation" {
+        exclude(group = "androidx.compose.animation")
+        exclude(group = "androidx.compose.foundation")
+        exclude(group = "androidx.compose.material")
+        exclude(group = "androidx.compose.runtime")
+        exclude(group = "androidx.compose.ui")
+    }
+}
 
 allprojects {
     repositories {
@@ -68,16 +72,16 @@ allprojects {
         // preview
         implementation(compose.runtime)
         // material 3
-        implementation(compose.material3)
+//        implementation(compose.material3)
         // icons
         implementation(compose.materialIconsExtended)
         // foundation
-        implementation(compose.foundation)
+//        implementation(compose.foundation)
         // preview
-        implementation(compose.uiTooling)
-        implementation(compose.preview)
+//        implementation(compose.uiTooling)
+//        implementation(compose.preview)
         // resources
-        implementation(compose.components.resources)
+//        implementation(compose.components.resources)
         // init & desktop files
         implementation(libs.ini4j)
         // http client
@@ -114,10 +118,10 @@ allprojects {
         // gettext
         implementation("org.gnu.gettext:libintl:0.18.3")
         // constraint
-        implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.4.0")
-        implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03")
-        implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03-shaded-core")
-        implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03-shaded")
+//        implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.4.0")
+//        implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03")
+//        implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03-shaded-core")
+//        implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03-shaded")
         // paths
 //        implementation("me.sujanpoudel.multiplatform.utils:multiplatform-paths:0.2.2")
         // files
@@ -274,6 +278,7 @@ createTask<JavaExec>(
     classpath = sourceSets.main.get().runtimeClasspath
     jvmArgs("--enable-preview")
 }
+
 createTask<JavaExec>(
     name = "runDebug",
     group = "mjdev",
@@ -281,7 +286,7 @@ createTask<JavaExec>(
 ) {
     mainClass = "eu.mjdev.desktop.MainKt"
     classpath = sourceSets.main.get().runtimeClasspath
-    args = arrayListOf("-d")
+    args = arrayListOf("--debug")
     jvmArgs("--enable-preview")
     // dbus-run-session mutter --wayland --nested
 }

+ 4 - 4
buildSrc/build.gradle.kts

@@ -6,16 +6,16 @@ repositories {
 
 plugins {
     `kotlin-dsl`
-    java
-    `java-gradle-plugin`
+//    java
+//    `java-gradle-plugin`
 }
 
 dependencies {
 //    implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
     implementation(gradleApi())
     implementation(gradleKotlinDsl())
-    implementation(libs.gradle)
-    implementation(libs.gradle.api)
+//    implementation(libs.gradle)
+//    implementation(libs.gradle.api)
 }
 
 gradlePlugin {

+ 3 - 3
buildSrc/src/main/kotlin/org/mjdev/gradle/extensions/ProjectExt.kt

@@ -10,7 +10,7 @@ package org.mjdev.gradle.extensions
 
 //import org.gradle.accessors.dm.LibrariesForLibs
 import org.gradle.api.*
-import org.gradle.internal.impldep.jakarta.xml.bind.DatatypeConverter
+//import org.gradle.internal.impldep.jakarta.xml.bind.DatatypeConverter
 import org.gradle.kotlin.dsl.*
 import java.io.File
 
@@ -19,8 +19,8 @@ object ProjectExt {
     val Project.androidStudioVersion
         get() = project.extra.properties["android.studio.version"]
 
-    val Project.runningFromAndroidStudio
-        get() = DatatypeConverter.parseBoolean(project.extra.properties["android.injected.invoked.from.ide"].toString())
+//    val Project.runningFromAndroidStudio
+//        get() = DatatypeConverter.parseBoolean(project.extra.properties["android.injected.invoked.from.ide"].toString())
 
     val Project.isAndroidStudio
         get() = project.extra.properties.keys.contains("android.studio.version")

+ 5 - 1
gradle/libs.versions.toml

@@ -29,6 +29,7 @@ generativeai = "0.5.0-1.0.0-wasm"
 jna-platform = "5.6.0"
 qrose = "1.0.1"
 tts = "2.5.0"
+#compose-plugin = "1.8.0-dev1875"
 #korau = "4.0.10"
 #lanscapist = "2.3.8"
 #compose-webview = "1.9.20"
@@ -111,4 +112,7 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
 kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
 compose-desktop = { id = "org.jetbrains.compose", version.ref = "compose" }
 kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
-gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradle-versions" }
+gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradle-versions" }
+#jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
+#kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
+#compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

+ 2 - 3
gradle/wrapper/gradle-wrapper.properties

@@ -1,7 +1,6 @@
+#Thu Oct 10 12:27:02 CEST 2024
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
-networkTimeout=10000
-validateDistributionUrl=true
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

+ 2 - 2
src/main/kotlin/eu/mjdev/desktop/components/appsmenu/AppsMenuApp.kt

@@ -60,14 +60,14 @@ fun AppsMenuApp(
                 Modifier.padding(4.dp).fillMaxWidth()
             ) {
                 TextAny(
-                    text = app?.name ?: app?.fullAppName ?: "",
+                    text = (app?.name ?: app?.fullAppName ?: "").ifEmpty { "-" },
                     color = textColor,
                     singleLine = true,
                     fontSize = titleTextSize,
                     fontWeight = FontWeight.Bold
                 )
                 TextAny(
-                    text = app?.comment ?: "-",
+                    text = (app?.comment ?: "").ifEmpty { "-" },
                     color = textColor,
                     singleLine = true,
                     fontSize = commentTextSize,

+ 20 - 6
src/main/kotlin/eu/mjdev/desktop/components/card/CompactCard.kt

@@ -12,8 +12,8 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.foundation.layout.Column
+import androidx.compose.material.MaterialTheme
 import androidx.compose.material.ProvideTextStyle
-import androidx.compose.material3.MaterialTheme
 import androidx.compose.runtime.Composable
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
@@ -75,11 +75,25 @@ fun CardContent(
     subtitle: @Composable () -> Unit = {},
     description: @Composable () -> Unit = {}
 ) {
-    ProvideTextStyle(MaterialTheme.typography.titleMedium) { title.invoke() }
-    ProvideTextStyle(MaterialTheme.typography.bodySmall) {
-        Box(Modifier.graphicsLayer { alpha = SubtitleAlpha }) { subtitle.invoke() }
+    ProvideTextStyle(MaterialTheme.typography.subtitle2) {
+        title()
     }
-    ProvideTextStyle(MaterialTheme.typography.bodySmall) {
-        Box(Modifier.graphicsLayer { alpha = DescriptionAlpha }) { description.invoke() }
+    ProvideTextStyle(MaterialTheme.typography.body2) {
+        Box(
+            modifier = Modifier.graphicsLayer {
+                alpha = SubtitleAlpha
+            }
+        ) {
+            subtitle()
+        }
+    }
+    ProvideTextStyle(MaterialTheme.typography.body2) {
+        Box(
+            modifier = Modifier.graphicsLayer {
+            alpha = DescriptionAlpha
+            }
+        ) {
+            description()
+        }
     }
 }

+ 3 - 3
src/main/kotlin/eu/mjdev/desktop/components/card/FocusableCard.kt

@@ -11,9 +11,9 @@ package eu.mjdev.desktop.components.card
 import androidx.compose.foundation.Image
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.*
+import androidx.compose.material.MaterialTheme
 import androidx.compose.material.icons.Icons
 import androidx.compose.material.icons.filled.BrokenImage
-import androidx.compose.material3.MaterialTheme
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.MutableState
 import androidx.compose.ui.Modifier
@@ -121,7 +121,7 @@ fun FocusableCard(
                     modifier = Modifier.padding(titlePadding),
                     singleLine = true,
                     color = textColor,
-                    style = MaterialTheme.typography.bodyMedium,
+                    style = MaterialTheme.typography.body1,
                     text = item?.toString().orEmpty()
                 )
             }
@@ -144,7 +144,7 @@ fun FocusableCard(
                     modifier = Modifier.padding(titlePadding),
                     singleLine = true,
                     color = textColor,
-                    style = MaterialTheme.typography.bodySmall,
+                    style = MaterialTheme.typography.body2,
                     text = "" // todo
                 )
             }

+ 9 - 5
src/main/kotlin/eu/mjdev/desktop/components/card/base/CardDefaults.kt

@@ -10,8 +10,8 @@ package eu.mjdev.desktop.components.card.base
 
 import androidx.compose.foundation.BorderStroke
 import androidx.compose.foundation.shape.RoundedCornerShape
-import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.contentColorFor
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.contentColorFor
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.ReadOnlyComposable
 import androidx.compose.ui.Alignment
@@ -50,7 +50,7 @@ object CardDefaults {
     @ReadOnlyComposable
     @Composable
     fun colors(
-        containerColor: Color = MaterialTheme.colorScheme.surfaceVariant,
+        containerColor: Color = MaterialTheme.colors.surface,
         contentColor: Color = contentColorFor(containerColor),
         focusedContainerColor: Color = containerColor,
         focusedContentColor: Color = contentColorFor(focusedContainerColor),
@@ -68,7 +68,7 @@ object CardDefaults {
     @ReadOnlyComposable
     @Composable
     fun compactCardColors(
-        containerColor: Color = MaterialTheme.colorScheme.surfaceVariant,
+        containerColor: Color = MaterialTheme.colors.surface,
         contentColor: Color = Color.White,
         focusedContainerColor: Color = containerColor,
         focusedContentColor: Color = contentColor,
@@ -204,5 +204,9 @@ object CardDefaults {
         )
 
     fun CardGlow.toClickableSurfaceGlow() =
-        ClickableSurfaceGlow(glow = glow, focusedGlow = focusedGlow, pressedGlow = pressedGlow)
+        ClickableSurfaceGlow(
+            glow = glow,
+            focusedGlow = focusedGlow,
+            pressedGlow = pressedGlow
+        )
 }

+ 8 - 12
src/main/kotlin/eu/mjdev/desktop/components/input/PasswordTextView.kt

@@ -12,11 +12,7 @@ import androidx.compose.material.Icon
 import androidx.compose.material.OutlinedTextField
 import androidx.compose.material.TextFieldColors
 import androidx.compose.material.TextFieldDefaults
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.MutableState
-import androidx.compose.runtime.derivedStateOf
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
+import androidx.compose.runtime.*
 import androidx.compose.runtime.saveable.rememberSaveable
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
@@ -45,18 +41,18 @@ fun PasswordTextView(
     showPasswordDescription: String = "Show password",
     onDone: (password: String) -> Unit = {}
 ) {
-    val iconVisible = remember {
+    val iconVisible by remember {
         derivedStateOf {
             if (passwordVisible.value) Icons.TextFieldVisiblePassword
             else Icons.TextFieldInVisiblePassword
         }
     }
-    val iconSend = remember {
+    val iconSend by remember {
         derivedStateOf {
             if (password.value.isNotEmpty()) Icons.SendIcon else null
         }
     }
-    val description = remember {
+    val description by remember {
         derivedStateOf {
             if (passwordVisible.value) hidePasswordDescription else showPasswordDescription
         }
@@ -80,14 +76,14 @@ fun PasswordTextView(
             ) {
                 Icon(
                     modifier = Modifier.size(iconSize).onClick { passwordVisible.value = !passwordVisible.value },
-                    imageVector = iconVisible.value,
+                    imageVector = iconVisible,
                     tint = colors.textColor(true).value,
-                    contentDescription = description.value
+                    contentDescription = description
                 )
-                if (iconSend.value != null) {
+                if (iconSend != null) {
                     Icon(
                         modifier = Modifier.padding(4.dp).size(iconSize).onClick { onDone(password.value) },
-                        imageVector = iconSend.value!!,
+                        imageVector = iconSend!!,
                         tint = colors.textColor(true).value,
                         contentDescription = contentDescription
                     )

+ 0 - 5
src/main/kotlin/eu/mjdev/desktop/components/input/SelectableOutlineEditText.kt

@@ -1,6 +1,5 @@
 package eu.mjdev.desktop.components.input
 
-import androidx.compose.foundation.interaction.MutableInteractionSource
 import androidx.compose.foundation.text.KeyboardActions
 import androidx.compose.foundation.text.KeyboardOptions
 import androidx.compose.foundation.text.selection.SelectionContainer
@@ -36,7 +35,6 @@ fun SelectableOutlineEditText(
     singleLine: Boolean = false,
     maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
     minLines: Int = 1,
-    interactionSource: MutableInteractionSource? = null,
     shape: Shape = TextFieldDefaults.OutlinedTextFieldShape,
     colors: TextFieldColors = TextFieldDefaults.outlinedTextFieldColors()
 ) = SelectionContainer(
@@ -58,7 +56,6 @@ fun SelectableOutlineEditText(
         keyboardActions = keyboardActions,
         maxLines = maxLines,
         minLines = minLines,
-        interactionSource = interactionSource,
         shape = shape,
         colors = colors
     )
@@ -84,7 +81,6 @@ fun SelectableOutlineEditText(
     singleLine: Boolean = false,
     maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
     minLines: Int = 1,
-    interactionSource: MutableInteractionSource? = null,
     shape: Shape = TextFieldDefaults.OutlinedTextFieldShape,
     colors: TextFieldColors = TextFieldDefaults.outlinedTextFieldColors()
 ) = SelectionContainer(
@@ -106,7 +102,6 @@ fun SelectableOutlineEditText(
         keyboardActions = keyboardActions,
         maxLines = maxLines,
         minLines = minLines,
-        interactionSource = interactionSource,
         shape = shape,
         colors = colors
     )

+ 21 - 14
src/main/kotlin/eu/mjdev/desktop/components/surface/Surface.kt

@@ -16,10 +16,11 @@ import androidx.compose.foundation.background
 import androidx.compose.foundation.interaction.*
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.BoxScope
-import androidx.compose.material3.LocalAbsoluteTonalElevation
-import androidx.compose.material3.LocalContentColor
-import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.surfaceColorAtElevation
+import androidx.compose.material.LocalContentColor
+//import androidx.compose.material3.LocalAbsoluteTonalElevation
+//import androidx.compose.material3.LocalContentColor
+//import androidx.compose.material3.MaterialTheme
+//import androidx.compose.material3.surfaceColorAtElevation
 import androidx.compose.runtime.*
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Color
@@ -134,18 +135,21 @@ private fun SurfaceImpl(
     val focused by interactionSource.collectIsFocusedAsState()
     val pressed by interactionSource.collectIsPressedAsState()
     val surfaceAlpha = stateAlpha(enabled = enabled, focused = focused, pressed = pressed, selected = selected)
-    val absoluteElevation = LocalAbsoluteTonalElevation.current + tonalElevation
+//    val absoluteElevation =
+//        LocalAbsoluteTonalElevation.current + tonalElevation
     CompositionLocalProvider(
         LocalContentColor provides contentColor,
-        LocalAbsoluteTonalElevation provides absoluteElevation
+//        LocalAbsoluteTonalElevation provides absoluteElevation
     ) {
         val zIndex by
         animateFloatAsState(
             targetValue = if (focused) FocusedZIndex else NonFocusedZIndex,
             label = "zIndex"
         )
-        val backgroundColorByState =
-            surfaceColorAtElevation(color = color, elevation = LocalAbsoluteTonalElevation.current)
+        val backgroundColorByState = surfaceColorAtElevation(
+            color = color,
+            elevation = tonalElevation, // LocalAbsoluteTonalElevation.current
+        )
         Box(
             modifier =
                 modifier
@@ -179,12 +183,15 @@ private fun SurfaceImpl(
 }
 
 @Composable
-fun surfaceColorAtElevation(color: Color, elevation: Dp): Color {
-    return if (color == MaterialTheme.colorScheme.surface) {
-        MaterialTheme.colorScheme.surfaceColorAtElevation(elevation)
-    } else {
-        color
-    }
+fun surfaceColorAtElevation(
+    color: Color,
+    elevation: Dp
+): Color {
+//    if (color == MaterialTheme.colorScheme.surface) {
+//        return MaterialTheme.colorScheme.surfaceColorAtElevation(elevation)
+//    } else {
+    return color
+//    }
 }
 
 @Suppress("ConstPropertyName")

+ 13 - 9
src/main/kotlin/eu/mjdev/desktop/components/surface/base/ClickableSurfaceDefaults.kt

@@ -9,9 +9,9 @@
 package eu.mjdev.desktop.components.surface.base
 
 import androidx.compose.foundation.BorderStroke
-import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.ShapeDefaults
-import androidx.compose.material3.contentColorFor
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.contentColorFor
+import androidx.compose.material.primarySurface
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.ReadOnlyComposable
 import androidx.compose.ui.graphics.Color
@@ -80,15 +80,15 @@ object ClickableSurfaceDefaults {
     @ReadOnlyComposable
     @Composable
     fun colors(
-        containerColor: Color = MaterialTheme.colorScheme.surface,
+        containerColor: Color = MaterialTheme.colors.surface,
         contentColor: Color = contentColorFor(containerColor),
-        focusedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface,
+        focusedContainerColor: Color = MaterialTheme.colors.primarySurface,
         focusedContentColor: Color = contentColorFor(focusedContainerColor),
         pressedContainerColor: Color = focusedContainerColor,
         pressedContentColor: Color = contentColorFor(pressedContainerColor),
         disabledContainerColor: Color =
-            MaterialTheme.colorScheme.surfaceVariant.copy(alpha = DisabledContainerAlpha),
-        disabledContentColor: Color = MaterialTheme.colorScheme.onSurface
+            MaterialTheme.colors.primarySurface.copy(alpha = DisabledContainerAlpha),
+        disabledContentColor: Color = MaterialTheme.colors.onSurface
     ) = ClickableSurfaceColors(
         containerColor = containerColor,
         contentColor = contentColor,
@@ -150,7 +150,7 @@ object ClickableSurfaceDefaults {
         focusedDisabledBorder: Border = Border(
             border = BorderStroke(width = 2.dp, color = Color.White), // todo theme
             inset = 0.dp,
-            shape = ShapeDefaults.Small
+            shape = MaterialTheme.shapes.small
         )
     ) = ClickableSurfaceBorder(
         border = border,
@@ -179,5 +179,9 @@ object ClickableSurfaceDefaults {
         glow: Glow = Glow.None,
         focusedGlow: Glow = glow,
         pressedGlow: Glow = glow
-    ) = ClickableSurfaceGlow(glow = glow, focusedGlow = focusedGlow, pressedGlow = pressedGlow)
+    ) = ClickableSurfaceGlow(
+        glow = glow,
+        focusedGlow = focusedGlow,
+        pressedGlow = pressedGlow
+    )
 }

+ 7 - 2
src/main/kotlin/eu/mjdev/desktop/components/surface/base/SurfaceGlow.kt

@@ -26,8 +26,13 @@ internal fun Modifier.surfaceGlow(
     shape: Shape,
     glow: Glow,
 ): Modifier {
-    val color = surfaceColorAtElevation(color = glow.elevationColor, elevation = glow.elevation)
-    val glowBlurRadiusPx = with(LocalDensity.current) { glow.elevation.toPx() }
+    val color = surfaceColorAtElevation(
+        color = glow.elevationColor,
+        elevation = glow.elevation
+    )
+    val glowBlurRadiusPx = with(LocalDensity.current) {
+        glow.elevation.toPx()
+    }
     return then(
         SurfaceGlowElement(
             shape = shape,

+ 1 - 1
src/main/kotlin/eu/mjdev/desktop/components/text/TextAny.kt

@@ -2,7 +2,7 @@ package eu.mjdev.desktop.components.text
 
 import androidx.compose.desktop.ui.tooling.preview.Preview
 import androidx.compose.foundation.text.selection.SelectionContainer
-import androidx.compose.material3.Text
+import androidx.compose.material.Text
 import androidx.compose.runtime.Composable
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Color

+ 4 - 4
src/main/kotlin/eu/mjdev/desktop/data/App.kt

@@ -25,19 +25,19 @@ class App(
     val fullAppName
         get() = desktopFile.fullAppName
     val type
-        get() = desktopFile.desktopSection?.Type ?: ""
+        get() = desktopFile.desktopSection?.Type ?: DesktopFile.DesktopEntryType.Application
     val version
         get() = desktopFile.desktopSection?.Version ?: ""
     val name
-        get() = desktopFile.desktopSection?.Name ?: ""
+        get() = desktopFile.desktopSection?.Name ?: fullAppName
     val comment
-        get() = desktopFile.desktopSection?.Comment ?: ""
+        get() = desktopFile.desktopSection?.Comment ?: fullAppName
     val path
         get() = desktopFile.desktopSection?.Path ?: ""
     val exec
         get() = desktopFile.desktopSection?.Exec ?: ""
     val iconName
-        get() = desktopFile.desktopSection?.Icon ?: ""
+        get() = desktopFile.desktopSection?.Icon ?: fullAppName
     val categories
         get() = desktopFile.desktopSection?.Categories.ifEmptyCategories { listOf(Category.UNCATEGORIZED) }
     val notifyOnStart

+ 5 - 6
src/main/kotlin/eu/mjdev/desktop/data/DesktopFile.kt

@@ -7,19 +7,18 @@ import eu.mjdev.desktop.extensions.Custom.text
 import eu.mjdev.desktop.helpers.system.LinuxIni
 import org.ini4j.Ini
 import org.ini4j.Profile.Section
-import org.ini4j.Wini
 import java.io.File
 
 @Suppress("unused", "MemberVisibilityCanBePrivate", "ConstPropertyName", "PropertyName")
 class DesktopFile(
     var file: File = File(""),
-    val correctDir: String = "/tmp/.corrected-desktop-files/",
-    val correctedFile: File = File(File(correctDir), file.name),
+    val correctDir: File = File("/tmp/.corrected-desktop-files/"),
+    val correctedFile: File = File(correctDir, file.name),
     var fileData: String = (if (correctedFile.exists()) correctedFile else file).text,
-    private var content: Ini = (runCatching {
+    private var content: LinuxIni = (runCatching {
         LinuxIni(fileData)
     }.onFailure { e ->
-        Exception("Error in file: ${file.absolutePath}", e).printStackTrace()
+       e.printStackTrace()
     }.getOrNull() ?: LinuxIni())
 ) {
     var fileName: String = if (correctedFile.exists()) correctedFile.name else file.name
@@ -58,7 +57,7 @@ class DesktopFile(
                     writeTo(f)
                     file = f
                     fileData = file.text
-                    content = Wini(f)
+                    content = LinuxIni(fileData)
                 }
             }.onFailure { e ->
                 e.printStackTrace()

+ 2 - 2
src/main/kotlin/eu/mjdev/desktop/extensions/Custom.kt

@@ -112,10 +112,10 @@ object Custom {
         get() = listFiles()?.filter { it.isDirectory }?.toList() ?: emptyList<File>()
 
     val File.lines
-        get() = runCatching { if (exists()) readLines() else null }.getOrNull() ?: emptyList()
+        get() = runCatching { if (exists()) readLines(Charsets.UTF_8) else null }.getOrNull() ?: emptyList()
 
     val File.text
-        get() = runCatching { if (exists()) readText() else null }.getOrNull() ?: ""
+        get() = runCatching { if (exists()) readText(Charsets.UTF_8) else null }.getOrNull() ?: ""
 
     val File.textAsLocale: Locale
         get() = if (exists()) readTextAsLocale() else Locale.ENGLISH

+ 1 - 0
src/main/kotlin/eu/mjdev/desktop/extensions/Locale.kt

@@ -2,6 +2,7 @@ package eu.mjdev.desktop.extensions
 
 import java.util.Locale
 
+@Suppress("DEPRECATION")
 object Locale {
     fun String.toLocale(): Locale = runCatching {
         split("_").let { lc ->

+ 1 - 1
src/main/kotlin/eu/mjdev/desktop/helpers/application/ApplicationScope.kt

@@ -8,7 +8,7 @@
 
 package eu.mjdev.desktop.helpers.application
 
-import androidx.compose.material3.MaterialTheme
+import androidx.compose.material.MaterialTheme
 import androidx.compose.runtime.*
 import eu.mjdev.desktop.extensions.Compose.launchedEffect
 import eu.mjdev.desktop.helpers.application.block.SCOPED_BLOCK

+ 15 - 5
src/main/kotlin/eu/mjdev/desktop/helpers/system/LinuxIni.kt

@@ -12,19 +12,16 @@ package eu.mjdev.desktop.helpers.system
 
 import org.ini4j.Config
 import org.ini4j.Wini
-import java.io.File
-import java.io.FileInputStream
 import java.io.InputStream
 import java.io.StringBufferInputStream
 import java.nio.charset.Charset
 
-@Suppress("unused")
 class LinuxIni(
-    stream: InputStream
+    stream: InputStream,
+    charset: Charset = Charsets.UTF_8
 ) : Wini(stream) {
     constructor() : this("")
     constructor(data: String) : this(StringBufferInputStream(data))
-    constructor(file: File) : this(FileInputStream(file))
 
     init {
         config = Config().apply {
@@ -32,6 +29,19 @@ class LinuxIni(
             isPropertyFirstUpper = true
             isEscape = false
             isStrictOperator = true
+            fileEncoding = charset
+            isEmptyOption = true
+            isEmptySection = true
+        }
+    }
+
+    override fun load(
+        input: InputStream?
+    ) {
+        try {
+            super.load(input)
+        } catch (e:Exception) {
+            throw(Exception("Error in file: file:///${file.absolutePath}", e))
         }
     }
 }