* Implement matugen - WIP * Added matugen * Add types and cleanup code * Matugen implementation updates and added more options such as scheme and contrast. * Code cleanup and matugen settings renamed for clarity. * Makon maroon a primary matugen color. * Updates to handle variations of matugen colors * Finalizing matugen and wrapping up variations. * Minor styling updates of the settings dialog. * Do a swww dependency check. * Dependency logic update * Switch shouldn't double trigger notifications now when checking dependency. * Logic was inverted * Add matugen to dependency checker. * Fixed dependency checking conditional * Update dependency list in readme and check for matugen before doing matugen operations * Styling fixes * OSD Fix * Remove unused code from wallpaper service. * Color fixes for matugen. * Nix updates for new dependencies * Change default wallpaper to empty. * Added custom notification service for startup, cleaned up code and updated readme.
94 lines
2.6 KiB
TypeScript
94 lines
2.6 KiB
TypeScript
import RegularWindow from "widget/RegularWindow"
|
|
import icons from "lib/icons"
|
|
import options from "options"
|
|
import { ThemesMenu } from "./pages/theme/index"
|
|
import { SettingsMenu } from "./pages/config/index"
|
|
import "./side_effects";
|
|
|
|
type Page = "Configuration" | "Theming"
|
|
|
|
const CurrentPage = Variable<Page>("Configuration");
|
|
|
|
const pagerMap: Page[] = [
|
|
"Configuration",
|
|
"Theming",
|
|
]
|
|
|
|
const Header = () => Widget.CenterBox({
|
|
class_name: "header",
|
|
start_widget: Widget.Button({
|
|
class_name: "reset",
|
|
on_clicked: options.reset,
|
|
hpack: "start",
|
|
vpack: "start",
|
|
child: Widget.Icon(icons.ui.refresh),
|
|
tooltip_text: "Reset",
|
|
}),
|
|
center_widget: Widget.Box({
|
|
|
|
}),
|
|
end_widget: Widget.Button({
|
|
class_name: "close",
|
|
hpack: "end",
|
|
vpack: "start",
|
|
child: Widget.Icon(icons.ui.close),
|
|
on_clicked: () => App.closeWindow("settings-dialog"),
|
|
}),
|
|
})
|
|
|
|
const PageContainer = () => {
|
|
return Widget.Box({
|
|
hpack: "fill",
|
|
hexpand: true,
|
|
vertical: true,
|
|
children: CurrentPage.bind("value").as(v => {
|
|
return [
|
|
Widget.Box({
|
|
class_name: "option-pages-container",
|
|
hpack: "center",
|
|
hexpand: true,
|
|
children: pagerMap.map((page) => {
|
|
return Widget.Button({
|
|
xalign: 0,
|
|
hpack: "center",
|
|
class_name: `pager-button ${v === page ? 'active' : ''} category`,
|
|
label: page,
|
|
on_primary_click: () => CurrentPage.value = page
|
|
})
|
|
})
|
|
}),
|
|
Widget.Stack({
|
|
vexpand: false,
|
|
class_name: "themes-menu-stack",
|
|
children: {
|
|
"Configuration": SettingsMenu(),
|
|
"Theming": ThemesMenu(),
|
|
},
|
|
shown: CurrentPage.bind("value")
|
|
})
|
|
]
|
|
})
|
|
})
|
|
}
|
|
|
|
export default () => RegularWindow({
|
|
name: "settings-dialog",
|
|
class_name: "settings-dialog",
|
|
title: "Settings",
|
|
setup(win) {
|
|
win.on("delete-event", () => {
|
|
win.hide()
|
|
return true
|
|
})
|
|
win.set_default_size(200, 300)
|
|
},
|
|
child: Widget.Box({
|
|
class_name: "settings-dialog-box",
|
|
vertical: true,
|
|
children: [
|
|
Header(),
|
|
PageContainer()
|
|
],
|
|
}),
|
|
})
|