normalize context menu using @popperjs

+ normalize context children too
+ add setting to toggle context children via click or hover
+ add a select setting component
+ remove dead teleport code from sidebar tabs wrapper
+ general clean up
This commit is contained in:
geoffrey45
2022-10-09 00:23:01 +03:00
committed by Mungai Njoroge
parent 4e0837a627
commit bbe7984e4e
24 changed files with 314 additions and 143 deletions
+6
View File
@@ -0,0 +1,6 @@
export enum SettingType {
text,
select,
multiselect,
binary,
}
@@ -0,0 +1,27 @@
import { Setting } from "@/interfaces/settings";
import { SettingType } from "@/settings/enums";
import { contextChildrenShowModeStrings as showModeStr } from "./../strings";
import useSettingsStore from "@/stores/settings";
import { contextChildrenShowMode as mode } from "@/composables/enums";
const settings = useSettingsStore;
const context_children_show_mode: Setting = {
title: showModeStr.settings.show_mode,
type: SettingType.select,
options: [
{
title: mode.click,
value: mode.click,
},
{
title: mode.hover,
value: mode.hover,
},
],
source: () => settings().contextChildrenShowMode,
action: (value: mode) => settings().setContextChildrenShowMode(value),
};
export default [context_children_show_mode];
+4 -2
View File
@@ -1,7 +1,9 @@
import { Setting, SettingType } from "@/interfaces/settings";
import useSettingsStore from "@/stores/settings";
import { SettingType } from "../enums";
import { Setting } from "@/interfaces/settings";
import { appWidthStrings } from "./../strings";
import useSettingsStore from "@/stores/settings";
const settings = useSettingsStore;
const extend_to_full_width: Setting = {
+6 -1
View File
@@ -1,5 +1,6 @@
import { SettingCategory } from "@/interfaces/settings";
import * as strings from "../strings";
import contextChildrenShowMode from "./context-children-show-mode";
import extendWidth from "./extend-width";
import nowPlaying from "./now-playing";
import sidebarSettings from "./sidebar";
@@ -10,7 +11,11 @@ export default {
title: "General",
groups: [
{
settings: [...sidebarSettings, ...extendWidth],
settings: [
...sidebarSettings,
...extendWidth,
...contextChildrenShowMode,
],
},
{
title: npStrings.title,
+4 -2
View File
@@ -1,7 +1,9 @@
import { Setting, SettingType } from "@/interfaces/settings";
import useSettingsStore from "@/stores/settings";
import { SettingType } from "../enums";
import { Setting } from "@/interfaces/settings";
import { nowPlayingStrings as data } from "../strings";
import useSettingsStore from "@/stores/settings";
const settings = useSettingsStore;
const disable_np_img: Setting = {
+3 -1
View File
@@ -1,5 +1,7 @@
import { SettingType } from "../enums";
import { sidebarStrings } from "./../strings";
import { Setting, SettingType } from "@/interfaces/settings";
import { Setting } from "@/interfaces/settings";
import useSettingsStore from "@/stores/settings";
const settings = useSettingsStore;
+6
View File
@@ -28,3 +28,9 @@ export const sidebarStrings = <S>{
use_sidebar: "Show right sidebar",
},
};
export const contextChildrenShowModeStrings = <S>{
settings: {
show_mode: "Show context children on",
},
};