Skip to content

Commit 77e5726

Browse files
committed
v1.0.0
1 parent 6102347 commit 77e5726

File tree

12 files changed

+106
-21
lines changed

12 files changed

+106
-21
lines changed

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
# Tauri + Svelte + Typescript
2-
3-
This template should help get you started developing with Tauri, Svelte and TypeScript in Vite.
4-
5-
## Recommended IDE Setup
6-
7-
[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
1+
# Explorer Sidebar Manager
2+
#### A tool for adding custom items to explorer's sidebar.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "explorer-sidebar-manager",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "1.0.0",
55
"type": "module",
66
"scripts": {
77
"dev:vite": "vite",

src-tauri/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn create_shortcut_in_clsid(
169169
Err(err) => return (false, err.to_string()),
170170
}
171171
if icon_path.len() > 0 {
172-
let (default_icon, _default_icon_disp) = match shortcut.create_subkey("DefaultKey") {
172+
let (default_icon, _default_icon_disp) = match shortcut.create_subkey("DefaultIcon") {
173173
Ok(k) => k,
174174
Err(err) => return (false, err.to_string()),
175175
};
@@ -202,12 +202,12 @@ fn create_shortcut_in_clsid(
202202
Ok(k) => k,
203203
Err(err) => return (false, err.to_string()),
204204
};
205-
/*match instance.set_value("CLSID", &"") {
205+
match instance.set_value("CLSID", &"{0E5AAE11-A475-4c5b-AB00-C66DE400274E}") {
206206
Ok(()) => (),
207207
Err(err) => {
208208
return (false, err.to_string())
209209
}
210-
}*/
210+
}
211211
let (init_prop_bag, _init_prop_bag_disp) = match instance.create_subkey("InitPropertyBag") {
212212
Ok(k) => k,
213213
Err(err) => return (false, err.to_string()),
@@ -305,7 +305,7 @@ fn get_shortcut_by_id(id: &str) -> (bool, String, Option<Shortcut>) {
305305
icon_index: 0,
306306
icon_path: "".to_string(),
307307
});
308-
let default_icon_key = match shortcut.open_subkey("DefaultKey") {
308+
let default_icon_key = match shortcut.open_subkey("DefaultIcon") {
309309
Ok(key) => key,
310310
Err(err) => match err.kind() {
311311
ErrorKind::NotFound => return (true, "".to_string(), no_icon_shortcut),

src-tauri/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"withGlobalTauri": false
88
},
99
"package": {
10-
"productName": "explorer-sidebar-manager",
11-
"version": "0.0.0"
10+
"productName": "Explorer Sidebar Manager",
11+
"version": "1.0.0"
1212
},
1313
"tauri": {
1414
"allowlist": {

src/App.svelte

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@
22
import ToastSystem from './lib/ToastSystem.svelte'
33
import { Router, Route } from 'svelte-routing'
44
import Settings from './pages/Settings.svelte'
5+
import { getSetting } from './utils/settings'
6+
import Welcome from './pages/Welcome.svelte'
7+
import { navigate } from 'svelte-routing'
58
import Main from './pages/Main.svelte'
9+
import { onMount } from 'svelte'
10+
11+
onMount(async () => {
12+
if(!await getSetting('hasBeenWelcomed', false)) {
13+
navigate('/welcome')
14+
}
15+
})
616
</script>
717

818
<Router url={window.location.pathname}>
919
<Route path="/" component={Main} />
1020
<Route path="/settings" component={Settings} />
21+
<Route path="/welcome" component={Welcome} />
1122
</Router>
1223

1324
<ToastSystem />

src/input.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
label:not(.select),
7777
input:disabled:not(.select),
7878
input.disabled:not(.select),
79-
input[disabled]:not(.select) {
79+
input[disabled]:not(.select),
80+
button:not(.select) {
8081
@apply select-none;
8182
}
8283

src/lib/AddShortcutModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
type="text"
7777
name="path"
7878
autocomplete="off"
79-
placeholder="%USERPROFILE%\my\folder"
79+
placeholder="C:\my\folder"
8080
bind:value={path}
8181
required />
8282
<Button outline class="alternative" color="alternative" on:click={async () => {

src/lib/EditShortcutModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
type="text"
6868
name="path"
6969
autocomplete="off"
70-
placeholder="%USERPROFILE%\my\folder"
70+
placeholder="C:\my\folder"
7171
bind:value={path}
7272
required />
7373
<Button outline class="alternative" color="alternative" on:click={async () => {

src/output.css

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ button.alternative {
6363
label:not(.select),
6464
input:disabled:not(.select),
6565
input.disabled:not(.select),
66-
input[disabled]:not(.select) {
66+
input[disabled]:not(.select),
67+
button:not(.select) {
6768
-webkit-user-select: none;
6869
-moz-user-select: none;
6970
user-select: none;
@@ -924,6 +925,10 @@ a:hover {
924925
width: 100%;
925926
}
926927

928+
.min-w-\[50vw\] {
929+
min-width: 50vw;
930+
}
931+
927932
.max-w-2xl {
928933
max-width: 42rem;
929934
}
@@ -940,6 +945,10 @@ a:hover {
940945
max-width: 133px;
941946
}
942947

948+
.max-w-\[20\%\] {
949+
max-width: 20%;
950+
}
951+
943952
.max-w-\[301px\] {
944953
max-width: 301px;
945954
}
@@ -1071,6 +1080,22 @@ a:hover {
10711080
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
10721081
}
10731082

1083+
@keyframes bounce {
1084+
0%, 100% {
1085+
transform: translateY(-25%);
1086+
animation-timing-function: cubic-bezier(0.8,0,1,1);
1087+
}
1088+
1089+
50% {
1090+
transform: none;
1091+
animation-timing-function: cubic-bezier(0,0,0.2,1);
1092+
}
1093+
}
1094+
1095+
.animate-bounce {
1096+
animation: bounce 1s infinite;
1097+
}
1098+
10741099
@keyframes pulse {
10751100
50% {
10761101
opacity: .5;
@@ -1199,6 +1224,10 @@ a:hover {
11991224
justify-content: space-between;
12001225
}
12011226

1227+
.justify-around {
1228+
justify-content: space-around;
1229+
}
1230+
12021231
.gap-1 {
12031232
gap: 0.25rem;
12041233
}
@@ -1215,6 +1244,18 @@ a:hover {
12151244
gap: 2rem;
12161245
}
12171246

1247+
.gap-6 {
1248+
gap: 1.5rem;
1249+
}
1250+
1251+
.gap-4 {
1252+
gap: 1rem;
1253+
}
1254+
1255+
.gap-16 {
1256+
gap: 4rem;
1257+
}
1258+
12181259
.gap-y-4 {
12191260
row-gap: 1rem;
12201261
}

src/pages/Main.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
}
5151
// reassign to update UI
5252
shortcuts = shortcuts
53-
console.log({ shortcuts, shortcutIDs })
5453
5554
for(const id of invalidOrMissingShortcutIDs) {
5655
console.log(`cleaning ${id}`)
@@ -88,7 +87,7 @@
8887
{#if shortcuts && shortcuts?.length > 0}
8988
<Accordion>
9089
{#each shortcuts as { name, path, iconPath, iconIndex, guid: id, ...other }}
91-
<AccordionItem transitionType='blur'>
90+
<AccordionItem>
9291
<div slot="header" class="w-full mr-4 flex justify-between items-center">
9392
<span>{name}</span>
9493
<div class="flex flex-row gap-2 justify-center items-center">

src/pages/Welcome.svelte

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<script lang="ts">
2+
import { Heading, Button, Card } from 'flowbite-svelte'
3+
import { setSetting } from '../utils/settings'
4+
import { PaintBrush } from 'svelte-heros-v2'
5+
import { navigate } from 'svelte-routing'
6+
7+
async function exit() {
8+
await setSetting('hasBeenWelcomed', true)
9+
navigate('/')
10+
}
11+
</script>
12+
13+
<main class="flex flex-row justify-around items-center px-8 h-full">
14+
<div class="flex flex-col justify-center gap-16 items-center">
15+
<Heading class="text-center">Welcome to ESM</Heading>
16+
<Button
17+
class="
18+
animate-bounce
19+
"
20+
on:click={exit}>
21+
<div class="flex flex-row items-center gap-1">
22+
<PaintBrush class="outline-none" size="1.25rem" />
23+
Start Customizing
24+
</div>
25+
</Button>
26+
</div>
27+
28+
<div class="flex flex-col h-full items-center justify-center min-w-[50vw] gap-6">
29+
<Card>
30+
<Heading tag="h3">Icons</Heading>
31+
To add icons to your shortcuts you'll need to specify the path to an executable, a dll, an ico or an icl file and an icon index. You can use a tool like <a class="inline" href="http://www.angusj.com/resourcehacker/#download" rel="noreferrer noopener">ResourceHacker</a> or the built-in icon chooser to find the proper icon index.
32+
</Card>
33+
<Card>
34+
<Heading tag="h3">Before Uninstalling</Heading>
35+
If you decide to uninstall ESM it's recommended to go to settings and run the clean up function before to prevent left-over shortcuts.
36+
</Card>
37+
</div>
38+
</main>

src/utils/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Store } from 'tauri-plugin-store-api'
33

44
export const settingsStore = new Store('.settings.dat')
55

6-
export type SettingsKey = 'shortcuts'
6+
export type SettingsKey = 'shortcuts' | 'hasBeenWelcomed'
77

88
export async function setSetting<T>(key: SettingsKey, value: T, save = false) {
99
await settingsStore.set(key, value)

0 commit comments

Comments
 (0)