Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Some patches can replace the app's launcher icon. When a patch exposes a **custo
| Control | What it does |
|---------------------------------|------------------------------------------------------------------------------------------------|
| **Design icon** / **Edit icon** | Open the **Icon Studio** to build a new icon (or re-open the one you saved) |
| **Import folder** | Point the option at an already-prepared icon folder. E.g. one exported from the Morphe Manager |
| **Select folder** | Point the option at an already-prepared icon folder. E.g. one exported from the Morphe Manager |
| **Delete** | Clear the icon and delete its saved project + generated files |

The patch expects a specific icon folder on disk, but you never have to build that by hand. The Icon Studio generates it and sets the option to its path. The row reads **Custom icon ready** once set, **No custom icon set** otherwise.
Expand Down
11 changes: 9 additions & 2 deletions src/main/composeResources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<string name="on">On</string>
<string name="browse">Browse</string>
<string name="save">Save</string>
<string name="select_folder">Select folder</string>
<string name="status_loading">Loading…</string>
<string name="download">Download</string>
<string name="status_offline">Offline</string>
Expand Down Expand Up @@ -82,7 +83,7 @@
<string name="output_file_label">Output file</string>
<string name="color_picker_saved">Saved</string>
<string name="dropdown_search_placeholder">Search…</string>
<string name="custom_color_description">Custom color</string>
<string name="custom_color">Custom color</string>
<string name="gradient_linear">Linear</string>
<string name="gradient_radial">Radial</string>
<string name="gradient_conic">Conic</string>
Expand Down Expand Up @@ -392,7 +393,6 @@
<string name="patch_selection_configure_options_description">Configure options</string>
<string name="patch_selection_icon_edit">Edit icon</string>
<string name="patch_selection_icon_design">Design icon</string>
<string name="patch_selection_icon_import_folder">Import folder</string>
<string name="patch_selection_icon_select_folder_title">Select an icon folder</string>
<string name="patch_selection_icon_ready">Custom icon ready</string>
<string name="patch_selection_icon_none">No custom icon set</string>
Expand Down Expand Up @@ -433,6 +433,13 @@
<string name="patch_selection_option_hint_whole_number">a whole number</string>
<string name="patch_selection_option_hint_number">a number</string>
<string name="patch_selection_option_hint_text">text</string>
<string name="patch_option_recommended_size">Recommended: %1$dx%2$d</string>
<string name="patch_option_list_empty">Value cannot be empty</string>
<string name="patch_option_list_duplicate">Item already in list</string>
<string name="patch_option_list_empty_state">No items added yet</string>
<string name="patch_option_enter_value">Enter value…</string>
<string name="patch_option_add_item">Add item</string>
<string name="patch_option_edit_list">Edit list</string>
<string name="patch_selection_run_info_title">This run</string>
<string name="patch_selection_run_info_app_group">App</string>
<string name="patch_selection_run_info_bundles_group">Patch bundles</string>
Expand Down
23 changes: 23 additions & 0 deletions src/main/kotlin/app/morphe/gui/data/model/Patch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,23 @@ data class CompatiblePackage(
val versionBuildCodes: Map<String, Set<Int>> = emptyMap()
)

/**
* Semantic UI hint produced by a typed patcher option subclass.
* Null when the underlying option is a plain untyped option.
*/
enum class ExplicitOptionKind {
Folder, FilePath, Files, Image, Color, IntSlider, FloatSlider, IntRange, FloatRange
}

/** Recommended pixel dimensions for an [ExplicitOptionKind.Image] option. */
data class ImageSize(val width: Int, val height: Int)

/**
* Bounds declared by a slider option, normalized so one carrier serves the integer and the
* floating point kinds alike.
*/
data class SliderBounds(val min: Float, val max: Float, val step: Float?)

@Serializable
data class PatchOption(
val key: String,
Expand All @@ -73,6 +90,12 @@ data class PatchOption(
val required: Boolean = false,
/** The type the patch declared. [type] cannot express a list's element type. */
@Transient val valueType: KType? = null,
@Transient val explicitKind: ExplicitOptionKind? = null,
@Transient val allowedExtensions: List<String>? = null,
@Transient val recommendedSize: ImageSize? = null,
@Transient val sliderBounds: SliderBounds? = null,
@Transient val presets: Map<String, Any?>? = null,
@Transient val rawDefault: Any? = null,
)

@Serializable
Expand Down
Loading
Loading