rustfmt
This commit is contained in:
parent
3e4a55f33f
commit
8e38dad6d0
|
@ -103,7 +103,7 @@ const KATAKANA: KanaCharacters = [
|
||||||
["サ", "シ", "ス", "セ", "ソ"],
|
["サ", "シ", "ス", "セ", "ソ"],
|
||||||
["タ", "チ", "ツ", "テ", "ト"],
|
["タ", "チ", "ツ", "テ", "ト"],
|
||||||
["ナ", "ニ", "ヌ", "ネ", "ノ"],
|
["ナ", "ニ", "ヌ", "ネ", "ノ"],
|
||||||
["ハ", "ヒ", "フ", "ヘ", "ホ"],
|
["ハ", "ヒ", "フ", "ヘ", "ホ"],
|
||||||
["マ", "ミ", "ム", "メ", "モ"],
|
["マ", "ミ", "ム", "メ", "モ"],
|
||||||
["ヤ", OBS, "ユ", OBS, "ヨ"],
|
["ヤ", OBS, "ユ", OBS, "ヨ"],
|
||||||
["ラ", "リ", "ル", "レ", "ロ"],
|
["ラ", "リ", "ル", "レ", "ロ"],
|
||||||
|
@ -199,4 +199,4 @@ pub fn generate_question_text(question: &Hieroglyph, exact_kana: &Kanas) -> Stri
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,13 +38,15 @@ impl ObjectImpl for LabledSwitch {
|
||||||
self.parent_constructed();
|
self.parent_constructed();
|
||||||
|
|
||||||
let l: &Label = self.label_obj.as_ref();
|
let l: &Label = self.label_obj.as_ref();
|
||||||
self.obj().bind_property("label_text", l, "label").sync_create().build();
|
self.obj()
|
||||||
|
.bind_property("label_text", l, "label")
|
||||||
|
.sync_create()
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dispose(&self) {
|
fn dispose(&self) {
|
||||||
self.dispose_template();
|
self.dispose_template();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WidgetImpl for LabledSwitch { }
|
impl WidgetImpl for LabledSwitch {}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
mod imp;
|
mod imp;
|
||||||
|
|
||||||
use glib::Object;
|
use glib::Object;
|
||||||
use gtk::{gio, glib::{self, subclass::types::ObjectSubclassIsExt}, Label, Switch};
|
use gtk::{
|
||||||
|
gio,
|
||||||
|
glib::{self, subclass::types::ObjectSubclassIsExt},
|
||||||
|
Label, Switch,
|
||||||
|
};
|
||||||
|
|
||||||
glib::wrapper! {
|
glib::wrapper! {
|
||||||
pub struct LabledSwitch(ObjectSubclass<imp::LabledSwitch>)
|
pub struct LabledSwitch(ObjectSubclass<imp::LabledSwitch>)
|
||||||
|
@ -21,4 +25,4 @@ impl LabledSwitch {
|
||||||
pub fn get_label(&self) -> &Label {
|
pub fn get_label(&self) -> &Label {
|
||||||
self.imp().label_obj.as_ref()
|
self.imp().label_obj.as_ref()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,13 @@ mod ui;
|
||||||
|
|
||||||
use crate::ui::menu::MenuScene;
|
use crate::ui::menu::MenuScene;
|
||||||
|
|
||||||
|
use gtk::{gio, glib, Application};
|
||||||
use gtk::{prelude::*, ApplicationWindow};
|
use gtk::{prelude::*, ApplicationWindow};
|
||||||
use gtk::{glib, Application, gio};
|
|
||||||
|
|
||||||
const APP_ID: &str = "org.foxarmy.learn-hieroglyph";
|
const APP_ID: &str = "org.foxarmy.learn-hieroglyph";
|
||||||
|
|
||||||
fn main() -> glib::ExitCode {
|
fn main() -> glib::ExitCode {
|
||||||
gio::resources_register_include!("compiled.gresource")
|
gio::resources_register_include!("compiled.gresource").expect("Cannot include gresources");
|
||||||
.expect("Cannot include gresources");
|
|
||||||
|
|
||||||
let app: Application = Application::builder().application_id(APP_ID).build();
|
let app: Application = Application::builder().application_id(APP_ID).build();
|
||||||
|
|
||||||
|
@ -20,7 +19,7 @@ fn main() -> glib::ExitCode {
|
||||||
app.run()
|
app.run()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_ui (app: &Application) {
|
fn test_ui(app: &Application) {
|
||||||
let window: ApplicationWindow = MenuScene::new(app).into();
|
let window: ApplicationWindow = MenuScene::new(app).into();
|
||||||
|
|
||||||
window.present();
|
window.present();
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
Loading…
Reference in New Issue