update ui
This commit is contained in:
42
src/ui/cards/imp.rs
Normal file
42
src/ui/cards/imp.rs
Normal file
@@ -0,0 +1,42 @@
|
||||
use glib::subclass::InitializingObject;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{glib, Button, CompositeTemplate};
|
||||
|
||||
|
||||
#[derive(CompositeTemplate, Default)]
|
||||
#[template(resource = "/org/foxarmy/learn-hieroglyph/memory_cards_settings.ui.xml")]
|
||||
pub struct MemoryCardsSetupScene {
|
||||
#[template_child]
|
||||
pub edit_button: TemplateChild<Button>,
|
||||
#[template_child]
|
||||
pub start_button: TemplateChild<Button>
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for MemoryCardsSetupScene {
|
||||
const NAME: &'static str = "MemoryCardsSetupScene";
|
||||
type Type = super::MemoryCardsSetupScene;
|
||||
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 MemoryCardsSetupScene {
|
||||
fn constructed(&self) {
|
||||
|
||||
self.parent_constructed();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
impl WidgetImpl for MemoryCardsSetupScene {}
|
||||
|
||||
impl WindowImpl for MemoryCardsSetupScene {}
|
||||
|
||||
impl ApplicationWindowImpl for MemoryCardsSetupScene {}
|
||||
17
src/ui/cards/mod.rs
Normal file
17
src/ui/cards/mod.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
mod imp;
|
||||
|
||||
use glib::Object;
|
||||
use gtk::{gio, glib, Application};
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct MemoryCardsSetupScene(ObjectSubclass<imp::MemoryCardsSetupScene>)
|
||||
@extends gtk::ApplicationWindow, gtk::Window, gtk::Widget,
|
||||
@implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable,
|
||||
gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager;
|
||||
}
|
||||
|
||||
impl MemoryCardsSetupScene {
|
||||
pub fn new(app: &Application) -> Self {
|
||||
Object::builder().property("application", app).build()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user