git ssb

10+

Matt McKegg / patchwork



Commit df3a0af70b34b408b510eafb21126103772656a3

settings: use drop down select for theme picker instead of buttons

Matt McKegg committed on 9/23/2017, 12:45:44 AM
Parent: fd3ba19e9256f7022a96a017f86001422756189f

Files changed

modules/page/html/render/settings.jschanged
styles/dark/base.mcsschanged
styles/light/base.mcsschanged
modules/page/html/render/settings.jsView
@@ -20,9 +20,9 @@
2020 var prepend = [
2121 h('PageHeading', [
2222 h('h1', [
2323 h('strong', 'Settings')
24- ]),
24+ ])
2525 ])
2626 ]
2727
2828 return h('Scroller', { style: { overflow: 'auto' } }, [
@@ -30,22 +30,19 @@
3030 h('section.prepend', prepend),
3131 h('section.content', [
3232 h('section', [
3333 h('h2', 'Theme'),
34- computed(currentTheme, currentTheme => {
35- return themeNames.map(name => {
36- const style = currentTheme == name
37- ? { 'margin-right': '1rem', 'border-color': 'teal' }
38- : { 'margin-right': '1rem' }
39-
40- return h('button', {
41- 'ev-click': () => api.settings.sync.set({
42- patchwork: {theme: name}
43- }),
44- style
45- }, name)
34+ h('select', {
35+ style: {
36+ 'font-size': '120%'
37+ },
38+ value: currentTheme,
39+ 'ev-change': (ev) => api.settings.sync.set({
40+ patchwork: {theme: ev.target.value}
4641 })
47- })
42+ }, [
43+ themeNames.map(name => h('option', {value: name}, [name]))
44+ ])
4845 ]),
4946 h('section', [
5047 h('h2', 'Filters'),
5148 h('label', [
styles/dark/base.mcssView
@@ -21,41 +21,8 @@
2121 font-weight: normal
2222 flex: 1
2323 }
2424
25-select {
26- font-size: 80%
27- display: inline-block
28- padding: 2px 4px
29- height: 18px
30- border: 1px solid #A9A9A9
31- background: #666 svg(dropArrow) no-repeat right
32- -webkit-appearance: none
33- color: #FFF
34- padding-right: 12px
35- border-radius: 0
36-
37- :hover {
38- background-image: svg(dropArrow -active)
39- }
40-
41- @svg dropArrow {
42- width: 12px
43- height: 6px
44- content: "<path d='M2,0 L10,0 L6,6 Z' />"
45-
46- path {
47- fill: #888
48- }
49-
50- -active {
51- path {
52- fill: #DDD
53- }
54- }
55- }
56-}
57-
5825 input {
5926 [type='text'] {
6027 font-size: 80%
6128 display: inline-block
styles/light/base.mcssView
@@ -21,41 +21,8 @@
2121 font-weight: normal
2222 flex: 1
2323 }
2424
25-select {
26- font-size: 80%
27- display: inline-block
28- padding: 2px 4px
29- height: 18px
30- border: 1px solid #A9A9A9
31- background: #666 svg(dropArrow) no-repeat right
32- -webkit-appearance: none
33- color: #FFF
34- padding-right: 12px
35- border-radius: 0
36-
37- :hover {
38- background-image: svg(dropArrow -active)
39- }
40-
41- @svg dropArrow {
42- width: 12px
43- height: 6px
44- content: "<path d='M2,0 L10,0 L6,6 Z' />"
45-
46- path {
47- fill: #888
48- }
49-
50- -active {
51- path {
52- fill: #DDD
53- }
54- }
55- }
56-}
57-
5825 input {
5926 [type='text'] {
6027 font-size: 80%
6128 display: inline-block

Built with git-ssb-web