From abcf73916c56395735b217cdeff1604d94860340 Mon Sep 17 00:00:00 2001 From: ransome1 Date: Thu, 23 Nov 2023 15:08:07 +0100 Subject: [PATCH] Playing around with scrolling mechanism, added tool tip to tray icon --- flatpak/com.github.ransome1.sleek.appdata.xml | 2 +- flatpak/com.github.ransome1.sleek.desktop | 2 +- package.json | 2 +- release/app/package.json | 2 +- snap/snapcraft.yaml | 2 +- src/__tests__/__mock__/recurrence.txt | 16 ++++++++-------- src/main/modules/Tray.tsx | 16 +++++++++------- src/renderer/DataGrid/Grid.tsx | 6 +++--- 8 files changed, 25 insertions(+), 23 deletions(-) diff --git a/flatpak/com.github.ransome1.sleek.appdata.xml b/flatpak/com.github.ransome1.sleek.appdata.xml index e14ac888..a4b0e424 100755 --- a/flatpak/com.github.ransome1.sleek.appdata.xml +++ b/flatpak/com.github.ransome1.sleek.appdata.xml @@ -9,7 +9,7 @@ Robin Ahle - + https://github.com/ransome1/sleek https://github.com/ransome1/sleek/issues diff --git a/flatpak/com.github.ransome1.sleek.desktop b/flatpak/com.github.ransome1.sleek.desktop index 4915a510..e0fa4c82 100755 --- a/flatpak/com.github.ransome1.sleek.desktop +++ b/flatpak/com.github.ransome1.sleek.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Version=2.0.3-rc.1 +Version=2.0.3-rc.2 Name=sleek Exec=sleek Type=Application diff --git a/package.json b/package.json index 7992e064..c420dd22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sleek", - "version": "2.0.3-rc.1", + "version": "2.0.3-rc.2", "main": "./src/main/main.ts", "scripts": { "build": "concurrently \"yarn run peggy\" \"yarn run build:main\" \"yarn run build:renderer\"", diff --git a/release/app/package.json b/release/app/package.json index 48cbd138..bbf1dd68 100644 --- a/release/app/package.json +++ b/release/app/package.json @@ -1,6 +1,6 @@ { "name": "sleek", - "version": "2.0.3-rc.1", + "version": "2.0.3-rc.2", "description": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)", "synopsis": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)", "keywords": [ diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index ec0816b5..d97fad92 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: sleek base: core20 -version: "2.0.3-rc.1" +version: "2.0.3-rc.2" summary: todo.txt manager for Linux, free and open-source (FOSS) description: | sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. Stripped down to only the most necessary features, and with a clean and simple interface, sleek aims to help you focus on getting things done. diff --git a/src/__tests__/__mock__/recurrence.txt b/src/__tests__/__mock__/recurrence.txt index bbe79b0d..cea00f3c 100644 --- a/src/__tests__/__mock__/recurrence.txt +++ b/src/__tests__/__mock__/recurrence.txt @@ -1,11 +1,11 @@ -2023-11-22 Line 1 rec:1d due:2023-11-23 -2023-11-22 Line 1 rec:w due:2023-11-29 -2023-11-22 Line 1 rec:2m due:2024-01-22 -2023-11-22 Line 1 rec:+1d due:2023-11-24 -2023-11-22 Line 1 rec:7w due:2024-01-10 +2023-11-23 Line 1 rec:1d due:2023-11-24 +2023-11-23 Line 1 rec:w due:2023-11-30 +2023-11-23 Line 1 rec:2m due:2024-01-23 +2023-11-23 Line 1 rec:+1d due:2023-11-25 +2023-11-23 Line 1 rec:7w due:2024-01-11 2023-07-21 Line 1 due:2023-07-24 rec:+1b 2021-01-01 taxes are due in one year t:2022-03-30 due:2022-04-30 rec:+1y -2023-11-22 Water plants @home +quick due:2023-11-29 t:2023-11-19 rec:1w -2023-11-22 Line 1 rec:+1d t:2023-09-20 due:2023-11-23 -(A) 2023-11-22 Line 1 rec:1d pri:A due:2023-11-23 \ No newline at end of file +2023-11-23 Water plants @home +quick due:2023-11-30 t:2023-11-20 rec:1w +2023-11-23 Line 1 rec:+1d t:2023-09-20 due:2023-11-24 +(A) 2023-11-23 Line 1 rec:1d pri:A due:2023-11-24 \ No newline at end of file diff --git a/src/main/modules/Tray.tsx b/src/main/modules/Tray.tsx index b5063356..7ec87764 100644 --- a/src/main/modules/Tray.tsx +++ b/src/main/modules/Tray.tsx @@ -51,13 +51,15 @@ function createTray() { const menu = Menu.buildFromTemplate(createMenuTemplate(files)); tray = new Tray(getAssetPath(`icons/tray/${iconName}`)); - tray.on('click', () => { - handleCreateWindow(); - }); - tray.on('right-click', () => { - tray.popUpContextMenu(menu); - }); - + tray.setToolTip('sleek'); + tray + .on('click', () => { + handleCreateWindow(); + }) + .on('right-click', () => { + tray.popUpContextMenu(menu); + }); + return Promise.resolve('Tray created'); } catch (error: any) { console.error('Error creating tray:', error); diff --git a/src/renderer/DataGrid/Grid.tsx b/src/renderer/DataGrid/Grid.tsx index c9c11136..93aca7a2 100644 --- a/src/renderer/DataGrid/Grid.tsx +++ b/src/renderer/DataGrid/Grid.tsx @@ -71,12 +71,12 @@ const TodoDataGrid: React.FC = memo(({ const scrollPos = list.scrollTop; const totalHeight = list.scrollHeight; const clientHeight = list.clientHeight; - if (totalHeight - scrollPos <= clientHeight * 2) { - const remainingRows: TodoObject[] | null = todoObjects?.slice(visibleRowCount, visibleRowCount + 20); + if (totalHeight - scrollPos <= clientHeight * 3) { + const remainingRows: TodoObject[] | null = todoObjects?.slice(visibleRowCount, visibleRowCount + 30); if (remainingRows?.length === 0) { setLoadMoreRows(false); } else { - setVisibleRowCount((prevVisibleRowCount) => prevVisibleRowCount + 20); + setVisibleRowCount((prevVisibleRowCount) => prevVisibleRowCount + 30); } } }