some renaming, creating GuessingSetup scene and LabledSwitch
This commit is contained in:
41
src/ui/guessing/setup/imp.rs
Normal file
41
src/ui/guessing/setup/imp.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
use crate::labled_switch::LabledSwitch;
|
||||
|
||||
use glib::subclass::InitializingObject;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, CompositeTemplate};
|
||||
|
||||
|
||||
#[derive(CompositeTemplate, Default)]
|
||||
#[template(resource = "/org/foxarmy/learn-hieroglyph/guessing/setup/ui.xml")]
|
||||
pub struct GuessingSetupScene {
|
||||
#[template_child]
|
||||
pub question_label: TemplateChild<LabledSwitch>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for GuessingSetupScene {
|
||||
const NAME: &'static str = "GuessingSetupScene";
|
||||
type Type = super::GuessingSetupScene;
|
||||
type ParentType = gtk::ApplicationWindow;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
||||
klass.bind_template();
|
||||
}
|
||||
|
||||
fn instance_init(obj: &InitializingObject<Self>) {
|
||||
obj.init_template();
|
||||
}
|
||||
}
|
||||
|
||||
impl ObjectImpl for GuessingSetupScene {
|
||||
fn constructed(&self) {
|
||||
self.parent_constructed();
|
||||
}
|
||||
}
|
||||
|
||||
impl WidgetImpl for GuessingSetupScene {}
|
||||
|
||||
impl WindowImpl for GuessingSetupScene {}
|
||||
|
||||
impl ApplicationWindowImpl for GuessingSetupScene {}
|
||||
Reference in New Issue
Block a user