Skip to content

Commit e8a24ad

Browse files
Merge pull request #25 from SparingSoftware/feature/add-dark-theme
Feature/add dark theme
2 parents c75f23a + 2f6829d commit e8a24ad

182 files changed

Lines changed: 90989 additions & 22 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/config/menu.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { shell, Menu } from 'electron'
1+
import { shell, Menu, ipcMain } from 'electron'
22

33
const setDefaultApplicationMenu = () => {
44
if (Menu.getApplicationMenu()) return
@@ -33,7 +33,29 @@ const setDefaultApplicationMenu = () => {
3333
{ role: 'reload' },
3434
{ role: 'forcereload' },
3535
{ type: 'separator' },
36-
{ role: 'togglefullscreen' }
36+
{ role: 'togglefullscreen' },
37+
{ type: 'separator' },
38+
{
39+
label: 'Theme',
40+
submenu: [
41+
{
42+
id: 'theme-light',
43+
label: 'Light',
44+
type: 'radio',
45+
click (item, browserWindow) {
46+
browserWindow.webContents.send('theme-change', 'light')
47+
}
48+
},
49+
{
50+
id: 'theme-dark',
51+
label: 'Dark',
52+
type: 'radio',
53+
click (item, browserWindow) {
54+
browserWindow.webContents.send('theme-change', 'dark')
55+
}
56+
}
57+
]
58+
}
3759
]
3860
},
3961
{
@@ -53,6 +75,10 @@ const setDefaultApplicationMenu = () => {
5375

5476
const menu = Menu.buildFromTemplate(template)
5577
Menu.setApplicationMenu(menu)
78+
79+
ipcMain.on('theme-change', (_, theme) => {
80+
menu.getMenuItemById(`theme-${theme}`).checked = true
81+
})
5682
}
5783

5884
export {

src/main/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function createWindow () {
2424
height: 563,
2525
useContentSize: true,
2626
width: 1000,
27+
titleBarStyle: 'hiddenInset',
2728
webPreferences: {
2829
webSecurity: false
2930
}

src/renderer/components/dashboardPage/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<div class="view">
3+
<header-component/>
34
<div class="pickers">
45
<boards-picker/>
56
<sprints-picker/>
67
</div>
78
<el-tabs v-model="currentTab" stretch @tab-click="changeTab">
89
<el-tab-pane label="Issues" name="issues"/>
9-
<!--<el-tab-pane label="Recent Worklogs" name="worklogs"/>-->
1010
</el-tabs>
1111
<issues v-if="currentTab === 'issues'"/>
1212
<recent-worklogs v-if="currentTab === 'worklogs'"/>
@@ -18,10 +18,12 @@ import Issues from './issues/'
1818
import RecentWorklogs from './recentWorklogs/'
1919
import BoardsPicker from './pickers/boardsPicker/'
2020
import SprintsPicker from './pickers/sprintsPicker/'
21+
import HeaderComponent from '../header'
2122
import { mapActions } from 'vuex'
2223
2324
export default {
2425
components: {
26+
HeaderComponent,
2527
BoardsPicker,
2628
RecentWorklogs,
2729
SprintsPicker,

src/renderer/components/dashboardPage/issues/index.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<div ref="issuesContainer" class="issues">
5050
<no-results v-if="noIssues"/>
5151
<preloader-bar v-wait:visible="'issuesLoading'" main/>
52-
<transition-group name="el-fade-in" mode="out-in">
52+
<transition-group name="el-fade-in" mode="out-in" tag="div">
5353
<issue
5454
v-for="(issue, i) in getFilteredIssues"
5555
:id="issue.key"
@@ -155,6 +155,8 @@ export default {
155155
</script>
156156

157157
<style lang="scss" scoped>
158+
$topbar-height: 262px; // 262px = title, boards picker, sprint picker, tabs, search input height
159+
158160
.filters-bar {
159161
padding: 0 15px 15px;
160162
display: flex;
@@ -169,11 +171,11 @@ export default {
169171
170172
.pinned-tracker {
171173
left: 0;
172-
top: 221px;
174+
top: $topbar-height;
173175
}
174176
175177
.issues {
176-
height: calc(100vh - 221px); // 221px = boards picker, sprint picker, tabs, search input height
178+
height: calc(100vh - #{$topbar-height});
177179
padding-right: 5px;
178180
overflow-y: scroll;
179181
}

src/renderer/components/dashboardPage/issues/issue/index.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,20 @@ export default {
4242
display: flex;
4343
justify-content: space-between;
4444
padding: 15px;
45-
border-top: 1px solid #e2e2e2;
46-
border-bottom: 1px solid #e2e2e2;
47-
&:hover {
48-
background: #f8f8f8;
49-
}
45+
5046
&--subtask {
5147
padding: 10px 15px 10px 40px;
5248
}
49+
5350
&__key {
5451
cursor: pointer;
5552
font-weight: 700;
5653
}
54+
5755
&__description {
5856
margin: 0 0 5px;
5957
}
58+
6059
&__tracking {
6160
margin-left: 15px;
6261
text-align: right;

src/renderer/components/dashboardPage/issues/issue/infoBar/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,19 @@ export default {
5757
vertical-align: middle;
5858
margin-right: 5px;
5959
}
60+
6061
&__status {
6162
vertical-align: middle;
6263
margin-right: 5px;
6364
}
65+
6466
&__link {
6567
vertical-align: middle;
6668
margin-right: 5px;
6769
font-size: 16px;
6870
cursor: pointer;
6971
}
72+
7073
&__avatar {
7174
display: inline-block;
7275
vertical-align: middle;

src/renderer/components/dashboardPage/issues/issue/tracker/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,10 @@ export default {
184184
background: 0;
185185
border: 0;
186186
font-size: 40px;
187-
color: #409EFF;
188187
outline: none;
189188
190189
&:hover, &:focus {
191190
background: 0;
192-
color: #86d8ff;
193191
cursor: pointer;
194192
}
195193
}

src/renderer/components/dashboardPage/issues/pinned-tracker/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export default {
5555
width: 100%;
5656
padding: 4px 15px;
5757
margin-bottom: 11px;
58-
background-color: #333333;
5958
color: #ffffff;
6059
display: flex;
6160
align-items: center;

src/renderer/components/dashboardPage/pickers/sprintsPicker/index.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
clearable
1111
filterable
1212
>
13-
<el-option
14-
v-for="item in sprints"
15-
:key="item.id"
16-
:label="item.name"
17-
:value="item.id"
18-
/>
13+
<el-option-group label="Sprints and Backlog">
14+
<el-option
15+
v-for="item in sprints"
16+
:key="item.id"
17+
:label="item.name"
18+
:value="item.id"
19+
/>
20+
</el-option-group>
1921
</el-select>
2022
</transition>
2123
</div>
@@ -52,5 +54,9 @@ export default {
5254
.sprints-picker {
5355
margin-top: 7px;
5456
position: relative;
57+
58+
/deep/ .el-input__inner {
59+
height: auto !important;
60+
}
5561
}
5662
</style>

src/renderer/components/header.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<header class="title-container" style="-webkit-app-region: drag">
3+
<h1 v-text="'workometer'"/>
4+
</header>
5+
</template>
6+
7+
<style lang="scss" scoped>
8+
.title-container {
9+
display: flex;
10+
justify-content: center;
11+
padding-top: 15px;
12+
cursor: default;
13+
user-select: none;
14+
}
15+
</style>

0 commit comments

Comments
 (0)