mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-06 00:14:13 +00:00
use namespaces
This commit is contained in:
parent
b5b4b359fa
commit
9b12642960
@ -3,6 +3,8 @@ mod header;
|
|||||||
mod main;
|
mod main;
|
||||||
mod widget;
|
mod widget;
|
||||||
|
|
||||||
|
use gtk::gio::ActionEntry;
|
||||||
|
use gtk::{Application, ApplicationWindow};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use gtk::prelude::{ActionMapExtManual, GtkWindowExt};
|
use gtk::prelude::{ActionMapExtManual, GtkWindowExt};
|
||||||
@ -17,8 +19,8 @@ pub struct Browser {
|
|||||||
impl Browser {
|
impl Browser {
|
||||||
// Construct new browser
|
// Construct new browser
|
||||||
pub fn new(
|
pub fn new(
|
||||||
app: >k::Application,
|
app: &Application,
|
||||||
connection: std::sync::Arc<sqlite::Connection>, // @TODO glib clone macro?
|
connection: Arc<sqlite::Connection>, // @TODO glib clone macro?
|
||||||
default_width: i32,
|
default_width: i32,
|
||||||
default_height: i32,
|
default_height: i32,
|
||||||
) -> Browser {
|
) -> Browser {
|
||||||
@ -37,17 +39,17 @@ impl Browser {
|
|||||||
|
|
||||||
// Init actions @TODO separated module
|
// Init actions @TODO separated module
|
||||||
widget.gtk().add_action_entries([
|
widget.gtk().add_action_entries([
|
||||||
gtk::gio::ActionEntry::builder("debug")
|
ActionEntry::builder("debug")
|
||||||
.activate(|this: >k::ApplicationWindow, _, _| {
|
.activate(|this: &ApplicationWindow, _, _| {
|
||||||
this.emit_enable_debugging(true);
|
this.emit_enable_debugging(true);
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
gtk::gio::ActionEntry::builder("quit")
|
ActionEntry::builder("quit")
|
||||||
.activate(|this: >k::ApplicationWindow, _, _| {
|
.activate(|this: &ApplicationWindow, _, _| {
|
||||||
this.close();
|
this.close();
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
gtk::gio::ActionEntry::builder("tab_append")
|
ActionEntry::builder("tab_append")
|
||||||
.activate({
|
.activate({
|
||||||
let main = main.clone();
|
let main = main.clone();
|
||||||
move |_, _, _| {
|
move |_, _, _| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user