milan jurkulák %!s(int64=2) %!d(string=hai) anos
pai
achega
9178f50c62

+ 12 - 2
src/main/kotlin/eu/mjdev/desktop/data/DesktopFile.kt

@@ -40,7 +40,7 @@ class DesktopFile(
         get() = desktopSection?.Type == DesktopFileType.Application
 
     val isCorrect
-        get() = correctedFile.exists() || fileData.contains(Prop_StartupWMClass)
+        get() = correctedFile.exists()
 
     init {
         if (isApp && !isCorrect) {
@@ -49,6 +49,7 @@ class DesktopFile(
                 println("Corrected file: file:///${correctedFile.absolutePath}")
                 correctedFile.let { f ->
                     desktopSection?.StartupWMClass = fullAppName
+                    desktopSection?.OnlyShowIn = mutableListOf()
                     writeTo(f)
                     file = f
                     fileData = file.readText()
@@ -161,11 +162,13 @@ class DesktopFile(
             set(value) {
                 section[Prop_Icon] = value
             }
+
         var Encoding: String
             get() = ParsedString(section[Prop_Encoding])
             set(value) {
                 section[Prop_Encoding] = value
             }
+
         var NotifyOnStart: Boolean
             get() = ParsedBoolean(section[Prop_StartupNotify])
             set(value) {
@@ -183,6 +186,13 @@ class DesktopFile(
             set(value) {
                 section[Prop_Categories] = value.joinToString { "$it;" }
             }
+
+        var OnlyShowIn: MutableList<String>
+            get() = ParsedList(section[Prop_OnlyShowIn])
+            set(value) {
+                section[Prop_OnlyShowIn] = value.joinToString { "$it;" }
+            }
+
         var StartupWMClass: String
             get() = ParsedString(section[Prop_StartupWMClass]).trim()
             set(value) {
@@ -258,6 +268,7 @@ class DesktopFile(
         const val Prop_Icon = "Icon"
         const val Prop_Categories = "Categories"
         const val Prop_StartupWMClass = "StartupWMClass"
+        const val Prop_OnlyShowIn = "OnlyShowIn"
 
         // todo
         const val Prop_GenericName = "GenericName"
@@ -266,7 +277,6 @@ class DesktopFile(
         const val Prop_DBusActivatable = "DBusActivatable"
         const val Prop_Encoding = "Encoding"
         const val Prop_Keywords = "Keywords"
-        const val Prop_OnlyShowIn = "OnlyShowIn"
         const val Prop_X_ExecArg = "X-ExecArg"
         const val Prop_X_Ubuntu_Gettext_Domain = "X-Ubuntu-Gettext-Domain"
         const val Prop_NoDisplay = "NoDisplay" // boolean

+ 163 - 0
src/main/kotlin/eu/mjdev/desktop/icons/custom/Mjdev.kt

@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) Milan Jurkulák 2024.
+ *  Contact:
+ *  e: mimoccc@gmail.com
+ *  e: mj@mjdev.org
+ *  w: https://mjdev.org
+ */
+
+package eu.mjdev.desktop.icons.custom
+
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.graphics.Brush
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.SolidColor
+import androidx.compose.ui.graphics.vector.ImageVector
+import androidx.compose.ui.graphics.vector.path
+import androidx.compose.ui.unit.dp
+import kotlin.Suppress
+
+@Suppress("unused")
+val Mjdev: ImageVector
+    get() {
+        if (_Mjdev != null) {
+            return _Mjdev!!
+        }
+        _Mjdev = ImageVector.Builder(
+            name = "Mjdev",
+            defaultWidth = 47.dp,
+            defaultHeight = 26.dp,
+            viewportWidth = 268f,
+            viewportHeight = 150f
+        ).apply {
+            path(
+                fill = SolidColor(Color(0xFF666CFF))) {
+                moveTo(173.82f, 12.61f)
+                lineTo(173.82f, 12.61f)
+                arcTo(
+                    25.19f,
+                    25.1f,
+                    105f,
+                    isMoreThanHalf = false,
+                    isPositiveArc = false,
+                    164.6f,
+                    47.01f
+                )
+                lineTo(211.3f, 128.2f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 245.59f, 137.39f)
+                lineTo(245.59f, 137.39f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 254.81f, 102.99f)
+                lineTo(208.11f, 21.8f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 173.82f, 12.61f)
+                close()
+            }
+            path(
+                fill = Brush.linearGradient(
+                    colorStops = arrayOf(
+                        0f to Color(0xFF000000),
+                        1f to Color(0x00000000)
+                    ),
+                    start = Offset(174.33f, 12.61f),
+                    end = Offset(246.1f, 137.39f)
+                ),
+                fillAlpha = 0.4f
+            ) {
+                moveTo(174.33f, 12.61f)
+                lineTo(174.33f, 12.61f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 165.11f, 47.01f)
+                lineTo(211.81f, 128.2f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 246.1f, 137.39f)
+                lineTo(246.1f, 137.39f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 255.32f, 102.99f)
+                lineTo(208.62f, 21.8f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 174.33f, 12.61f)
+                close()
+            }
+            path(fill = SolidColor(Color(0xFF666CFF))) {
+                moveTo(194.9f, 12.61f)
+                lineTo(194.9f, 12.61f)
+                arcTo(25.19f, 25.1f, 75f,
+                    isMoreThanHalf = false, isPositiveArc = true, 204.12f, 47.01f)
+                lineTo(157.42f, 128.2f)
+                arcTo(25.19f, 25.1f, 75f,
+                    isMoreThanHalf = false, isPositiveArc = true, 123.13f, 137.39f)
+                lineTo(123.13f, 137.39f)
+                arcTo(25.19f, 25.1f, 75f,
+                    isMoreThanHalf = false, isPositiveArc = true, 113.91f, 102.99f)
+                lineTo(160.61f, 21.8f)
+                arcTo(25.19f, 25.1f, 75f,
+                    isMoreThanHalf = false, isPositiveArc = true, 194.9f, 12.61f)
+                close()
+            }
+            path(fill = SolidColor(Color(0xFF666CFF))) {
+                moveTo(72.44f, 12.61f)
+                lineTo(72.44f, 12.61f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 63.22f, 47.01f)
+                lineTo(109.92f, 128.2f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 144.22f, 137.39f)
+                lineTo(144.22f, 137.39f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 153.43f, 102.99f)
+                lineTo(106.73f, 21.8f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 72.44f, 12.61f)
+                close()
+            }
+            path(
+                fill = Brush.linearGradient(
+                    colorStops = arrayOf(
+                        0f to Color(0xFF000000),
+                        1f to Color(0x00000000)
+                    ),
+                    start = Offset(72.44f, 12.61f),
+                    end = Offset(144.22f, 137.39f)
+                ),
+                fillAlpha = 0.4f
+            ) {
+                moveTo(72.44f, 12.61f)
+                lineTo(72.44f, 12.61f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 63.22f, 47.01f)
+                lineTo(109.92f, 128.2f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 144.22f, 137.39f)
+                lineTo(144.22f, 137.39f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 153.43f, 102.99f)
+                lineTo(106.73f, 21.8f)
+                arcTo(25.19f, 25.1f, 105f,
+                    isMoreThanHalf = false, isPositiveArc = false, 72.44f, 12.61f)
+                close()
+            }
+            path(fill = SolidColor(Color(0xFF666CFF))) {
+                moveTo(93.53f, 12.61f)
+                lineTo(93.53f, 12.61f)
+                arcTo(25.19f, 25.1f, 75f,
+                    isMoreThanHalf = false, isPositiveArc = true, 102.75f, 47.01f)
+                lineTo(56.05f, 128.2f)
+                arcTo(25.19f, 25.1f, 75f,
+                    isMoreThanHalf = false, isPositiveArc = true, 21.75f, 137.39f)
+                lineTo(21.75f, 137.39f)
+                arcTo(25.19f, 25.1f, 75f,
+                    isMoreThanHalf = false, isPositiveArc = true, 12.54f, 102.99f)
+                lineTo(59.24f, 21.8f)
+                arcTo(25.19f, 25.1f, 75f,
+                    isMoreThanHalf = false, isPositiveArc = true, 93.53f, 12.61f)
+                close()
+            }
+        }.build()
+
+        return _Mjdev!!
+    }
+
+@Suppress("ObjectPropertyName")
+private var _Mjdev: ImageVector? = null