mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-08-26 14:32:26 +00:00
Use custom libspelling
branch with the latest gtk-rs
v0.10 API, enable spelling features
This commit is contained in:
parent
be34e0bf43
commit
1ac3840e56
@ -36,8 +36,7 @@ ggemini = "0.19.0"
|
|||||||
ggemtext = "0.7.0"
|
ggemtext = "0.7.0"
|
||||||
indexmap = "2.10.0"
|
indexmap = "2.10.0"
|
||||||
itertools = "0.14.0"
|
itertools = "0.14.0"
|
||||||
# @TODO pending for glib 0.10 dependencies update
|
libspelling = "0.4.0"
|
||||||
# libspelling = "0.4.0"
|
|
||||||
maxminddb = "0.26.0"
|
maxminddb = "0.26.0"
|
||||||
openssl = "0.10.72"
|
openssl = "0.10.72"
|
||||||
plurify = "0.2.0"
|
plurify = "0.2.0"
|
||||||
@ -46,7 +45,11 @@ r2d2_sqlite = "0.31.0"
|
|||||||
syntect = "5.2.0"
|
syntect = "5.2.0"
|
||||||
|
|
||||||
# development
|
# development
|
||||||
# [patch.crates-io]
|
[patch.crates-io]
|
||||||
|
|
||||||
|
# @TODO pending for the official gtk-rs 0.10 dependencies update
|
||||||
|
libspelling = { git = "https://github.com/YGGverse/libspelling-rs.git", branch = "yoda-0.12"}
|
||||||
|
|
||||||
# ggemini = { git = "https://github.com/YGGverse/ggemini.git" }
|
# ggemini = { git = "https://github.com/YGGverse/ggemini.git" }
|
||||||
# ggemtext = { git = "https://github.com/YGGverse/ggemtext.git" }
|
# ggemtext = { git = "https://github.com/YGGverse/ggemtext.git" }
|
||||||
# plurify = { git = "https://github.com/YGGverse/plurify.git" }
|
# plurify = { git = "https://github.com/YGGverse/plurify.git" }
|
||||||
|
@ -3,7 +3,7 @@ use gtk::{
|
|||||||
glib::GString,
|
glib::GString,
|
||||||
prelude::{TextBufferExt, TextViewExt, WidgetExt},
|
prelude::{TextBufferExt, TextViewExt, WidgetExt},
|
||||||
};
|
};
|
||||||
//use libspelling::{Checker, TextBufferAdapter};
|
use libspelling::{Checker, TextBufferAdapter};
|
||||||
use sourceview::Buffer;
|
use sourceview::Buffer;
|
||||||
|
|
||||||
const MARGIN: i32 = 8;
|
const MARGIN: i32 = 8;
|
||||||
@ -22,16 +22,16 @@ impl Form for TextView {
|
|||||||
let buffer = Buffer::builder().build();
|
let buffer = Buffer::builder().build();
|
||||||
|
|
||||||
// Init [libspelling](https://gitlab.gnome.org/GNOME/libspelling)
|
// Init [libspelling](https://gitlab.gnome.org/GNOME/libspelling)
|
||||||
/*let checker = Checker::default();
|
let checker = Checker::default();
|
||||||
let adapter = TextBufferAdapter::new(&buffer, &checker);
|
let adapter = TextBufferAdapter::new(&buffer, &checker);
|
||||||
adapter.set_enabled(true);*/
|
adapter.set_enabled(true);
|
||||||
|
|
||||||
// Init main widget
|
// Init main widget
|
||||||
let text_view = TextView::builder()
|
let text_view = TextView::builder()
|
||||||
.bottom_margin(MARGIN)
|
.bottom_margin(MARGIN)
|
||||||
.buffer(&buffer)
|
.buffer(&buffer)
|
||||||
.css_classes(["frame", "view"])
|
.css_classes(["frame", "view"])
|
||||||
//.extra_menu(&adapter.menu_model())
|
.extra_menu(&adapter.menu_model())
|
||||||
.left_margin(MARGIN)
|
.left_margin(MARGIN)
|
||||||
.margin_bottom(MARGIN / 4)
|
.margin_bottom(MARGIN / 4)
|
||||||
.right_margin(MARGIN)
|
.right_margin(MARGIN)
|
||||||
@ -39,7 +39,7 @@ impl Form for TextView {
|
|||||||
.wrap_mode(WrapMode::Word)
|
.wrap_mode(WrapMode::Word)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
//text_view.insert_action_group("spelling", Some(&adapter));
|
text_view.insert_action_group("spelling", Some(&adapter));
|
||||||
text_view.set_size_request(-1, 38); // @TODO [#635](https://gitlab.gnome.org/GNOME/pygobject/-/issues/635)
|
text_view.set_size_request(-1, 38); // @TODO [#635](https://gitlab.gnome.org/GNOME/pygobject/-/issues/635)
|
||||||
|
|
||||||
// Init events
|
// Init events
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use gtk::{TextView, WrapMode, prelude::WidgetExt};
|
use gtk::{TextView, WrapMode, prelude::WidgetExt};
|
||||||
//use libspelling::{Checker, TextBufferAdapter};
|
use libspelling::{Checker, TextBufferAdapter};
|
||||||
use sourceview::Buffer;
|
use sourceview::Buffer;
|
||||||
|
|
||||||
pub trait Form {
|
pub trait Form {
|
||||||
@ -15,9 +15,9 @@ impl Form for TextView {
|
|||||||
let buffer = Buffer::builder().build();
|
let buffer = Buffer::builder().build();
|
||||||
|
|
||||||
// Init [libspelling](https://gitlab.gnome.org/GNOME/libspelling)
|
// Init [libspelling](https://gitlab.gnome.org/GNOME/libspelling)
|
||||||
/*let checker = Checker::default();
|
let checker = Checker::default();
|
||||||
let adapter = TextBufferAdapter::new(&buffer, &checker);
|
let adapter = TextBufferAdapter::new(&buffer, &checker);
|
||||||
adapter.set_enabled(true);*/
|
adapter.set_enabled(true);
|
||||||
|
|
||||||
// Init main widget
|
// Init main widget
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ impl Form for TextView {
|
|||||||
.bottom_margin(MARGIN)
|
.bottom_margin(MARGIN)
|
||||||
.buffer(&buffer)
|
.buffer(&buffer)
|
||||||
.css_classes(["frame", "view"])
|
.css_classes(["frame", "view"])
|
||||||
//.extra_menu(&adapter.menu_model())
|
.extra_menu(&adapter.menu_model())
|
||||||
.left_margin(MARGIN)
|
.left_margin(MARGIN)
|
||||||
.right_margin(MARGIN)
|
.right_margin(MARGIN)
|
||||||
.top_margin(MARGIN)
|
.top_margin(MARGIN)
|
||||||
@ -35,7 +35,7 @@ impl Form for TextView {
|
|||||||
.build()
|
.build()
|
||||||
};
|
};
|
||||||
|
|
||||||
//text_view.insert_action_group("spelling", Some(&adapter));
|
text_view.insert_action_group("spelling", Some(&adapter));
|
||||||
text_view.set_size_request(-1, 38); // @TODO [#635](https://gitlab.gnome.org/GNOME/pygobject/-/issues/635)
|
text_view.set_size_request(-1, 38); // @TODO [#635](https://gitlab.gnome.org/GNOME/pygobject/-/issues/635)
|
||||||
|
|
||||||
// Init events
|
// Init events
|
||||||
|
Loading…
x
Reference in New Issue
Block a user