some renaming, creating GuessingSetup scene and LabledSwitch

This commit is contained in:
2024-04-02 01:32:41 +03:00
parent e0ef46d0b8
commit 1da36b93d1
18 changed files with 146 additions and 70 deletions

View 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 {}