Skip to content

Commit

Permalink
tiny fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sivan22 committed Mar 5, 2024
1 parent 8162e9a commit a4f6a91
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 120 deletions.
1 change: 0 additions & 1 deletion TODO.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
קיצורי דרך מקשים לפי בחירת המשתמש
כותרת של המיקום בספר
תמיכה בזום באמצעות מגע

Expand Down
Binary file modified app_preferences.hive
Binary file not shown.
54 changes: 29 additions & 25 deletions lib/books_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,32 +54,36 @@ class BooksBrowserState extends State<BooksBrowser> {
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));
}
},
);
},
},
);
},
),
),
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/main_window_view.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
184 changes: 91 additions & 93 deletions lib/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: <Widget>[
SliderSettingsTile(
title: 'גודל גופן התחלתי בספרים',
settingKey: 'key-font-size',
defaultValue: 30,
min: 15,
max: 60,
step: 1,
leading: Icon(Icons.font_download),
decimalPrecision: 0,
onChange: (value) {},
),
DropDownSettingsTile<String>(
title: 'גופן',
settingKey: 'key-font-family',
values: const <String, String>{
'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: <Widget>[
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<String>(
selected: 'ctrl+b',
settingKey: 'key-shortcut-open-book-browser',
title: 'דפדוף בספריה',
values: shortcuctsList,
),
DropDownSettingsTile<String>(
title: 'גופן',
settingKey: 'key-font-family',
values: const <String, String>{
'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<String>(
selected: 'ctrl+b',
settingKey: 'key-shortcut-open-book-browser',
title: 'דפדוף בספריה',
values: shortcuctsList,
),
DropDownSettingsTile<String>(
selected: 'ctrl+w',
settingKey: 'key-shortcut-close-tab',
title: 'סגור ספר נוכחי',
values: shortcuctsList,
),
DropDownSettingsTile<String>(
selected: 'ctrl+x',
settingKey: 'key-shortcut-close-all-tabs',
title: 'סגור כל הספרים',
values: shortcuctsList,
),
DropDownSettingsTile<String>(
selected: 'ctrl+o',
settingKey: 'key-shortcut-open-book-search',
title: 'איתור ספר',
values: shortcuctsList,
),
DropDownSettingsTile<String>(
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<String>('key-library-path', path);
}
},
),
DropDownSettingsTile<String>(
selected: 'ctrl+x',
settingKey: 'key-shortcut-close-all-tabs',
title: 'סגור כל הספרים',
values: shortcuctsList,
),
DropDownSettingsTile<String>(
selected: 'ctrl+o',
settingKey: 'key-shortcut-open-book-search',
title: 'איתור ספר',
values: shortcuctsList,
),
DropDownSettingsTile<String>(
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<String>('key-library-path', path);
}
},
),
])
],
),
),
])
],
),
));
}
Expand Down

0 comments on commit a4f6a91

Please sign in to comment.