From a4f6a91ac2981c23e0249487160cd25be25d8967 Mon Sep 17 00:00:00 2001 From: sivan22 Date: Tue, 5 Mar 2024 15:37:54 +0200 Subject: [PATCH] tiny fixes --- TODO.txt | 1 - app_preferences.hive | Bin 1705 -> 2299 bytes lib/books_browser.dart | 54 +++++------ lib/main_window_view.dart | 1 - lib/settings_screen.dart | 184 +++++++++++++++++++------------------- 5 files changed, 120 insertions(+), 120 deletions(-) diff --git a/TODO.txt b/TODO.txt index 92ff2f754..99b51e465 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,4 +1,3 @@ -קיצורי דרך מקשים לפי בחירת המשתמש כותרת של המיקום בספר תמיכה בזום באמצעות מגע diff --git a/app_preferences.hive b/app_preferences.hive index abce7a3fe308578c87088f0b6f22aba38e5677e2..b084ee560455121295b6955326dc31e1bf37ab37 100644 GIT binary patch delta 138 zcmZ3<`&)3sO16o4daU^wRex4aT&O*{gGqbxd`5FNBL)TrM%jrU#YKx#6N{2FSlEC9 l$t6WO+QsX>yg5Jl8l&OFJY$5i$p;xl5j^ag5Eh~91OVZ4E}8%U delta 7 Ocmew@xRQ6nN;UuvGXo+3 diff --git a/lib/books_browser.dart b/lib/books_browser.dart index 6177c556b..78bafc87f 100644 --- a/lib/books_browser.dart +++ b/lib/books_browser.dart @@ -54,32 +54,36 @@ class BooksBrowserState extends State { onPressed: navigateUp, ), ), - body: ListView.builder( - itemCount: _fileList.length, - itemBuilder: (context, index) { - FileSystemEntity entity = _fileList[index]; - return ListTile( - title: Text(entity.path.split(Platform.pathSeparator).last), - leading: entity is Directory - ? const Icon(Icons.folder) - : const Icon(Icons.library_books), - onTap: () { - if (entity is Directory) { - setState(() { - //_fileList = Directory(entity.path).list().toList(); - directory = entity; - _fileList = Directory(entity.path).listSync().toList(); - }); - } else if (entity is File) { - if (MediaQuery.of(context).orientation == - Orientation.portrait) { - widget.closeLeftPaneCallback(); + body: Focus( + focusNode: FocusNode(), + autofocus: true, + child: ListView.builder( + itemCount: _fileList.length, + itemBuilder: (context, index) { + FileSystemEntity entity = _fileList[index]; + return ListTile( + title: Text(entity.path.split(Platform.pathSeparator).last), + leading: entity is Directory + ? const Icon(Icons.folder) + : const Icon(Icons.library_books), + onTap: () { + if (entity is Directory) { + setState(() { + //_fileList = Directory(entity.path).list().toList(); + directory = entity; + _fileList = Directory(entity.path).listSync().toList(); + }); + } else if (entity is File) { + if (MediaQuery.of(context).orientation == + Orientation.portrait) { + widget.closeLeftPaneCallback(); + } + widget.openFileCallback(BookTabWindow(entity.path, 0)); } - widget.openFileCallback(BookTabWindow(entity.path, 0)); - } - }, - ); - }, + }, + ); + }, + ), ), ); } diff --git a/lib/main_window_view.dart b/lib/main_window_view.dart index 8b692bc8d..e119522de 100644 --- a/lib/main_window_view.dart +++ b/lib/main_window_view.dart @@ -1,5 +1,4 @@ import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; import 'package:otzaria/settings_screen.dart'; import 'dart:io'; import 'package:flutter/material.dart'; diff --git a/lib/settings_screen.dart b/lib/settings_screen.dart index d5c319663..215dc8ad6 100644 --- a/lib/settings_screen.dart +++ b/lib/settings_screen.dart @@ -45,106 +45,104 @@ class mySettingsScreen extends StatelessWidget { 'ctrl+8': "CTRL + 8", 'ctrl+9': "CTRL + 9", }; + return Scaffold( body: Center( - child: SizedBox.fromSize( - size: const Size.fromWidth(600), - child: SettingsScreen( - title: 'הגדרות', - children: [ - SettingsGroup( - title: 'הגדרות גופן', + child: SettingsScreen( + title: 'הגדרות', + children: [ + SettingsGroup( + title: 'הגדרות גופן', + titleTextStyle: const TextStyle(fontSize: 25), + children: [ + SliderSettingsTile( + title: 'גודל גופן התחלתי בספרים', + settingKey: 'key-font-size', + defaultValue: 30, + min: 15, + max: 60, + step: 1, + leading: Icon(Icons.font_download), + decimalPrecision: 0, + onChange: (value) {}, + ), + DropDownSettingsTile( + title: 'גופן', + settingKey: 'key-font-family', + values: const { + 'TaameyDavidCLM': 'דוד', + 'FrankRuhlCLM': 'פרנק-רוהל', + 'TaameyAshkenaz': 'טעמי אשכנז', + 'KeterYG': 'כתר', + 'Shofar': 'שופר', + 'NotoSerifHebrew': 'נוטו', + 'Tinos': 'טינוס', + 'NotoRashiHebrew': 'רש"י', + 'Candara': 'קנדרה', + 'roboto': 'רובוטו', + 'Calibri': 'קליברי', + 'Arial': 'אריאל', + }, + selected: 'FrankRuhlCLM', + onChange: (value) {}, + ), + ], + ), + const SettingsGroup( + title: "קיצורי מקשים", titleTextStyle: const TextStyle(fontSize: 25), - children: [ - SliderSettingsTile( - title: 'גודל גופן התחלתי בספרים', - settingKey: 'key-font-size', - defaultValue: 30, - min: 15, - max: 60, - step: 1, - leading: Icon(Icons.font_download), - decimalPrecision: 0, - onChange: (value) {}, + children: [ + DropDownSettingsTile( + selected: 'ctrl+b', + settingKey: 'key-shortcut-open-book-browser', + title: 'דפדוף בספריה', + values: shortcuctsList, ), DropDownSettingsTile( - title: 'גופן', - settingKey: 'key-font-family', - values: const { - 'TaameyDavidCLM': 'דוד', - 'FrankRuhlCLM': 'פרנק-רוהל', - 'TaameyAshkenaz': 'טעמי אשכנז', - 'KeterYG': 'כתר', - 'Shofar': 'שופר', - 'NotoSerifHebrew': 'נוטו', - 'Tinos': 'טינוס', - 'NotoRashiHebrew': 'רש"י', - 'Candara': 'קנדרה', - 'roboto': 'רובוטו', - 'Calibri': 'קליברי', - 'Arial': 'אריאל', - }, - selected: 'FrankRuhlCLM', - onChange: (value) {}, + selected: 'ctrl+w', + settingKey: 'key-shortcut-close-tab', + title: 'סגור ספר נוכחי', + values: shortcuctsList, ), - ], - ), - const SettingsGroup( - title: "קיצורי מקשים", - titleTextStyle: const TextStyle(fontSize: 25), - children: [ - DropDownSettingsTile( - selected: 'ctrl+b', - settingKey: 'key-shortcut-open-book-browser', - title: 'דפדוף בספריה', - values: shortcuctsList, - ), - DropDownSettingsTile( - selected: 'ctrl+w', - settingKey: 'key-shortcut-close-tab', - title: 'סגור ספר נוכחי', - values: shortcuctsList, - ), - DropDownSettingsTile( - selected: 'ctrl+x', - settingKey: 'key-shortcut-close-all-tabs', - title: 'סגור כל הספרים', - values: shortcuctsList, - ), - DropDownSettingsTile( - selected: 'ctrl+o', - settingKey: 'key-shortcut-open-book-search', - title: 'איתור ספר', - values: shortcuctsList, - ), - DropDownSettingsTile( - selected: 'ctrl+q', - settingKey: 'key-shortcut-open-new-search', - title: 'חלון חיפוש חדש', - values: shortcuctsList, - ), - ]), - SettingsGroup( - title: 'כללי', - titleTextStyle: const TextStyle(fontSize: 25), - children: [ - TextInputSettingsTile( - settingKey: 'key-library-path', - title: 'מיקום הספריה', - leading: IconButton( - icon: const Icon(Icons.folder), - onPressed: () async { - String? path = - await FilePicker.platform.getDirectoryPath(); - if (path != null) { - Settings.setValue('key-library-path', path); - } - }, - ), + DropDownSettingsTile( + selected: 'ctrl+x', + settingKey: 'key-shortcut-close-all-tabs', + title: 'סגור כל הספרים', + values: shortcuctsList, + ), + DropDownSettingsTile( + selected: 'ctrl+o', + settingKey: 'key-shortcut-open-book-search', + title: 'איתור ספר', + values: shortcuctsList, + ), + DropDownSettingsTile( + selected: 'ctrl+q', + settingKey: 'key-shortcut-open-new-search', + title: 'חלון חיפוש חדש', + values: shortcuctsList, + ), + ]), + SettingsGroup( + title: 'כללי', + titleTextStyle: const TextStyle(fontSize: 25), + children: [ + TextInputSettingsTile( + settingKey: 'key-library-path', + title: 'מיקום הספריה', + leading: IconButton( + icon: const Icon(Icons.folder), + onPressed: () async { + String? path = + await FilePicker.platform.getDirectoryPath(); + if (path != null) { + Settings.setValue('key-library-path', path); + } + }, ), - ]) - ], - ), + ), + ]) + ], ), )); }