Skip to content
This repository was archived by the owner on Feb 21, 2022. It is now read-only.

Commit 420f35e

Browse files
committed
Add handling theme in cache + little work with Login component
1 parent 0873aee commit 420f35e

File tree

12 files changed

+35
-53
lines changed

12 files changed

+35
-53
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
echo Building LightDM Webkit theme Osmos v$(cat ./version)...
44
echo
55

6-
rm lightdm-webkit-theme-osmos-$(cat ./version).tar.gz
6+
rm lightdm-webkit-theme-osmos*.tar.gz
77
rm -r dist/
88
yarn build
99
pushd dist && tar zcvf ../lightdm-webkit-theme-osmos-$(cat ../version).tar.gz ./* && popd

src/assets/images/close.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/assets/style/adaptive.styl

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/assets/style/index.styl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,3 @@ a
172172
transform: translateX(0)
173173
}
174174
}
175-
176-
@import './adaptive.styl'

src/components/Icon.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
.icon-container
6464
width 10vmin
6565
height 10vmin
66+
max-width 9ch
67+
max-height 9ch
6668
fill var(--color-active)
6769
6870
.user-icon
@@ -71,6 +73,4 @@
7173
svg
7274
width 100%
7375
height 100%
74-
75-
7676
</style>

src/components/LoginComponent.vue

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
.login-menu(v-if='openLogin' :class='[(theme.fullscreen) ? "fullscreen" : "", (!openLogin) ? "hide" : ""]')
44
.login-form
55
.login-form_user
6-
Icon(mode='user' :item='settings.user')
6+
icon(mode='user' :item='settings.user')
77
form(@submit.prevent='submit')
88
SelectItem(
99
mode='user'
1010
:item='settings.user'
1111
:icon='false')
1212
input(type='password' ref='password' v-model='password' placeholder='password' :readonly='logging', :class="{'error': error}")
1313
.login-form_desktop
14-
Icon(mode='desktop' :item='settings.desktop')
14+
icon(mode='desktop' :item='settings.desktop')
1515
form
16-
SelectItem(
16+
select-item(
1717
mode='desktop'
1818
:item='settings.desktop'
1919
:icon='false')
2020
.login-bottom
21-
SystemButton(type='shutdown')
22-
SystemButton(type='restart')
23-
SystemButton(type='suspend')
24-
SystemButton(type='settings')
21+
system-button(type='shutdown')
22+
system-button(type='restart')
23+
system-button(type='suspend')
24+
system-button(type='settings')
2525
</template>
2626

2727
<script>
@@ -52,7 +52,7 @@
5252
}
5353
},
5454
computed: {
55-
...mapState(['openSettings', 'openLogin']),
55+
...mapState(['openSettings', 'openLogin', 'openUsers', 'openDesktops']),
5656
...mapState('system', {
5757
theme: state => state.settings.theme
5858
}),
@@ -70,22 +70,21 @@
7070
this.SET({type: 'openLogin', items: true})
7171
} else if (this.openLogin) {
7272
this.$nextTick(() => {
73-
this.$refs.password.focus()
73+
this.$refs.password.focus();
7474
})
7575
} else {
76-
this.submit()
76+
this.submit();
7777
}
7878
}
7979
8080
if (event.key === "Escape") {
81-
console.log("Escape")
8281
if (this.openSettings) {
83-
console.log("Close settings, open login")
84-
this.SET({type: 'openLogin', items: true})
85-
this.SET({type: 'openSettings', items: false})
82+
this.SET({type: 'openLogin', items: true});
83+
this.SET({type: 'openSettings', items: false});
8684
} else if (this.openLogin) {
87-
console.log("Close login")
88-
this.SET({type: 'openLogin', items: false})
85+
this.SET({type: 'openLogin', items: false});
86+
this.SET({type: 'openUsers', items: false});
87+
this.SET({type: 'openDesktops', items: false});
8988
}
9089
}
9190
},
@@ -134,7 +133,7 @@
134133
135134
.login-form_user, .login-form_desktop
136135
display flex
137-
justify-content space-between
136+
justify-content space-around
138137
139138
form
140139
width calc(100% - 12vmin)

src/components/SelectItem.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template lang='pug'>
22
.item(
3-
:class='[(mode === "user") ? "user" : "desktop", (openUsers && mode === "user") ? "selected" : (openDesktop && mode === "desktop") ? "selected" : ""]'
3+
:class='[(mode === "user") ? "user" : "desktop", (openUsers && mode === "user") ? "selected" : (openDesktops && mode === "desktop") ? "selected" : ""]'
44
@click='openList')
55
span.username(v-if="mode === 'user'") {{ item.username }}
66
span.decktop(v-else) {{ item.name }}
@@ -10,7 +10,7 @@
1010
ul
1111
li(v-for='(item, i) in items' :key='i' @click='changeItem(item)') {{item.username}}
1212
transition(name='menu-popover')
13-
.item-list(v-if='openDesktop && mode === "desktop"')
13+
.item-list(v-if='openDesktops && mode === "desktop"')
1414
ul
1515
li(v-for='(item, i) in items' :key='i' @click='changeItem(item)') {{item.name}}
1616
</template>
@@ -22,7 +22,7 @@
2222
name: 'select-item',
2323
props: ['mode'],
2424
computed: {
25-
...mapState(['openUsers', 'openDesktop']),
25+
...mapState(['openUsers', 'openDesktops']),
2626
...mapState('system', ['settings']),
2727
item: {
2828
get() {
@@ -47,7 +47,7 @@
4747
if (this.mode === 'user') {
4848
this.SET({type: 'openUsers', items: !this.openUsers})
4949
} else {
50-
this.SET({type: 'openDesktop', items: !this.openDesktop})
50+
this.SET({type: 'openDesktops', items: !this.openDesktops})
5151
}
5252
},
5353
}

src/components/SystemButton.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
.system-button
3535
width 4vmin
3636
height 4vmin
37+
max-width 35px
38+
max-height 35px
3739
overflow hidden
3840
svg
3941
width 100%

src/components/SystemIcons.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
<path d=" M 683 183 C 669.879 215.166 661.911 236.236 647.307 267.447 C 656.26 276.94 667.267 287.955 685.124 300.442 C 665.927 292.544 652.842 284.636 643.061 276.405 C 624.366 315.414 595.058 370.961 535.623 477.755 C 582.323 450.795 618.531 434.159 652.273 427.812 C 650.825 421.59 650.056 414.829 650.112 407.805 L 650.149 406.332 C 650.89 376.406 666.461 353.391 684.906 354.953 C 703.348 356.514 717.708 382.052 716.966 411.984 C 716.824 417.621 716.17 423.037 715.06 428.066 C 748.436 434.596 784.299 451.154 830.377 477.755 C 821.291 461.028 813.153 445.954 805.406 431.589 C 793.206 422.133 780.485 409.832 754.529 396.509 C 772.371 401.147 785.155 406.507 795.112 412.485 C 716.368 265.868 710.002 246.372 683 183 L 683 183 L 683 183 Z " fill="url(#_lgradient_0)"/>
7171
</svg>
7272

73+
74+
<svg v-else-if="type === 'xmonad'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="179 14 90 90" width="90" height="90">
75+
<path d=" M 179 59 C 179 34.164 199.164 14 224 14 C 248.836 14 269 34.164 269 59 C 269 83.836 248.836 104 224 104 C 199.164 104 179 83.836 179 59 Z M 216.5 74.479 L 216.5 78.479 L 225.5 82.479 L 216.5 87.479 L 216.5 91.479 L 229.5 84.479 L 229.5 80.479 L 216.5 74.479 L 216.5 74.479 L 216.5 74.479 L 216.5 74.479 L 216.5 74.479 Z M 203.5 74.479 L 203.5 78.479 L 212.5 82.479 L 203.5 87.479 L 203.5 91.479 L 216.5 84.479 L 216.5 80.479 L 203.5 74.479 L 203.5 74.479 L 203.5 74.479 L 203.5 74.479 L 203.5 74.479 Z M 205.5 26.521 L 212.5 26.521 L 223.5 44.479 L 234.5 26.521 L 242.5 26.521 L 227.5 49.479 L 244.5 74.479 L 237.5 74.479 L 223.5 54.479 L 210.5 74.479 L 203.5 74.479 L 219.5 49.479 L 205.5 26.521 L 205.5 26.521 L 205.5 26.521 L 205.5 26.521 Z M 232.5 78.479 L 244.5 78.479 L 244.5 81.479 L 232.5 81.479 L 232.5 78.479 L 232.5 78.479 L 232.5 78.479 Z M 232.5 85.479 L 244.5 85.479 L 244.5 88.479 L 232.5 88.479 L 232.5 85.479 L 232.5 85.479 Z " fill-rule="evenodd" fill="var(--color-active)"/>
76+
</svg>
77+
7378
</template>
7479

7580
<script>

src/store/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default new Vuex.Store({
1313
state: {
1414
openSettings: false,
1515
openUsers: false,
16-
openDesktop: false,
16+
openDesktops: false,
1717
openLogin: true,
1818
themes: [
1919
{
@@ -72,8 +72,5 @@ export default new Vuex.Store({
7272
SET(state, {type, items}) {
7373
state[type] = items;
7474
},
75-
CHANCHE_THEME(state, payload) {
76-
77-
}
7875
},
7976
})

0 commit comments

Comments
 (0)