diff --git a/src/modules/main_menu/components/main-menu.vue b/src/modules/main_menu/components/main-menu.vue index 7c2b919b..3def71eb 100644 --- a/src/modules/main_menu/components/main-menu.vue +++ b/src/modules/main_menu/components/main-menu.vue @@ -147,6 +147,8 @@ export default { let query = this.query.toLowerCase(); let flags = new Set; + if ( this.context.simple_view ) + flags.add('simple_view'); query = query.replace(/(?<=^|\s)@(\S+)(?:\s+|$)/g, (match, flag, index) => { if ( VALID_FLAGS.includes(flag) ) { flags.add(flag); @@ -349,4 +351,4 @@ export default { } } } - \ No newline at end of file + diff --git a/src/modules/main_menu/components/menu-container.vue b/src/modules/main_menu/components/menu-container.vue index 329be5a7..a3b49099 100644 --- a/src/modules/main_menu/components/menu-container.vue +++ b/src/modules/main_menu/components/menu-container.vue @@ -62,6 +62,16 @@ export default { return true; if ( this.filter.flags ) { + if ( this.filter.flags.has('simple_view') ) { + for(const key of ['tabs', 'contents', 'items']) + if ( item[key] ) + for(const thing of item[key]) + if ( this.shouldShow(thing) ) + return true; + if ( ! item.setting || ! item.simple ) + return false; + } + if ( this.filter.flags.has('modified') ) { // We need to tree walk for this one. if ( ! is_walking ) { @@ -72,6 +82,9 @@ export default { return true; } + if ( this.context.simple_view && ! item.simple ) + return false; + if ( ! item.setting || ! this.context.currentProfile.has(item.setting) ) return false; } @@ -86,4 +99,4 @@ export default { } } } - \ No newline at end of file + diff --git a/src/modules/main_menu/components/menu-page.vue b/src/modules/main_menu/components/menu-page.vue index d6c9f6a4..fbd7cf19 100644 --- a/src/modules/main_menu/components/menu-page.vue +++ b/src/modules/main_menu/components/menu-page.vue @@ -191,6 +191,16 @@ export default { return true; if ( this.filter.flags ) { + if ( this.filter.flags.has('simple_view') ) { + for(const key of ['tabs', 'contents', 'items']) + if ( item[key] ) + for(const thing of item[key]) + if ( this.shouldShow(thing) ) + return true; + if ( ! item.setting || ! item.simple ) + return false; + } + if ( this.filter.flags.has('modified') ) { // We need to tree walk for this one. if ( ! is_walking ) { @@ -201,6 +211,9 @@ export default { return true; } + if ( this.context.simple_view && ! item.simple ) + return false; + if ( ! item.setting || ! this.context.currentProfile.has(item.setting) ) return false; } diff --git a/src/modules/main_menu/components/menu-tree.vue b/src/modules/main_menu/components/menu-tree.vue index 9178239d..f403eaaf 100644 --- a/src/modules/main_menu/components/menu-tree.vue +++ b/src/modules/main_menu/components/menu-tree.vue @@ -116,6 +116,16 @@ export default { return true; if ( this.filter.flags ) { + if ( this.filter.flags.has('simple_view') ) { + for(const key of ['tabs', 'contents', 'items']) + if ( item[key] ) + for(const thing of item[key]) + if ( this.shouldShow(thing) ) + return true; + if ( ! item.setting || ! item.simple ) + return false; + } + if ( this.filter.flags.has('modified') ) { // We need to tree walk for this one. if ( ! is_walking ) { @@ -126,6 +136,9 @@ export default { return true; } + if ( this.context.simple_view && ! item.simple ) + return false; + if ( ! item.setting || ! this.context.currentProfile.has(item.setting) ) return false; } @@ -250,4 +263,4 @@ export default { } } - \ No newline at end of file + diff --git a/src/modules/main_menu/index.js b/src/modules/main_menu/index.js index ee518646..35322d75 100644 --- a/src/modules/main_menu/index.js +++ b/src/modules/main_menu/index.js @@ -215,6 +215,15 @@ export default class MainMenu extends Module { force_seen: true }); + this.settings.add('ffz.simple-view', { + default: false, + ui: { + path: 'Appearance > Control Center >> Simple View', + title: 'Show simple view.', + component: 'setting-check-box' + } + }); + this.settings.add('ffz.search.matches-only', { default: true, ui: { @@ -939,6 +948,7 @@ export default class MainMenu extends Module { proxied: context._context.proxied, has_update: this.has_update, matches_only: settings.get('ffz.search.matches-only'), + simple_view: settings.get('ffz.simple-view'), mod_icons: context.get('context.chat.showModIcons'), setProxied: val => { @@ -1053,12 +1063,14 @@ export default class MainMenu extends Module { _update_settings() { _c.matches_only = settings.get('ffz.search.matches-only'); + _c.simple_view = settings.get('ffz.simple-view'); }, _add_user() { this._users++; if ( this._users === 1 ) { settings.on(':changed:ffz.search.matches-only', this._update_settings, this); + settings.on(':changed:ffz.simple-view', this._update_settings, this); settings.on(':profile-toggled', this._profile_toggled, this); settings.on(':profile-created', this._profile_created, this); settings.on(':profile-changed', this._profile_changed, this); @@ -1074,6 +1086,7 @@ export default class MainMenu extends Module { this._users--; if ( this._users === 0 ) { settings.off(':changed:ffz.search.matches-only', this._update_settings, this); + settings.off(':changed:ffz.simple-view', this._update_settings, this); settings.off(':profile-toggled', this._profile_toggled, this); settings.off(':profile-created', this._profile_created, this); settings.off(':profile-changed', this._profile_changed, this); diff --git a/src/std-components/tab-container.vue b/src/std-components/tab-container.vue index f62cdef7..6dffb96c 100644 --- a/src/std-components/tab-container.vue +++ b/src/std-components/tab-container.vue @@ -214,6 +214,16 @@ export default { return true; if ( this.filter.flags ) { + if ( this.filter.flags.has('simple_view') ) { + for(const key of ['tabs', 'contents', 'items']) + if ( item[key] ) + for(const thing of item[key]) + if ( this.shouldShow(thing) ) + return true; + if ( ! item.setting || ! item.simple ) + return false; + } + if ( this.filter.flags.has('modified') ) { // We need to tree walk for this one. if ( ! is_walking ) { @@ -238,4 +248,4 @@ export default { } } } - \ No newline at end of file +