-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update copyright and text editor view
- Loading branch information
Showing
13 changed files
with
375 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"@@locale": "fi", | ||
"settings": "Vettopwo", | ||
"aboutFltext": "Lwo FlTexte...", | ||
"fltextDesc": "FlTexte sal pykettet, nawirende sotscenenjottop nirutgo Edartseg pe Flutter, jokoguvobe sexegtota wininde byrakuvobe nekepe.", | ||
"githubRepo": "GitHub Repositori", | ||
"welcomeToFltext": "Kenn wippetu Efltextseke", | ||
"startByEither": "Apeltäptua joc...", | ||
"creatingAFile": "Ageppetua sal verfäil...", | ||
"or": "jocett...", | ||
"selectAFile": "Mäpxe sal fäil...", | ||
"tooManyFilesSelected": "äää", | ||
"tooManyFilesSelected_t": "äää", | ||
"openAnExistingFile": "Ajextua sal everfäilnde", | ||
"newFile": "Ageppetua verfäil...", | ||
"close": "Gowap", | ||
"beginTypingYourTextHere": "Apeltäptua aniruttuhepa sotscenenetu kipp...", | ||
"loading": "Jukk...", | ||
"errorWhileLoadingFile": "Ekennende jukkopseg fäile!", | ||
"thereWasAnErrorLoadingFile": "There was an error while loading the file: ", | ||
"editFile": "Jotopp fäildene", | ||
"saveFileAt": "Äðeðmogtua fäile wä...", | ||
"operationCancelled": "Operation Cancelled", | ||
"noFileWasSelected": "No filename was selected, possibly because you cancelled the operation (Went back or closed the window). Try again.", | ||
"editorFont": "Editor font", | ||
"editorFont_t": "Set the font used by the text editor. By default, the system font is used.", | ||
"saveSuccess": "Saved succesfully.", | ||
"warning": "Warning", | ||
"androidWarning": "On Android, you won't get a dialog to save the file because it's unsupported by the libraries we use. When you create a new file, you should get a dialog to enter the filename on Android. We know this is frustrating, and we apologize for any extra effort.", | ||
"selectColor": "Select color", | ||
"selectColorShade": "Select color shade", | ||
"selectedColorAndShades": "Selected color and its shades", | ||
"colorScheme": "Color scheme", | ||
"selectColorSchemeUsed": "Select the color scheme used by the application", | ||
"recents": "Nenytte", | ||
"unableToOpenURL": "Unable to open URL", | ||
"anUnknownErrorOccured_URL": "An unknown error occured while attempting to open the URL requested.", | ||
"pleaseEnterFilename": "Please enter the filename for your new text file here. It will be saved in your documents directory on Android/Fuschia. (No extension is added automatically!)", | ||
"filenameTitle": "Enter filename...", | ||
"errorCreatingNewFile": "Error while creating new file", | ||
"cancel": "Dnep" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"@@locale": "hu", | ||
"settings": "Balitaasok", | ||
"aboutFltext": "Szetika mi to Fltext...", | ||
"fltextDesc": "FlText is a blazingly fast, lightweight text editor written in Dart using Flutter, designed to maintain usability without giving away on looks.", | ||
"githubRepo": "GitHub Repository", | ||
"welcomeToFltext": "Dzso repat eis to FlText", | ||
"startByEither": "Arisztie eite...", | ||
"creatingAFile": "Ipeiate en' akta...", | ||
"or": "eidallos...", | ||
"selectAFile": "Ivalastate en' akta...", | ||
"tooManyFilesSelected": "Nagyÿk kaktak ivalastan!", | ||
"tooManyFilesSelected_t": "Nagyÿk kaktak ivalastan. To FlText dÿnattei na enichsei mÿnasza en' akta ana fora ecs tora. Kelme na epilechste mÿnasza en' akta ecs epechsergasian.", | ||
"openAnExistingFile": "Enichstie en' yfistamena akta...", | ||
"newFile": "Neu akta...", | ||
"close": "Csukninn", | ||
"beginTypingYourTextHere": "Arisztie na irite to keimena sei dotte...", | ||
"loading": "Fortosi...", | ||
"errorWhileLoadingFile": "Szfalma eis fortosi c' aktas", | ||
"thereWasAnErrorLoadingFile": "There was an error while loading the file: ", | ||
"editFile": "Epechsergasia c' keimenos", | ||
"saveFileAt": "Save file at...", | ||
"operationCancelled": "Operation Cancelled", | ||
"noFileWasSelected": "No filename was selected, possibly because you cancelled the operation (Went back or closed the window). Try again.", | ||
"editorFont": "Editor font", | ||
"editorFont_t": "Set the font used by the text editor. By default, the system font is used.", | ||
"saveSuccess": "Saved succesfully.", | ||
"warning": "Warning", | ||
"androidWarning": "On Android, you won't get a dialog to save the file because it's unsupported by the libraries we use. When you create a new file, you should get a dialog to enter the filename on Android. We know this is frustrating, and we apologize for any extra effort.", | ||
"selectColor": "Select color", | ||
"selectColorShade": "Select color shade", | ||
"selectedColorAndShades": "Selected color and its shades", | ||
"colorScheme": "Color scheme", | ||
"selectColorSchemeUsed": "Select the color scheme used by the application", | ||
"recents": "Praszfatak", | ||
"unableToOpenURL": "Unable to open URL", | ||
"anUnknownErrorOccured_URL": "An unknown error occured while attempting to open the URL requested.", | ||
"pleaseEnterFilename": "Please enter the filename for your new text file here. It will be saved in your documents directory on Android/Fuschia. (No extension is added automatically!)", | ||
"filenameTitle": "Enter filename...", | ||
"errorCreatingNewFile": "Error while creating new file", | ||
"cancel": "Akerro" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
// ignore_for_file: unused_element | ||
|
||
/* | ||
* FlText: A simple and nice-looking text editor. | ||
* Copyright (C) 2023-2024 Aggelos Tselios | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
*/ | ||
|
||
import 'dart:io'; | ||
|
||
import 'package:fltext/text_edit.dart'; | ||
import 'package:fltext/utils.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:menu_bar/menu_bar.dart'; | ||
|
||
class TabbedTextEditor extends StatefulWidget { | ||
final List<String> filesOpen = []; | ||
|
||
TabbedTextEditor({super.key, String? filename}) { | ||
filesOpen.add(filename ?? ""); | ||
} | ||
|
||
@override | ||
State<StatefulWidget> createState() => TabbedTextEditorState(); | ||
} | ||
|
||
class TabbedTextEditorState extends State<TabbedTextEditor> { | ||
@override | ||
Widget build(BuildContext context) { | ||
var l = 0; | ||
final List<Widget> tabs = []; | ||
final List<Widget> children = []; | ||
|
||
for (final f in widget.filesOpen) { | ||
tabs.add( | ||
Tab( | ||
icon: const Icon(Icons.file_open), | ||
text: f != "" ? f : "* New file", | ||
), | ||
); | ||
children.add( | ||
TextEditor( | ||
filename: f != "" ? f : null, | ||
), | ||
); | ||
l++; | ||
} | ||
|
||
/* | ||
return DefaultTabController( | ||
length: l, | ||
child: Scaffold( | ||
appBar: TabBar(tabs: tabs), | ||
body: TabBarView(children: children), | ||
), | ||
); | ||
*/ | ||
return MenuBarWidget( | ||
barButtons: [ | ||
BarButton( | ||
text: const Text('File'), | ||
submenu: SubMenu( | ||
menuItems: [ | ||
MenuButton( | ||
text: const Text('Save'), | ||
onTap: () {}, | ||
icon: const Icon(Icons.save), | ||
shortcutText: 'Ctrl+S', | ||
), | ||
const MenuDivider(), | ||
MenuButton( | ||
text: const Text('Save as'), | ||
onTap: () {}, | ||
icon: const Icon(Icons.save), | ||
shortcutText: 'Ctrl+Shift+S', | ||
), | ||
const MenuDivider(), | ||
MenuButton( | ||
text: const Text('Back to home'), | ||
onTap: () { | ||
Navigator.of(context).popUntil((route) => route.isFirst); | ||
}, | ||
icon: const Icon(Icons.exit_to_app), | ||
), | ||
const MenuDivider(), | ||
MenuButton( | ||
text: const Text('Exit'), | ||
onTap: () { | ||
exit(0); | ||
}, | ||
icon: const Icon(Icons.exit_to_app), | ||
shortcutText: 'Ctrl+Q', | ||
), | ||
], | ||
), | ||
), | ||
BarButton( | ||
text: const Text('Edit'), | ||
submenu: SubMenu( | ||
menuItems: [ | ||
MenuButton( | ||
text: const Text('Preferences...'), | ||
onTap: () {}, | ||
), | ||
], | ||
), | ||
), | ||
BarButton( | ||
text: const Text('Help'), | ||
submenu: SubMenu( | ||
menuItems: [ | ||
MenuButton( | ||
text: const Text('View License'), | ||
onTap: () { | ||
showLicense(context); | ||
}, | ||
), | ||
MenuButton( | ||
text: const Text('About'), | ||
onTap: () { | ||
showFltextAbout(context); | ||
}, | ||
icon: const Icon(Icons.info), | ||
), | ||
], | ||
), | ||
), | ||
], | ||
|
||
// Set the child, i.e. the application under the menu bar | ||
child: DefaultTabController( | ||
length: l, | ||
child: Scaffold( | ||
appBar: TabBar(tabs: tabs), | ||
body: TabBarView(children: children), | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.