core: layout: add hardcoded greekmath layout
Add the built-in layout for Greek and math characters.
This commit is contained in:
parent
4a55205202
commit
ab035f1b2c
2 changed files with 14 additions and 0 deletions
|
|
@ -96,6 +96,8 @@ Layouts are essential and not installed by cargo. They are installed manually:
|
|||
$ sudo mv bottom_row.xml /usr/share/unfettered-keyboard/layouts
|
||||
$ curl -OL https://github.com/Julow/Unexpected-Keyboard/raw/1.29.1/res/xml/numeric.xml
|
||||
$ sudo mv numeric.xml /usr/share/unfettered-keyboard/layouts
|
||||
$ curl -OL https://github.com/Julow/Unexpected-Keyboard/raw/1.29.1/res/xml/greekmath.xml
|
||||
$ sudo mv numeric.xml /usr/share/unfettered-keyboard/layouts
|
||||
|
||||
# Configuration
|
||||
|
||||
|
|
|
|||
|
|
@ -611,6 +611,7 @@ impl LayoutFile {
|
|||
pub struct Layout {
|
||||
main_layout: LayoutFile,
|
||||
numeric: LayoutFile,
|
||||
greekmath: LayoutFile,
|
||||
bottom_row: LayoutFile,
|
||||
|
||||
rows: Vec<Vec<Key>>,
|
||||
|
|
@ -700,12 +701,16 @@ impl Layout {
|
|||
let path = dir.join("numeric.xml");
|
||||
let numeric = LayoutFile::load(path)?;
|
||||
|
||||
let path = dir.join("greekmath.xml");
|
||||
let greekmath = LayoutFile::load(path)?;
|
||||
|
||||
let path = dir.join("bottom_row.xml");
|
||||
let bottom_row = LayoutFile::load(path)?;
|
||||
|
||||
let mut layout = Layout {
|
||||
main_layout,
|
||||
numeric,
|
||||
greekmath,
|
||||
bottom_row,
|
||||
|
||||
rows: Vec::new(),
|
||||
|
|
@ -818,6 +823,13 @@ impl Layout {
|
|||
self.set_text_supported(self.text_supp);
|
||||
}
|
||||
|
||||
pub fn switch_greekmath(&mut self)
|
||||
{
|
||||
let data = self.greekmath.clone();
|
||||
self.open_layout(data);
|
||||
self.set_text_supported(self.text_supp);
|
||||
}
|
||||
|
||||
pub fn switch_text(&mut self)
|
||||
{
|
||||
let data = self.main_layout.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue