This commit is contained in:
takotori 2023-11-07 15:46:33 +01:00
parent 60760d779f
commit a0e3f5fbee
12 changed files with 10 additions and 14 deletions

View file

@ -0,0 +1,19 @@
use crate::components::base::listEntryImpl;
use adw::glib;
use adw::glib::{IsA, Object};
use gtk::prelude::ListBoxRowExt;
use gtk::Widget;
glib::wrapper! {
pub struct ListEntry(ObjectSubclass<listEntryImpl::ListEntry>)
@extends gtk::ListBoxRow, gtk::Widget,
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Actionable;
}
impl ListEntry {
pub fn new(child: &impl IsA<Widget>) -> Self {
let entry: ListEntry = Object::builder().build();
entry.set_child(Some(child));
entry
}
}

View file

@ -0,0 +1,37 @@
use gtk::{CompositeTemplate, glib};
use gtk::subclass::prelude::*;
use crate::components::base::listEntry;
#[allow(non_snake_case)]
#[derive(Default, CompositeTemplate)]
#[template(resource = "/org/Xetibo/ReSet/resetListBoxRow.ui")]
pub struct ListEntry {}
#[glib::object_subclass]
impl ObjectSubclass for ListEntry {
const NAME: &'static str = "resetListBoxRow";
type Type = listEntry::ListEntry;
type ParentType = gtk::ListBoxRow;
fn class_init(klass: &mut Self::Class) {
klass.bind_template();
}
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
obj.init_template();
}
}
impl ObjectImpl for ListEntry {
fn constructed(&self) {
self.parent_constructed();
}
}
impl ListBoxRowImpl for ListEntry {}
impl WidgetImpl for ListEntry {}
impl WindowImpl for ListEntry {}
impl ApplicationWindowImpl for ListEntry {}

View file

@ -0,0 +1,4 @@
pub mod settingBox;
pub mod settingBoxImpl;
pub mod listEntry;
pub mod listEntryImpl;

View file

@ -0,0 +1,19 @@
use crate::components::base::settingBoxImpl;
use adw::glib;
use adw::glib::{IsA, Object};
use gtk::prelude::BoxExt;
use gtk::Widget;
glib::wrapper! {
pub struct SettingBox(ObjectSubclass<settingBoxImpl::SettingBox>)
@extends gtk::Box, gtk::Widget,
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
}
impl SettingBox {
pub fn new(child: &impl IsA<Widget>) -> Self {
let entry: SettingBox = Object::builder().build();
entry.append(child);
entry
}
}

View file

@ -0,0 +1,37 @@
use gtk::{CompositeTemplate, glib};
use gtk::subclass::prelude::*;
use crate::components::base::settingBox;
#[allow(non_snake_case)]
#[derive(Default, CompositeTemplate)]
#[template(resource = "/org/Xetibo/ReSet/resetSettingBox.ui")]
pub struct SettingBox {}
#[glib::object_subclass]
impl ObjectSubclass for SettingBox {
const NAME: &'static str = "resetSetting";
type Type = settingBox::SettingBox;
type ParentType = gtk::Box;
fn class_init(klass: &mut Self::Class) {
klass.bind_template();
}
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
obj.init_template();
}
}
impl ObjectImpl for SettingBox {
fn constructed(&self) {
self.parent_constructed();
}
}
impl BoxImpl for SettingBox {}
impl WidgetImpl for SettingBox {}
impl WindowImpl for SettingBox {}
impl ApplicationWindowImpl for SettingBox {}