Skip to content

Commit

Permalink
initial prefs window
Browse files Browse the repository at this point in the history
  • Loading branch information
vhdirk committed Dec 31, 2023
1 parent 51b0e9e commit b6fa5f2
Show file tree
Hide file tree
Showing 11 changed files with 844 additions and 39 deletions.
22 changes: 0 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = "0.3"
serde = { version = "1.0.126", features = ["derive"] }
once_cell = "1.13.0"
# anyhow = "1.0.56"
# clap = { version = "4.4.11", features = ["derive", "env", "string", "unicode"] }
async-channel = "2.1.1"

glib = { git = "https://github.com/gtk-rs/gtk-rs-core", version = "0.18", branch = "0.18" }
Expand All @@ -29,7 +27,6 @@ vte = { git = "https://gitlab.gnome.org/World/Rust/vte4-rs", package = "vte4", v
async-std = "1.12.0"
shell-quote = "0.5.0"
constcat = "0.4.0"
pcre2 = {package = "pcre2-sys", version = "0.2.6" }
gsettings-macro = "0.1.20"

[build-dependencies]
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/components/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod header_bar;
mod preferences_window;
mod search_toolbar;
mod session;
mod terminal;
Expand All @@ -7,6 +8,7 @@ mod window;
mod workspace;

pub use header_bar::*;
pub use preferences_window::*;
pub use search_toolbar::*;
pub use session::*;
pub use terminal::*;
Expand Down
11 changes: 11 additions & 0 deletions src/components/preferences_window/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mod preferences_window;
use glib::subclass::prelude::*;
use preferences_window as imp;

glib::wrapper! {
pub struct PreferencesWindow(ObjectSubclass<imp::PreferencesWindow>)
@extends gtk::Widget, gtk::Window, adw::PreferencesWindow,
@implements gio::ActionGroup, gio::ActionMap; //, gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager;
}

impl PreferencesWindow {}
63 changes: 63 additions & 0 deletions src/components/preferences_window/preferences_window.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
use adw::ffi::AdwPreferencesWindow;
use adw::subclass::prelude::*;
use glib::{clone, closure_local, RustClosure};
use gtk::prelude::*;
use gtk::{gio, glib};
use panel::subclass::prelude::*;
use std::cell::RefCell;

use super::*;

// var builder = new Gtk.Builder.from_resource ("/com/raggesilver/BlackBox/gtk/tab-menu.ui");
// this.tab_view.menu_model = builder.get_object ("tab-menu") as GLib.Menu;

// this.layout_box.append (this.header_bar_revealer);
// this.layout_box.append (this.tab_view);

// this.overlay = new Gtk.Overlay ();
// this.overlay.child = this.layout_box;

// this.content = this.overlay;

// this.set_name ("blackbox-main-window");

#[derive(Debug, Default, gtk::CompositeTemplate)]
#[template(resource = "/io/github/vhdirk/Terms/gtk/preferences_window.ui")]
pub struct PreferencesWindow {}

#[glib::object_subclass]
impl ObjectSubclass for PreferencesWindow {
const NAME: &'static str = "TermsPreferencesWindow";
type Type = super::PreferencesWindow;
type ParentType = adw::PreferencesWindow;

fn class_init(klass: &mut Self::Class) {
klass.bind_template();
}

fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
obj.init_template();
}
}

impl ObjectImpl for PreferencesWindow {
fn constructed(&self) {
self.parent_constructed();

self.setup_widgets();
}
}

impl WidgetImpl for PreferencesWindow {}
impl WindowImpl for PreferencesWindow {}
impl AdwWindowImpl for PreferencesWindow {}
impl PreferencesWindowImpl for PreferencesWindow {}
// impl WorkspaceImpl for PreferencesWindow {}

impl PreferencesWindow {
fn setup_widgets(&self) {
self.connect_signals();
}

fn connect_signals(&self) {}
}
Loading

0 comments on commit b6fa5f2

Please sign in to comment.