Fix margin between menu cards and added directory menu in dashboard.

This commit is contained in:
Jas Singh
2024-07-11 00:08:40 -07:00
parent cd149636bc
commit b974c1e755
13 changed files with 285 additions and 9 deletions

View File

@@ -0,0 +1,110 @@
const Directories = () => {
return Widget.Box({
class_name: "dashboard-card directories-container",
vpack: "fill",
hpack: "fill",
expand: true,
children: [
Widget.Box({
vertical: true,
expand: true,
class_name: "section left",
children: [
Widget.Button({
hpack: "start",
expand: true,
class_name: "directory-link documents",
on_primary_click: () => {
Utils.execAsync("dolphin Documents").catch(
(err) => `Failed to open Dolphin: ${err}`,
);
},
child: Widget.Label({
hpack: "start",
label: "󱧶 Documents",
}),
}),
Widget.Button({
hpack: "start",
expand: true,
class_name: "directory-link downloads",
on_primary_click: () => {
Utils.execAsync("dolphin Downloads").catch(
(err) => `Failed to open Dolphin: ${err}`,
);
},
child: Widget.Label({
hpack: "start",
label: "󰉍 Downloads",
}),
}),
Widget.Button({
expand: true,
hpack: "start",
class_name: "directory-link home",
on_primary_click: () => {
Utils.execAsync("dolphin ").catch(
(err) => `Failed to open Dolphin: ${err}`,
);
},
child: Widget.Label({
hpack: "start",
label: "󱂵 Home",
}),
}),
],
}),
Widget.Box({
vertical: true,
expand: true,
class_name: "section right",
children: [
Widget.Button({
expand: true,
hpack: "start",
class_name: "directory-link pictures",
on_primary_click: () => {
Utils.execAsync("dolphin Pictures").catch(
(err) => `Failed to open Dolphin: ${err}`,
);
},
child: Widget.Label({
hpack: "start",
label: "󰉏 Pictures",
}),
}),
Widget.Button({
expand: true,
hpack: "start",
class_name: "directory-link videos",
on_primary_click: () => {
Utils.execAsync("dolphin Videos").catch(
(err) => `Failed to open Dolphin: ${err}`,
);
},
child: Widget.Label({
hpack: "start",
label: "󰉏 Videos",
}),
}),
Widget.Button({
expand: true,
hpack: "start",
class_name: "directory-link projects",
on_primary_click: () => {
Utils.execAsync("dolphin Projects").catch(
(err) => `Failed to open Dolphin: ${err}`,
);
},
child: Widget.Label({
hpack: "start",
label: "󰚝 Projects",
}),
}),
],
}),
],
});
};
export { Directories };

View File

@@ -3,6 +3,7 @@ import { Profile } from "./profile/index.js";
import { Shortcuts } from "./shortcuts/index.js";
import { Controls } from "./controls/index.js";
import { Stats } from "./stats/index.js";
import { Directories } from "./directories/index.js";
export default () => {
return PopupWindow({
@@ -26,6 +27,7 @@ export default () => {
Profile(),
Shortcuts(),
Controls(),
Directories(),
Stats(),
],
}),