File tree Expand file tree Collapse file tree 7 files changed +100
-6
lines changed Expand file tree Collapse file tree 7 files changed +100
-6
lines changed Original file line number Diff line number Diff line change 79
79
>
80
80
Events
81
81
</VueGroupButton >
82
+ <VueGroupButton
83
+ v-tooltip =" $t('App.settings.tooltip')"
84
+ :class =" {
85
+ 'icon-button': !$responsive.wide
86
+ }"
87
+ value =" settings"
88
+ icon-left =" settings_applications"
89
+ class =" settings-tab flat"
90
+ >
91
+ Settings
92
+ </VueGroupButton >
82
93
</VueGroup >
83
94
84
95
<VueButton
@@ -138,6 +149,9 @@ export default {
138
149
} else if (code === ' Digit3' ) {
139
150
this .$router .push ({ name: ' events' })
140
151
return false
152
+ } else if (code === ' Digit4' ) {
153
+ this .$router .push ({ name: ' settings' })
154
+ return false
141
155
} else if (key === ' p' || code === ' KeyP' ) {
142
156
// Prevent chrome devtools from opening the print modal
143
157
return false
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import storage from './storage'
13
13
let panelShown = ! isChrome
14
14
let pendingAction = null
15
15
16
- const isDark = isChrome ? chrome . devtools . panels . themeName === 'dark' : false
16
+ const chromeTheme = isChrome ? chrome . devtools . panels . themeName : undefined
17
17
const isBeta = process . env . RELEASE_CHANNEL === 'beta'
18
18
19
19
// Capture and log devtool errors when running as actual extension
@@ -96,7 +96,8 @@ function initApp (shell) {
96
96
Vue,
97
97
storage,
98
98
persist : [
99
- 'classifyComponents'
99
+ 'classifyComponents' ,
100
+ 'theme'
100
101
]
101
102
} )
102
103
@@ -161,14 +162,13 @@ function initApp (shell) {
161
162
store,
162
163
163
164
data : {
164
- isDark,
165
165
isBeta
166
166
} ,
167
167
168
168
watch : {
169
- isDark : {
169
+ '$shared.theme' : {
170
170
handler ( value ) {
171
- if ( value ) {
171
+ if ( value === 'dark' || ( value === 'auto' && chromeTheme === 'dark' ) ) {
172
172
document . body . classList . add ( 'vue-ui-dark-mode' )
173
173
} else {
174
174
document . body . classList . remove ( 'vue-ui-dark-mode' )
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ export default {
9
9
refresh : {
10
10
tooltip : '[[{{keys.ctrl}}]] + [[{{keys.alt}}]] + [[R]] Force Refresh'
11
11
} ,
12
+ settings : {
13
+ tooltip : '[[{{keys.ctrl}}]] + [[4]] Switch to Settings'
14
+ } ,
12
15
vuex : {
13
16
tooltip : '[[{{keys.ctrl}}]] + [[2]] Switch to Vuex'
14
17
}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import VueRouter from 'vue-router'
4
4
import ComponentsTab from './views/components/ComponentsTab.vue'
5
5
import VuexTab from './views/vuex/VuexTab.vue'
6
6
import EventsTab from './views/events/EventsTab.vue'
7
+ import SettingsTab from './views/settings/SettingsTab.vue'
7
8
8
9
Vue . use ( VueRouter )
9
10
@@ -27,6 +28,11 @@ const routes = [
27
28
name : 'events' ,
28
29
component : EventsTab
29
30
} ,
31
+ {
32
+ path : '/settings' ,
33
+ name : 'settings' ,
34
+ component : SettingsTab
35
+ } ,
30
36
{
31
37
path : '*' ,
32
38
redirect : '/'
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" global-preferences" >
3
+ <VueFormField title =" Component Name Format" >
4
+ <VueGroup
5
+ :value =" $shared.classifyComponents"
6
+ class =" extend"
7
+ @input =" $shared.classifyComponents = $event"
8
+ >
9
+ <VueGroupButton
10
+ :value =" false"
11
+ label =" kebab-case"
12
+ />
13
+ <VueGroupButton
14
+ :value =" true"
15
+ label =" PascalCase"
16
+ />
17
+ </VueGroup >
18
+ </VueFormField >
19
+
20
+ <VueFormField title =" Theme" >
21
+ <VueGroup
22
+ :value =" $shared.theme"
23
+ class =" extend"
24
+ @input =" $shared.theme = $event"
25
+ >
26
+ <VueGroupButton
27
+ value =" auto"
28
+ label =" Auto"
29
+ />
30
+ <VueGroupButton
31
+ value =" dark"
32
+ label =" Dark"
33
+ />
34
+ <VueGroupButton
35
+ value =" light"
36
+ label =" Light"
37
+ />
38
+ </VueGroup >
39
+ </VueFormField >
40
+ </div >
41
+ </template >
42
+
43
+ <style lang="stylus" scoped>
44
+ .global-preferences
45
+ display flex
46
+ flex-wrap wrap
47
+ padding 1rem 1.5rem
48
+
49
+ > *
50
+ flex-basis 300px
51
+ margin 0 .5rem 1rem .5rem
52
+ </style >-->
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" grid" >
3
+ <GlobalPreferences />
4
+ </div >
5
+ </template >
6
+
7
+ <script >
8
+ import GlobalPreferences from ' ./GlobalPreferences.vue'
9
+ import { mapState } from ' vuex'
10
+
11
+ export default {
12
+ components: { GlobalPreferences },
13
+
14
+ computed: mapState (' events' , [
15
+ ' enabled'
16
+ ])
17
+ }
18
+ </script >
Original file line number Diff line number Diff line change 1
1
// Initial state
2
2
const internalSharedData = {
3
3
openInEditorHost : '/' ,
4
- classifyComponents : true
4
+ classifyComponents : true ,
5
+ theme : 'auto'
5
6
}
6
7
7
8
// ---- INTERNALS ---- //
You can’t perform that action at this time.
0 commit comments