diff options
| author | Joe Carstairs <me@joeac.net> | 2025-02-23 15:45:10 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2025-02-23 15:45:10 +0000 |
| commit | bfa9ba1f680bb9a7c2c9555d89e57a76c02f47b8 (patch) | |
| tree | 8e0e23b9ee597c1462bdf4a35041ec0c10b948cf /schist_gtk4_gui/src | |
| parent | 10759bb88331141b1586c9e6fa6cf6ce1683b964 (diff) | |
Remove gtk-rs front end
Diffstat (limited to 'schist_gtk4_gui/src')
| -rw-r--r-- | schist_gtk4_gui/src/balances_histogram.rs | 59 | ||||
| -rw-r--r-- | schist_gtk4_gui/src/balances_view.rs | 64 | ||||
| -rw-r--r-- | schist_gtk4_gui/src/categories_view.rs | 56 | ||||
| -rw-r--r-- | schist_gtk4_gui/src/category_transfers_view.rs | 56 | ||||
| -rw-r--r-- | schist_gtk4_gui/src/lib.rs | 36 | ||||
| -rw-r--r-- | schist_gtk4_gui/src/main.rs | 3 | ||||
| -rw-r--r-- | schist_gtk4_gui/src/transactions_view.rs | 56 | ||||
| -rw-r--r-- | schist_gtk4_gui/src/window.rs | 82 |
8 files changed, 0 insertions, 412 deletions
diff --git a/schist_gtk4_gui/src/balances_histogram.rs b/schist_gtk4_gui/src/balances_histogram.rs deleted file mode 100644 index d258ae4..0000000 --- a/schist_gtk4_gui/src/balances_histogram.rs +++ /dev/null @@ -1,59 +0,0 @@ -use gtk::{ - glib::{ - self, - subclass::{ - object::{ObjectImpl, ObjectImplExt}, - types::ObjectSubclass, - InitializingObject, - }, - Object, - }, - subclass::{box_::BoxImpl, widget::{ - CompositeTemplateClass, CompositeTemplateInitializingExt, WidgetClassExt, WidgetImpl, - }}, - TemplateChild, -}; - -glib::wrapper! { - pub struct SchistBalancesHistogram(ObjectSubclass<SchistBalancesHistogramImpl>) - @extends gtk::Box, gtk::Widget, - @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; -} - -impl SchistBalancesHistogram { - pub fn new() -> Self { - Object::builder().build() - } -} - -#[derive(gtk::CompositeTemplate, Default)] -#[template(resource = "/net/joeac/schist/ui/balances_histogram.ui")] -pub struct SchistBalancesHistogramImpl { - #[template_child] - balances_list: TemplateChild<gtk::ListBox>, -} - -#[glib::object_subclass] -impl ObjectSubclass for SchistBalancesHistogramImpl { - const NAME: &'static str = "SchistBalancesHistogram"; - type Type = SchistBalancesHistogram; - type ParentType = gtk::Box; - - fn class_init(klass: &mut Self::Class) { - klass.bind_template(); - } - - fn instance_init(obj: &InitializingObject<Self>) { - obj.init_template(); - } -} - -impl ObjectImpl for SchistBalancesHistogramImpl { - fn constructed(&self) { - self.parent_constructed(); - } -} - -impl WidgetImpl for SchistBalancesHistogramImpl {} - -impl BoxImpl for SchistBalancesHistogramImpl {} diff --git a/schist_gtk4_gui/src/balances_view.rs b/schist_gtk4_gui/src/balances_view.rs deleted file mode 100644 index 28dfba1..0000000 --- a/schist_gtk4_gui/src/balances_view.rs +++ /dev/null @@ -1,64 +0,0 @@ -use gtk::{ - glib::{ - self, - subclass::{ - object::{ObjectImpl, ObjectImplExt}, - types::ObjectSubclass, - InitializingObject, - }, - Object, - }, - subclass::{ - box_::BoxImpl, - widget::{ - CompositeTemplateClass, CompositeTemplateInitializingExt, WidgetClassExt, WidgetImpl, - }, - }, - TemplateChild, -}; - -use crate::balances_histogram::SchistBalancesHistogram; - -glib::wrapper! { - pub struct SchistBalancesView(ObjectSubclass<SchistBalancesViewImpl>) - @extends gtk::Box, gtk::Widget, - @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable; -} - -impl SchistBalancesView { - pub fn new() -> Self { - Object::builder().build() - } -} - -#[derive(gtk::CompositeTemplate, Default)] -#[template(resource = "/net/joeac/schist/ui/balances_view.ui")] -pub struct SchistBalancesViewImpl { - #[template_child] - balances_histogram: TemplateChild<SchistBalancesHistogram>, -} - -#[glib::object_subclass] -impl ObjectSubclass for SchistBalancesViewImpl { - const NAME: &'static str = "SchistBalancesView"; - type Type = SchistBalancesView; - type ParentType = gtk::Box; - - fn class_init(klass: &mut Self::Class) { - klass.bind_template(); - } - - fn instance_init(obj: &InitializingObject<Self>) { - obj.init_template(); - } -} - -impl ObjectImpl for SchistBalancesViewImpl { - fn constructed(&self) { - self.parent_constructed(); - } -} - -impl WidgetImpl for SchistBalancesViewImpl {} - -impl BoxImpl for SchistBalancesViewImpl {} diff --git a/schist_gtk4_gui/src/categories_view.rs b/schist_gtk4_gui/src/categories_view.rs deleted file mode 100644 index efad621..0000000 --- a/schist_gtk4_gui/src/categories_view.rs +++ /dev/null @@ -1,56 +0,0 @@ -use gtk::{ - glib::{ - self, - subclass::{ - object::{ObjectImpl, ObjectImplExt}, - types::ObjectSubclass, - InitializingObject, - }, - Object, - }, - subclass::{ - box_::BoxImpl, - widget::{CompositeTemplateClass, CompositeTemplateInitializingExt, WidgetImpl}, - }, -}; - -glib::wrapper! { - pub struct SchistCategoriesView(ObjectSubclass<SchistCategoriesViewImpl>) - @extends gtk::Box, gtk::Widget, - @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable; -} - -impl SchistCategoriesView { - pub fn new() -> Self { - Object::builder().build() - } -} - -#[derive(gtk::CompositeTemplate, Default)] -#[template(resource = "/net/joeac/schist/ui/categories_view.ui")] -pub struct SchistCategoriesViewImpl {} - -#[glib::object_subclass] -impl ObjectSubclass for SchistCategoriesViewImpl { - const NAME: &'static str = "SchistCategoriesView"; - type Type = SchistCategoriesView; - type ParentType = gtk::Box; - - fn class_init(klass: &mut Self::Class) { - klass.bind_template(); - } - - fn instance_init(obj: &InitializingObject<Self>) { - obj.init_template(); - } -} - -impl ObjectImpl for SchistCategoriesViewImpl { - fn constructed(&self) { - self.parent_constructed(); - } -} - -impl WidgetImpl for SchistCategoriesViewImpl {} - -impl BoxImpl for SchistCategoriesViewImpl {} diff --git a/schist_gtk4_gui/src/category_transfers_view.rs b/schist_gtk4_gui/src/category_transfers_view.rs deleted file mode 100644 index 286a20c..0000000 --- a/schist_gtk4_gui/src/category_transfers_view.rs +++ /dev/null @@ -1,56 +0,0 @@ -use gtk::{ - glib::{ - self, - subclass::{ - object::{ObjectImpl, ObjectImplExt}, - types::ObjectSubclass, - InitializingObject, - }, - Object, - }, - subclass::{ - box_::BoxImpl, - widget::{CompositeTemplateClass, CompositeTemplateInitializingExt, WidgetImpl}, - }, -}; - -glib::wrapper! { - pub struct SchistCategoryTransfersView(ObjectSubclass<SchistCategoryTransfersViewImpl>) - @extends gtk::Box, gtk::Widget, - @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable; -} - -impl SchistCategoryTransfersView { - pub fn new() -> Self { - Object::builder().build() - } -} - -#[derive(gtk::CompositeTemplate, Default)] -#[template(resource = "/net/joeac/schist/ui/category_transfers_view.ui")] -pub struct SchistCategoryTransfersViewImpl {} - -#[glib::object_subclass] -impl ObjectSubclass for SchistCategoryTransfersViewImpl { - const NAME: &'static str = "SchistCategoryTransfersView"; - type Type = SchistCategoryTransfersView; - type ParentType = gtk::Box; - - fn class_init(klass: &mut Self::Class) { - klass.bind_template(); - } - - fn instance_init(obj: &InitializingObject<Self>) { - obj.init_template(); - } -} - -impl ObjectImpl for SchistCategoryTransfersViewImpl { - fn constructed(&self) { - self.parent_constructed(); - } -} - -impl WidgetImpl for SchistCategoryTransfersViewImpl {} - -impl BoxImpl for SchistCategoryTransfersViewImpl {} diff --git a/schist_gtk4_gui/src/lib.rs b/schist_gtk4_gui/src/lib.rs deleted file mode 100644 index d418ba0..0000000 --- a/schist_gtk4_gui/src/lib.rs +++ /dev/null @@ -1,36 +0,0 @@ -mod balances_histogram; -mod balances_view; -mod categories_view; -mod category_transfers_view; -mod transactions_view; -mod window; - -use gtk::{gdk::Display, gio, glib, prelude::*, Application, CssProvider}; - -const APP_ID: &str = "net.joeac.schist"; - -pub fn run() -> glib::ExitCode { - gio::resources_register_include!("resources.gresource") - .expect("failed to register resources"); - - let app = Application::builder().application_id(APP_ID).build(); - app.connect_startup(|_| load_css()); - app.connect_activate(build_window); - app.run() -} - -fn build_window(app: &Application) { - let window = window::SchistWindow::new(app); - window.present() -} - -fn load_css() { - let css_provider = CssProvider::new(); - css_provider.load_from_resource("/net/joeac/schist/css/styles.css"); - - gtk::style_context_add_provider_for_display( - &Display::default().expect("failed to connect to a display"), - &css_provider, - gtk::STYLE_PROVIDER_PRIORITY_APPLICATION, - ); -} diff --git a/schist_gtk4_gui/src/main.rs b/schist_gtk4_gui/src/main.rs deleted file mode 100644 index dc9cfb8..0000000 --- a/schist_gtk4_gui/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() -> gtk::glib::ExitCode { - schist_gtk4_gui::run() -} diff --git a/schist_gtk4_gui/src/transactions_view.rs b/schist_gtk4_gui/src/transactions_view.rs deleted file mode 100644 index 39a2a98..0000000 --- a/schist_gtk4_gui/src/transactions_view.rs +++ /dev/null @@ -1,56 +0,0 @@ -use gtk::{ - glib::{ - self, - subclass::{ - object::{ObjectImpl, ObjectImplExt}, - types::ObjectSubclass, - InitializingObject, - }, - Object, - }, - subclass::{ - box_::BoxImpl, - widget::{CompositeTemplateClass, CompositeTemplateInitializingExt, WidgetImpl}, - }, -}; - -glib::wrapper! { - pub struct SchistTransactionsView(ObjectSubclass<SchistTransactionsViewImpl>) - @extends gtk::Box, gtk::Widget, - @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable; -} - -impl SchistTransactionsView { - pub fn new() -> Self { - Object::builder().build() - } -} - -#[derive(gtk::CompositeTemplate, Default)] -#[template(resource = "/net/joeac/schist/ui/transactions_view.ui")] -pub struct SchistTransactionsViewImpl {} - -#[glib::object_subclass] -impl ObjectSubclass for SchistTransactionsViewImpl { - const NAME: &'static str = "SchistTransactionsView"; - type Type = SchistTransactionsView; - type ParentType = gtk::Box; - - fn class_init(klass: &mut Self::Class) { - klass.bind_template(); - } - - fn instance_init(obj: &InitializingObject<Self>) { - obj.init_template(); - } -} - -impl ObjectImpl for SchistTransactionsViewImpl { - fn constructed(&self) { - self.parent_constructed(); - } -} - -impl WidgetImpl for SchistTransactionsViewImpl {} - -impl BoxImpl for SchistTransactionsViewImpl {} diff --git a/schist_gtk4_gui/src/window.rs b/schist_gtk4_gui/src/window.rs deleted file mode 100644 index b3cea35..0000000 --- a/schist_gtk4_gui/src/window.rs +++ /dev/null @@ -1,82 +0,0 @@ -use gtk::{ - gio, - glib::{ - self, - object::IsA, - subclass::{ - object::{ObjectImpl, ObjectImplExt}, - types::ObjectSubclass, - InitializingObject, - }, - }, - subclass::{ - application_window::ApplicationWindowImpl, - widget::{ - CompositeTemplateClass, CompositeTemplateInitializingExt, WidgetClassExt, WidgetImpl, - }, - window::WindowImpl, - }, - TemplateChild, -}; - -use crate::{ - balances_view::SchistBalancesView, categories_view::SchistCategoriesView, - category_transfers_view::SchistCategoryTransfersView, - transactions_view::SchistTransactionsView, -}; - -gtk::glib::wrapper! { - pub struct SchistWindow(ObjectSubclass<SchistWindowSubclass>) - @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 SchistWindow { - pub fn new<A: IsA<gtk::Application>>(app: &A) -> Self { - glib::Object::builder().property("application", app).build() - } -} - -#[derive(gtk::CompositeTemplate, Default)] -#[template(resource = "/net/joeac/schist/ui/window.ui")] -pub struct SchistWindowSubclass { - #[template_child] - pub balances_view: TemplateChild<SchistBalancesView>, - - #[template_child] - pub categories_view: TemplateChild<SchistCategoriesView>, - - #[template_child] - pub category_transfers_view: TemplateChild<SchistCategoryTransfersView>, - - #[template_child] - pub transactions_view: TemplateChild<SchistTransactionsView>, -} - -#[glib::object_subclass] -impl ObjectSubclass for SchistWindowSubclass { - const NAME: &'static str = "SchistWindow"; - type Type = SchistWindow; - 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 SchistWindowSubclass { - fn constructed(&self) { - self.parent_constructed(); - } -} - -impl WidgetImpl for SchistWindowSubclass {} - -impl WindowImpl for SchistWindowSubclass {} - -impl ApplicationWindowImpl for SchistWindowSubclass {} |
