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 | |
| parent | 10759bb88331141b1586c9e6fa6cf6ce1683b964 (diff) | |
Remove gtk-rs front end
Diffstat (limited to 'schist_gtk4_gui')
| -rw-r--r-- | schist_gtk4_gui/Cargo.toml | 10 | ||||
| -rw-r--r-- | schist_gtk4_gui/build.rs | 7 | ||||
| -rw-r--r-- | schist_gtk4_gui/resources/css/styles.css | 1 | ||||
| -rw-r--r-- | schist_gtk4_gui/resources/css/window.css | 4 | ||||
| -rw-r--r-- | schist_gtk4_gui/resources/resources.gresource.xml | 13 | ||||
| -rw-r--r-- | schist_gtk4_gui/resources/ui/balances_histogram.ui | 28 | ||||
| -rw-r--r-- | schist_gtk4_gui/resources/ui/balances_view.ui | 28 | ||||
| -rw-r--r-- | schist_gtk4_gui/resources/ui/categories_view.ui | 10 | ||||
| -rw-r--r-- | schist_gtk4_gui/resources/ui/category_transfers_view.ui | 10 | ||||
| -rw-r--r-- | schist_gtk4_gui/resources/ui/transactions_view.ui | 10 | ||||
| -rw-r--r-- | schist_gtk4_gui/resources/ui/window.ui | 73 | ||||
| -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 |
19 files changed, 0 insertions, 606 deletions
diff --git a/schist_gtk4_gui/Cargo.toml b/schist_gtk4_gui/Cargo.toml deleted file mode 100644 index a5884cb..0000000 --- a/schist_gtk4_gui/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "schist_gtk4_gui" -version = "0.1.0" -edition = "2021" - -[dependencies] -gtk = { version = "0.9.4", package = "gtk4", features = ["v4_8"] } - -[build-dependencies] -glib-build-tools = "0.20.0" diff --git a/schist_gtk4_gui/build.rs b/schist_gtk4_gui/build.rs deleted file mode 100644 index 6c2f68b..0000000 --- a/schist_gtk4_gui/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - glib_build_tools::compile_resources( - &["resources"], - "resources/resources.gresource.xml", - "resources.gresource", - ); -} diff --git a/schist_gtk4_gui/resources/css/styles.css b/schist_gtk4_gui/resources/css/styles.css deleted file mode 100644 index b42e2df..0000000 --- a/schist_gtk4_gui/resources/css/styles.css +++ /dev/null @@ -1 +0,0 @@ -@import 'window.css'; diff --git a/schist_gtk4_gui/resources/css/window.css b/schist_gtk4_gui/resources/css/window.css deleted file mode 100644 index c07e199..0000000 --- a/schist_gtk4_gui/resources/css/window.css +++ /dev/null @@ -1,4 +0,0 @@ -.window { - background-color: #011120; - color: #e1f9ff; -} diff --git a/schist_gtk4_gui/resources/resources.gresource.xml b/schist_gtk4_gui/resources/resources.gresource.xml deleted file mode 100644 index c4b9e10..0000000 --- a/schist_gtk4_gui/resources/resources.gresource.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<gresources> - <gresource prefix="/net/joeac/schist/"> - <file compressed="true" preprocess="xml-stripblanks">ui/balances_histogram.ui</file> - <file compressed="true" preprocess="xml-stripblanks">ui/balances_view.ui</file> - <file compressed="true" preprocess="xml-stripblanks">ui/categories_view.ui</file> - <file compressed="true" preprocess="xml-stripblanks">ui/category_transfers_view.ui</file> - <file compressed="true" preprocess="xml-stripblanks">ui/transactions_view.ui</file> - <file compressed="true" preprocess="xml-stripblanks">ui/window.ui</file> - <file compressed="true">css/styles.css</file> - <file compressed="true">css/window.css</file> - </gresource> -</gresources> diff --git a/schist_gtk4_gui/resources/ui/balances_histogram.ui b/schist_gtk4_gui/resources/ui/balances_histogram.ui deleted file mode 100644 index b6306b9..0000000 --- a/schist_gtk4_gui/resources/ui/balances_histogram.ui +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<interface> - <template class="SchistBalancesHistogram" parent="GtkBox"> - <child> - <object class="GtkListBox" id="balances_list"> - <child> - <object class="GtkListBoxRow"> - <child> - <object class="GtkLabel"> - <property name="label">I am a balance</property> - </object> - </child> - </object> - </child> - - <child> - <object class="GtkListBoxRow"> - <child> - <object class="GtkLabel"> - <property name="label">I am another balance</property> - </object> - </child> - </object> - </child> - </object> - </child> - </template> -</interface> diff --git a/schist_gtk4_gui/resources/ui/balances_view.ui b/schist_gtk4_gui/resources/ui/balances_view.ui deleted file mode 100644 index a8f7d7e..0000000 --- a/schist_gtk4_gui/resources/ui/balances_view.ui +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<interface> - <template class="SchistBalancesView" parent="GtkBox"> - <child type="sidebar"> - <object class="GtkStackSidebar"> - <child> - <object class="GtkStackSwitcher"> - <property name="stack">balances_stack</property> - </object> - </child> - </object> - </child> - - <child> - <object class="GtkStack" id="balances_stack"> - <child> - <object class="GtkStackPage"> - <property name="name">overview</property> - <property name="title">Overview</property> - <property name="child"> - <object class="SchistBalancesHistogram" id="balances_histogram" /> - </property> - </object> - </child> - </object> - </child> - </template> -</interface> diff --git a/schist_gtk4_gui/resources/ui/categories_view.ui b/schist_gtk4_gui/resources/ui/categories_view.ui deleted file mode 100644 index 197fcb3..0000000 --- a/schist_gtk4_gui/resources/ui/categories_view.ui +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<interface> - <template class="SchistCategoriesView" parent="GtkBox"> - <child> - <object class="GtkLabel"> - <property name="label">Hello, categories!</property> - </object> - </child> - </template> -</interface> diff --git a/schist_gtk4_gui/resources/ui/category_transfers_view.ui b/schist_gtk4_gui/resources/ui/category_transfers_view.ui deleted file mode 100644 index 5a31335..0000000 --- a/schist_gtk4_gui/resources/ui/category_transfers_view.ui +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<interface> - <template class="SchistCategoryTransfersView" parent="GtkBox"> - <child> - <object class="GtkLabel"> - <property name="label">Hello, category transfers!</property> - </object> - </child> - </template> -</interface> diff --git a/schist_gtk4_gui/resources/ui/transactions_view.ui b/schist_gtk4_gui/resources/ui/transactions_view.ui deleted file mode 100644 index ca864f2..0000000 --- a/schist_gtk4_gui/resources/ui/transactions_view.ui +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<interface> - <template class="SchistTransactionsView" parent="GtkBox"> - <child> - <object class="GtkLabel"> - <property name="label">Hello, transactions!</property> - </object> - </child> - </template> -</interface> diff --git a/schist_gtk4_gui/resources/ui/window.ui b/schist_gtk4_gui/resources/ui/window.ui deleted file mode 100644 index 54ce2a5..0000000 --- a/schist_gtk4_gui/resources/ui/window.ui +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<interface> - <template class="SchistWindow" parent="GtkApplicationWindow"> - <property name="title">schist</property> - <property name="default-height">560</property> - <property name="default-width">1080</property> - <child type="titlebar"> - <object class="GtkHeaderBar" id="header_bar"> - <property name="title-widget"> - <object class="GtkStackSwitcher"> - <property name="stack">view_stack</property> - </object> - </property> - </object> - </child> - - <child> - <object class="GtkStack" id="view_stack"> - <child> - <object class="GtkStackPage"> - <property name="name">categories</property> - <property name="title">Categories</property> - <property name="child"> - <object - class="SchistCategoriesView" - id="categories_view" - /> - </property> - </object> - </child> - - <child> - <object class="GtkStackPage"> - <property name="name">balances</property> - <property name="title">Balances</property> - <property name="child"> - <object - class="SchistBalancesView" - id="balances_view" - /> - </property> - </object> - </child> - - <child> - <object class="GtkStackPage"> - <property name="name">transactions</property> - <property name="title">Transactions</property> - <property name="child"> - <object - class="SchistTransactionsView" - id="transactions_view" - /> - </property> - </object> - </child> - - <child> - <object class="GtkStackPage"> - <property name="name">category_transfers</property> - <property name="title">Category Transfers</property> - <property name="child"> - <object - class="SchistCategoryTransfersView" - id="category_transfers_view" - /> - </property> - </object> - </child> - </object> - </child> - </template> -</interface> 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 {} |
