~julienxx/castor

castor: fix issue #9 v1 APPLIED

I added a hook into the connect_motion_notify_event of the content_view
to change its pointer. This is one of the first contributions I've made
in Rust, so please let me know anything I need to do to fix my patch.

Case Duckworth (1):
  Set TextView pointer to 'default' (Fix #9)

 src/gui.rs  | 7 +++++++
 src/main.rs | 1 +
 2 files changed, 8 insertions(+)

-- 
2.24.3
Thanks a lot! I've been searching how to do it but never found the 
solution, this is awesome!
I'm happy to help!
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~julienxx/castor/patches/10413/mbox | git am -3
Learn more about email & git

[PATCH castor 1/1] Set TextView pointer to 'default' (Fix #9) Export this patch

From: Case Duckworth <acdw@acdw.net>

---
 src/gui.rs  | 7 +++++++
 src/main.rs | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/gui.rs b/src/gui.rs
index 97e1332..719faa1 100644
--- a/src/gui.rs
+++ b/src/gui.rs
@@ -1,6 +1,8 @@
use gtk::prelude::*;
use gtk::{ApplicationWindow, Button, Entry, TextView};

use gdk::WindowExt;


pub struct Gui {
    window: ApplicationWindow,
@@ -39,6 +41,11 @@ impl Gui {
        glib::set_application_name("Castor Browser");
        self.window.set_role("Castor Browser");
        self.window.connect_delete_event(|_, _| { gtk::main_quit(); Inhibit(false) });
        self.content_view.connect_motion_notify_event(|win, _| {
            let w = gtk::TextViewExt::get_window(win, gtk::TextWindowType::Text).unwrap();
            w.set_cursor(gdk::Cursor::new_from_name(&w.get_display(), "default").as_ref());
            Inhibit(false)
        });
        self.window.show_all();
    }

diff --git a/src/main.rs b/src/main.rs
index b8158e8..93defcc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,7 @@
extern crate gio;
extern crate glib;
extern crate gtk;
extern crate gdk;
#[macro_use]
extern crate lazy_static;

-- 
2.24.3
Thanks a lot! I've been searching how to do it but never found the 
solution, this is awesome!