Compare commits
2 Commits
master
...
templating
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46a415e880 | ||
|
|
9198b601be |
BIN
app-icon.png
Normal file
|
After Width: | Height: | Size: 113 MiB |
1
bun.lock
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
|
"configVersion": 0,
|
||||||
"workspaces": {
|
"workspaces": {
|
||||||
"": {
|
"": {
|
||||||
"name": "smoothie",
|
"name": "smoothie",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 2.3 KiB |
BIN
src-tauri/icons/64x64.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 903 B After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 4.5 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
|
</adaptive-icon>
|
||||||
BIN
src-tauri/icons/android/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
src-tauri/icons/android/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 117 KiB |
BIN
src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="ic_launcher_background">#fff</color>
|
||||||
|
</resources>
|
||||||
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 156 KiB |
BIN
src-tauri/icons/ios/AppIcon-20x20@1x.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src-tauri/icons/ios/AppIcon-20x20@2x-1.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src-tauri/icons/ios/AppIcon-20x20@2x.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src-tauri/icons/ios/AppIcon-20x20@3x.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
src-tauri/icons/ios/AppIcon-29x29@1x.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src-tauri/icons/ios/AppIcon-29x29@2x-1.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
src-tauri/icons/ios/AppIcon-29x29@2x.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
src-tauri/icons/ios/AppIcon-29x29@3x.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
src-tauri/icons/ios/AppIcon-40x40@1x.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src-tauri/icons/ios/AppIcon-40x40@2x-1.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
src-tauri/icons/ios/AppIcon-40x40@2x.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
src-tauri/icons/ios/AppIcon-40x40@3x.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src-tauri/icons/ios/AppIcon-512@2x.png
Normal file
|
After Width: | Height: | Size: 496 KiB |
BIN
src-tauri/icons/ios/AppIcon-60x60@2x.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src-tauri/icons/ios/AppIcon-60x60@3x.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src-tauri/icons/ios/AppIcon-76x76@1x.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
src-tauri/icons/ios/AppIcon-76x76@2x.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
@ -2,6 +2,13 @@
|
|||||||
import VersionCard from './VersionCard.svelte';
|
import VersionCard from './VersionCard.svelte';
|
||||||
import { send, receive } from '$lib/transition.js';
|
import { send, receive } from '$lib/transition.js';
|
||||||
import { flip } from 'svelte/animate';
|
import { flip } from 'svelte/animate';
|
||||||
|
import { selectedVersionStore } from '$lib/library.js';
|
||||||
|
|
||||||
|
let selectedVersion = $state(null);
|
||||||
|
|
||||||
|
selectedVersionStore.subscribe((version) => {
|
||||||
|
selectedVersion = version;
|
||||||
|
});
|
||||||
|
|
||||||
let { installedVersions } = $props();
|
let { installedVersions } = $props();
|
||||||
import '@webtui/css/base.css';
|
import '@webtui/css/base.css';
|
||||||
@ -22,7 +29,7 @@
|
|||||||
in:receive={{ key: version.version }}
|
in:receive={{ key: version.version }}
|
||||||
out:send={{ key: version.version }}
|
out:send={{ key: version.version }}
|
||||||
>
|
>
|
||||||
<VersionCard {version} />
|
<VersionCard {version} {selectedVersion} />
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
{:else}
|
{:else}
|
||||||
@ -40,7 +47,7 @@
|
|||||||
in:receive={{ key: version.version }}
|
in:receive={{ key: version.version }}
|
||||||
out:send={{ key: version.version }}
|
out:send={{ key: version.version }}
|
||||||
>
|
>
|
||||||
<VersionCard {version} />
|
<VersionCard {version} {selectedVersion} />
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -4,15 +4,18 @@
|
|||||||
deleteVersion,
|
deleteVersion,
|
||||||
launchBlenderVersion,
|
launchBlenderVersion,
|
||||||
toggleFavourite,
|
toggleFavourite,
|
||||||
registerVersion
|
registerVersion,
|
||||||
|
selectVersion
|
||||||
} from '$lib/library';
|
} from '$lib/library';
|
||||||
import Button from '$lib/components/Button.svelte';
|
import Button from '$lib/components/Button.svelte';
|
||||||
import Menu from '$lib/components/Menu.svelte';
|
import Menu from '$lib/components/Menu.svelte';
|
||||||
import { show } from '$lib/components/Dialog.svelte';
|
import { show } from '$lib/components/Dialog.svelte';
|
||||||
|
|
||||||
let { version } = $props();
|
let { version, selectedVersion } = $props();
|
||||||
let popup = $state();
|
let popup = $state();
|
||||||
|
|
||||||
|
let selected = $derived(version.version === selectedVersion?.version);
|
||||||
|
|
||||||
async function handleDelete() {
|
async function handleDelete() {
|
||||||
const prompt = await show({
|
const prompt = await show({
|
||||||
title: 'Delete',
|
title: 'Delete',
|
||||||
@ -41,7 +44,16 @@
|
|||||||
|
|
||||||
<Popup bind:this={popup} content="Version {version.version} is now the default on your system"
|
<Popup bind:this={popup} content="Version {version.version} is now the default on your system"
|
||||||
></Popup>
|
></Popup>
|
||||||
<div id="card">
|
<div
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
onkeydown={() => {}}
|
||||||
|
onclick={async () => {
|
||||||
|
await selectVersion(version);
|
||||||
|
}}
|
||||||
|
id="card"
|
||||||
|
class:selected
|
||||||
|
>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{version.version}
|
{version.version}
|
||||||
<Button style="iconbutton" onclick={() => toggleFavourite(version)}
|
<Button style="iconbutton" onclick={() => toggleFavourite(version)}
|
||||||
@ -93,11 +105,13 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
min-width: 170px;
|
min-width: 170px;
|
||||||
max-width: 200px;
|
max-width: 200px;
|
||||||
background-color: var(--white);
|
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background-color: var(--light);
|
background-color: var(--light);
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
|
#card.selected {
|
||||||
|
background-color: var(--light-accent);
|
||||||
|
}
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@ -19,9 +19,14 @@ import { updateDownloadProgress } from './download';
|
|||||||
* @property {Date} [installDate] - Installation date (if available)
|
* @property {Date} [installDate] - Installation date (if available)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const currentInstalledVersions = writable([]);
|
export const installedVersionsStore = writable([]);
|
||||||
|
export const selectedVersionStore = writable(null);
|
||||||
const favouritesStore = new LazyStore('versions.json');
|
const favouritesStore = new LazyStore('versions.json');
|
||||||
|
|
||||||
|
export async function selectVersion(version) {
|
||||||
|
selectedVersionStore.set(version);
|
||||||
|
}
|
||||||
|
|
||||||
export async function generateVersionBanner(version) {
|
export async function generateVersionBanner(version) {
|
||||||
const bannerPath = `${version.path}/banner.png`;
|
const bannerPath = `${version.path}/banner.png`;
|
||||||
if (await exists(bannerPath)) {
|
if (await exists(bannerPath)) {
|
||||||
@ -200,7 +205,7 @@ export async function removeVersion(version) {
|
|||||||
* @param {blenderVersion} version The version to toggle.
|
* @param {blenderVersion} version The version to toggle.
|
||||||
*/
|
*/
|
||||||
export async function toggleFavourite(version) {
|
export async function toggleFavourite(version) {
|
||||||
const versions = get(currentInstalledVersions);
|
const versions = get(installedVersionsStore);
|
||||||
console.log();
|
console.log();
|
||||||
const versionObj = versions.find((v) => v.version === version.version);
|
const versionObj = versions.find((v) => v.version === version.version);
|
||||||
if (versionObj) {
|
if (versionObj) {
|
||||||
@ -208,7 +213,7 @@ export async function toggleFavourite(version) {
|
|||||||
} else {
|
} else {
|
||||||
console.error('version not found', version);
|
console.error('version not found', version);
|
||||||
}
|
}
|
||||||
currentInstalledVersions.set(versions);
|
installedVersionsStore.set(versions);
|
||||||
await favouritesStore.set(version.version, versionObj.favourite);
|
await favouritesStore.set(version.version, versionObj.favourite);
|
||||||
await favouritesStore.save();
|
await favouritesStore.save();
|
||||||
}
|
}
|
||||||
@ -230,9 +235,9 @@ export async function deleteVersion(version) {
|
|||||||
await favouritesStore.save();
|
await favouritesStore.save();
|
||||||
|
|
||||||
// Update the current installed versions list
|
// Update the current installed versions list
|
||||||
const versions = get(currentInstalledVersions);
|
const versions = get(installedVersionsStore);
|
||||||
const filteredVersions = versions.filter((v) => v.version !== version.version);
|
const filteredVersions = versions.filter((v) => v.version !== version.version);
|
||||||
currentInstalledVersions.set(filteredVersions);
|
installedVersionsStore.set(filteredVersions);
|
||||||
|
|
||||||
console.log(`Successfully deleted version ${version.version}`);
|
console.log(`Successfully deleted version ${version.version}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -253,13 +258,13 @@ export async function getInstalledVersions() {
|
|||||||
const settings = get(currentSettings);
|
const settings = get(currentSettings);
|
||||||
const libraryDir = settings.libraryDir;
|
const libraryDir = settings.libraryDir;
|
||||||
if (!libraryDir) {
|
if (!libraryDir) {
|
||||||
currentInstalledVersions.set([]);
|
installedVersionsStore.set([]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const blenderLibraryPath = await join(libraryDir, BASE_LIBRARY_DIR, 'blender');
|
const blenderLibraryPath = await join(libraryDir, BASE_LIBRARY_DIR, 'blender');
|
||||||
|
|
||||||
if (!exists(blenderLibraryPath)) {
|
if (!exists(blenderLibraryPath)) {
|
||||||
currentInstalledVersions.set([]);
|
installedVersionsStore.set([]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,13 +313,13 @@ export async function getInstalledVersions() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentInstalledVersions.set(versions);
|
installedVersionsStore.set(versions);
|
||||||
cleanupOrphanedDesktopFiles(versions);
|
cleanupOrphanedDesktopFiles(versions);
|
||||||
|
|
||||||
return versions;
|
return versions;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error getting installed versions:', error);
|
console.error('Error getting installed versions:', error);
|
||||||
currentInstalledVersions.set([]);
|
installedVersionsStore.set([]);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,11 +8,10 @@
|
|||||||
// MODULES
|
// MODULES
|
||||||
import { setupTrayIcon } from '$lib/trayicon';
|
import { setupTrayIcon } from '$lib/trayicon';
|
||||||
import { getSettings, currentSettings } from '$lib/settings';
|
import { getSettings, currentSettings } from '$lib/settings';
|
||||||
import { getInstalledVersions, currentInstalledVersions } from '$lib/library';
|
|
||||||
import { getBlenderReleases, blenderReleases } from '$lib/blenderfetch';
|
import { getBlenderReleases, blenderReleases } from '$lib/blenderfetch';
|
||||||
import { downloadTasksStore } from '$lib/download';
|
|
||||||
|
|
||||||
// COMPONENTS
|
import { getInstalledVersions, installedVersionsStore } from '$lib/library.js';
|
||||||
|
import { downloadTasksStore } from '$lib/download.js';
|
||||||
import Library from '$lib/components/Library.svelte';
|
import Library from '$lib/components/Library.svelte';
|
||||||
import Download from '$lib/components/Download.svelte';
|
import Download from '$lib/components/Download.svelte';
|
||||||
import Settings from '$lib/components/Settings.svelte';
|
import Settings from '$lib/components/Settings.svelte';
|
||||||
@ -37,7 +36,7 @@
|
|||||||
settings = value;
|
settings = value;
|
||||||
console.log('Loaded settings:', settings);
|
console.log('Loaded settings:', settings);
|
||||||
});
|
});
|
||||||
currentInstalledVersions.subscribe((value) => {
|
installedVersionsStore.subscribe((value) => {
|
||||||
installedVersions = value;
|
installedVersions = value;
|
||||||
console.log('Loaded installed versions:', installedVersions);
|
console.log('Loaded installed versions:', installedVersions);
|
||||||
});
|
});
|
||||||
|
|||||||