Skip to content

Commit

Permalink
Added 1st draft of a compact view
Browse files Browse the repository at this point in the history
  • Loading branch information
ransome1 committed Feb 12, 2025
1 parent 81b6992 commit a37720f
Show file tree
Hide file tree
Showing 36 changed files with 349 additions and 144 deletions.
1 change: 1 addition & 0 deletions src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Neděle",
"settings.1": "Pondělí",
"settings.menuBarVisibility": "Zobrazit menu v panelu",
"settings.compact": "Kompaktní zobrazení",
"attributes": "Atributy",
"filters": "Filtry",
"sorting": "Řazení",
Expand Down
1 change: 1 addition & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Sonntag",
"settings.1": "Montag",
"settings.menuBarVisibility": "Menüleiste anzeigen",
"settings.compact": "Kompakte Ansicht",
"attributes": "Attribute",
"filters": "Filter",
"sorting": "Sortierung",
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Sunday",
"settings.1": "Monday",
"settings.menuBarVisibility": "Show menu bar",
"settings.compact": "Compact view",
"attributes": "Attributes",
"filters": "Filters",
"sorting": "Sorting",
Expand Down
1 change: 1 addition & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Domingo",
"settings.1": "Lunes",
"settings.menuBarVisibility": "Mostrar barra de menú",
"settings.compact": "Vista compacta",
"attributes": "Atributos",
"filters": "Filtros",
"sorting": "Ordenación",
Expand Down
1 change: 1 addition & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Dimanche",
"settings.1": "Lundi",
"settings.menuBarVisibility": "Afficher la barre de menus",
"settings.compact": "Vue compacte",
"attributes": "Attributs",
"filters": "Filtres",
"sorting": "Tri",
Expand Down
1 change: 1 addition & 0 deletions src/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "रविवार",
"settings.1": "सोमवार",
"settings.menuBarVisibility": "मेनू बार दिखाएं",
"settings.compact": "संकुचित दृश्य",
"attributes": "गुण",
"filters": "फ़िल्टर",
"sorting": "क्रमबद्ध करना",
Expand Down
1 change: 1 addition & 0 deletions src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Vasárnap",
"settings.1": "Hétfő",
"settings.menuBarVisibility": "Menüsor megjelenítése",
"settings.compact": "Komplett nézet",
"attributes": "Tulajdonságok",
"filters": "Szűrők",
"sorting": "Rendezés",
Expand Down
1 change: 1 addition & 0 deletions src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Domenica",
"settings.1": "Lunedì",
"settings.menuBarVisibility": "Mostra la barra dei menu",
"settings.compact": "Vista compatta",
"attributes": "Attributi",
"filters": "Filtri",
"sorting": "Ordinamento",
Expand Down
1 change: 1 addition & 0 deletions src/locales/jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "日曜日",
"settings.1": "月曜日",
"settings.menuBarVisibility": "メニューバーを表示する",
"settings.compact": "コンパクトビュー",
"attributes": "属性",
"filters": "フィルター",
"sorting": "ソート",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "일요일",
"settings.1": "월요일",
"settings.menuBarVisibility": "메뉴 바 표시",
"settings.compact": "컴팩트 보기",
"attributes": "속성",
"filters": "필터",
"sorting": "정렬",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Niedziela",
"settings.1": "Poniedziałek",
"settings.menuBarVisibility": "Pokaż pasek menu",
"settings.compact": "Widok kompaktowy",
"attributes": "Atrybuty",
"filters": "Filtry",
"sorting": "Sortowanie",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Domingo",
"settings.1": "Segunda-feira",
"settings.menuBarVisibility": "Mostrar barra de menus",
"settings.compact": "Visão compacta",
"attributes": "Atributos",
"filters": "Filtros",
"sorting": "Classificação",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Domingo",
"settings.1": "Segunda-feira",
"settings.menuBarVisibility": "Mostrar barra de menu",
"settings.compact": "Visão compacta",
"attributes": "Atributos",
"filters": "Filtros",
"sorting": "Ordenação",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Воскресенье",
"settings.1": "Понедельник",
"settings.menuBarVisibility": "Показать строку меню",
"settings.compact": "Компактный вид",
"attributes": "Атрибуты",
"filters": "Фильтры",
"sorting": "Сортировка",
Expand Down
1 change: 1 addition & 0 deletions src/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "Pazar",
"settings.1": "Pazartesi",
"settings.menuBarVisibility": "Menü çubuğunu göster",
"settings.compact": "Kompakt görünüm",
"attributes": "Özellikler",
"filters": "Filtreler",
"sorting": "Sıralama",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"settings.0": "星期日",
"settings.1": "星期一",
"settings.menuBarVisibility": "显示菜单栏",
"settings.compact": "精简视图",
"attributes": "属性",
"filters": "过滤器",
"sorting": "排序",
Expand Down
4 changes: 4 additions & 0 deletions src/main/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ const config: Store<Settings> = new Store<Settings>({
'2.0.14': (store) => {
console.log('Migrating from 2.0.13 → 2.0.14')
store.set('menuBarVisibility', true)
},
'2.0.17': (store) => {
console.log('Migrating from 2.0.14 → 2.0.17')
store.set('compact', false)
}
}
})
Expand Down
9 changes: 8 additions & 1 deletion src/main/modules/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ function createMenu(files: FileObject[]) {
const shouldUseDarkColors = config.get('shouldUseDarkColors')
config.set('colorTheme', shouldUseDarkColors ? 'light' : 'dark')
}
}
},
{
label: 'Toggle compact mode',
click: () => {
const compact = config.get('compact')
config.set('compact', !compact)
}
}
]
},
...(files?.length > 0
Expand Down
4 changes: 0 additions & 4 deletions src/renderer/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ body {
border-radius: 0.25em;
padding: 0.25em;
}
h2.MuiDialogTitle-root {
font-size: 1.1em;
font-weight: bold;
}
a {
color: Variables.$blue;
text-decoration: underline;
Expand Down
15 changes: 14 additions & 1 deletion src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Prompt from './Prompt'
import './App.scss'
import './Buttons.scss'
import './Form.scss'
import './Compact.scss'

const { ipcRenderer, store } = window.api

Expand Down Expand Up @@ -78,6 +79,18 @@ const App = (): JSX.Element => {
ipcRenderer.send('requestData')
}, [])

useEffect(() => {
if (settings?.compact) {
document.body.classList.add('compact');
} else {
document.body.classList.remove('compact');
}

return () => {
document.body.classList.remove('compact');
};
}, [settings.compact]);

useEffect(() => {
const adjustedFontSize = Math.round(14 * (settings.zoom / 100));
const updatedTheme = createTheme({
Expand All @@ -101,7 +114,7 @@ const App = (): JSX.Element => {
return () => {
document.body.classList.remove('darkTheme', 'lightTheme');
};
}, [settings.shouldUseDarkColors, settings.zoom]);
}, [settings.shouldUseDarkColors, settings.zoom]);

return (
<>
Expand Down
41 changes: 27 additions & 14 deletions src/renderer/Buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,30 @@ button {
color: white;
}

li {
.MuiDialog-root {
.MuiDialog-paper {
.MuiDialogActions-root {
button {
width: 100%;
background: none;
border-radius: 0;
color: Variables.$blue;
font-weight: bold;
border-top: 1px solid Variables.$light-grey;
border-right: 1px solid Variables.$light-grey;
margin: 0;
&:last-child {
border-right: none;
}
}
}
}
}

.row {
button {
padding: 0.25em 0.5em;
}
[data-todotxt-attribute='due'],
[data-todotxt-attribute='t'],
[data-todotxt-attribute='rec'] {
Expand All @@ -29,13 +52,7 @@ li {
height: 100%;
padding: 0.25em 0;
}
}
}

.row {
button {
padding: 0.25em 0.5em;
}
}
&.group {
button {
font-size: 1.25em;
Expand Down Expand Up @@ -115,15 +132,11 @@ li {
height: 0.6em;
border-radius: 50%;
}
.group [data-todotxt-attribute='priority'],
#Attributes [data-todotxt-attribute='priority'] {
div[data-todotxt-attribute='priority'] {
button {
min-width: 2em;
height: 2em;
line-height: 2em;
font-size: 1.25em;
font-weight: bold;
padding: 0;
padding: 0.4em 0.6em;
}
}

Expand Down
11 changes: 11 additions & 0 deletions src/renderer/Coloring.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
@use 'sass:color';
@use 'Variables.scss';

button:not(.MuiIconButton-root):not(.MuiTab-root):not(.MuiAccordionSummary-root),
button:hover:not(.MuiIconButton-root) {
&:focus-visible {
outline: 0.1em solid Variables.$dark-grey;
}
}

*[data-todotxt-attribute] {
--color1: #5a5a5a;
--color2: #ccc;
Expand Down Expand Up @@ -134,6 +141,10 @@
}

.darkTheme {
button:not(.MuiIconButton-root),
button:hover:not(.MuiIconButton-root) {
outline-color: Variables.$light-grey;
}
*[data-todotxt-attribute]:not(
[data-todotxt-attribute='priority'],
[data-todotxt-attribute='projects'],
Expand Down
Loading

0 comments on commit a37720f

Please sign in to comment.