Skip to content

Commit 0418f47

Browse files
authored
Merge pull request #57 from ranfdev/update_deps
Update deps
2 parents 0eae295 + 8d6634e commit 0418f47

File tree

11 files changed

+347
-306
lines changed

11 files changed

+347
-306
lines changed

Cargo.lock

Lines changed: 266 additions & 190 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2021"
1010

1111
[dependencies.gtk]
1212
package = "gtk4"
13-
git = "https://github.com/gtk-rs/gtk4-rs.git"
13+
version = "0.6"
1414
features = ["v4_8"]
1515

1616
[dependencies]
@@ -28,13 +28,4 @@ toml = "0.5.6"
2828
serde = { version = "1.0.116", features = ["derive"] }
2929
env_logger = "0.8.1"
3030
log = "0.4.0"
31-
adw = { package = "libadwaita", git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs.git", features = ["v1_2"]}
32-
33-
[patch."https://github.com/gtk-rs/gtk-rs-core.git"]
34-
glib = {git = "https://github.com/ranfdev/gtk-rs-core.git", branch = "props_macro"}
35-
gio = {git = "https://github.com/ranfdev/gtk-rs-core.git", branch = "props_macro"}
36-
pango = {git = "https://github.com/ranfdev/gtk-rs-core.git", branch = "props_macro"}
37-
glib-sys = {git = "https://github.com/ranfdev/gtk-rs-core.git", branch = "props_macro"}
38-
gobject-sys = {git = "https://github.com/ranfdev/gtk-rs-core.git", branch = "props_macro"}
39-
gio-sys = {git = "https://github.com/ranfdev/gtk-rs-core.git", branch = "props_macro"}
40-
pango-sys = {git = "https://github.com/ranfdev/gtk-rs-core.git", branch = "props_macro"}
31+
adw = { package = "libadwaita", version = "0.3", features = ["v1_2"]}

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/geopard.nix

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ stdenv.mkDerivation rec {
2828

2929
cargoDeps = rustPlatform.importCargoLock {
3030
lockFile = ../Cargo.lock;
31-
outputHashes = {
32-
"cairo-rs-0.16.0" = "sha256-cqWL8PKmakObkHZWFtfLQtMKKBfSPQNvqLFkh0JaBGY=";
33-
"gdk4-0.5.0" = "sha256-ICUZ8Y/4D4iAzZosusZL2sB/EXGkWarWk5ZIW84crg4=";
34-
"gio-0.16.0" = "sha256-34RcAmMozLAqrGPalGvyBdtTwurcoYs2VKtNenDOK3E=";
35-
"libadwaita-0.2.0" = "sha256-47GmghKbdaK+5F7GeeMEczDqMP3X+daHY2UEhmC5Qtc=";
36-
};
3731
};
3832

3933
src = ../.;

src/lossy_text_read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use futures::prelude::*;
55

66
#[async_trait(?Send)]
77
pub trait LossyTextRead {
8-
async fn read_line_lossy(&mut self, mut buf: &mut String) -> std::io::Result<usize>;
8+
async fn read_line_lossy(&mut self, buf: &mut String) -> std::io::Result<usize>;
99
}
1010

1111
#[async_trait(?Send)]

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,5 @@ fn main() {
119119
application.set_accels_for_action("win.reset-zoom", &["<Ctrl>0"]);
120120
// FIXME: win.view-source
121121
let ret = application.run();
122-
std::process::exit(ret);
122+
std::process::exit(ret.into());
123123
}

src/widgets/pages/download.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use gtk::prelude::*;
21
use gtk::subclass::prelude::*;
32
use gtk::{glib, CompositeTemplate, TemplateChild};
43

@@ -45,7 +44,7 @@ glib::wrapper! {
4544

4645
impl Download {
4746
pub fn new() -> Self {
48-
glib::Object::new(&[]).unwrap()
47+
glib::Object::new()
4948
}
5049
}
5150
impl Default for Download {

src/widgets/pages/hypertext.rs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl Surface {
134134
tag_table
135135
}
136136
fn create_tag(name: &str, config: &crate::config::Font) -> gtk::TextTag {
137-
gtk::builders::TextTagBuilder::new()
137+
gtk::TextTag::builder()
138138
.family(&config.family)
139139
.weight(config.weight)
140140
.name(name)
@@ -182,17 +182,11 @@ pub mod imp {
182182
fn properties() -> &'static [glib::ParamSpec] {
183183
Self::derived_properties()
184184
}
185-
fn set_property(
186-
&self,
187-
obj: &Self::Type,
188-
id: usize,
189-
value: &glib::Value,
190-
pspec: &glib::ParamSpec,
191-
) {
192-
Self::derived_set_property(self, obj, id, value, pspec).unwrap()
185+
fn set_property(&self, id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
186+
Self::derived_set_property(self, id, value, pspec)
193187
}
194-
fn property(&self, obj: &Self::Type, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
195-
Self::derived_property(self, obj, id, pspec).unwrap()
188+
fn property(&self, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
189+
Self::derived_property(self, id, pspec)
196190
}
197191
fn signals() -> &'static [glib::subclass::Signal] {
198192
static SIGNALS: Lazy<Vec<glib::subclass::Signal>> = Lazy::new(|| {
@@ -227,25 +221,21 @@ glib::wrapper! {
227221
}
228222
impl Default for Hypertext {
229223
fn default() -> Self {
230-
glib::Object::new(&[]).unwrap()
224+
glib::Object::new()
231225
}
232226
}
233227
impl Hypertext {
234228
pub fn new(url: String, surface: Surface) -> Self {
235229
let text_view = surface.text_view.clone();
236230

237-
let this: Self = glib::Object::new(&[]).unwrap();
231+
let this: Self = glib::Object::new();
238232
this.imp().url.replace(url);
239233
this.imp().surface.replace(Some(surface));
240234

241235
let left_click_ctrl = gtk::GestureClick::builder().button(1).build();
242236
let right_click_ctrl = gtk::GestureClick::builder().button(3).build();
243237
let motion_ctrl = gtk::EventControllerMotion::new();
244238

245-
text_view.add_controller(&left_click_ctrl);
246-
text_view.add_controller(&right_click_ctrl);
247-
text_view.add_controller(&motion_ctrl);
248-
249239
left_click_ctrl.connect_released(
250240
clone!(@strong this => @default-panic, move |ctrl, _n_press, x, y| {
251241
if let Err(e) = this.handle_click(ctrl, x, y) {
@@ -266,6 +256,10 @@ impl Hypertext {
266256
let _ = this.handle_motion(x, y);
267257
}));
268258

259+
text_view.add_controller(left_click_ctrl);
260+
text_view.add_controller(right_click_ctrl);
261+
text_view.add_controller(motion_ctrl);
262+
269263
this
270264
}
271265
pub fn render<'e>(
@@ -506,7 +500,7 @@ impl Hypertext {
506500
};
507501

508502
imp.hover_url.replace(link_ref.to_owned());
509-
self.emit_hover_url();
503+
self.notify_hover_url();
510504
Ok(())
511505
}
512506
}

src/widgets/pages/input.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use gtk::prelude::*;
21
use gtk::subclass::prelude::*;
32
use gtk::{glib, CompositeTemplate, TemplateChild};
43

@@ -41,7 +40,7 @@ glib::wrapper! {
4140

4241
impl Input {
4342
pub fn new() -> Self {
44-
glib::Object::new(&[]).unwrap()
43+
glib::Object::new()
4544
}
4645
}
4746
impl Default for Input {

src/widgets/tab.rs

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ pub mod imp {
124124
}
125125

126126
impl ObjectImpl for Tab {
127-
fn constructed(&self, obj: &Self::Type) {
128-
self.parent_constructed(obj);
127+
fn constructed(&self) {
128+
self.parent_constructed();
129129

130130
self.gemini_client
131131
.replace(gemini::ClientBuilder::new().redirect(true).build());
@@ -141,18 +141,12 @@ pub mod imp {
141141
Self::derived_properties()
142142
}
143143

144-
fn set_property(
145-
&self,
146-
obj: &Self::Type,
147-
id: usize,
148-
value: &glib::Value,
149-
pspec: &glib::ParamSpec,
150-
) {
151-
self.derived_set_property(obj, id, value, pspec).unwrap()
144+
fn set_property(&self, id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
145+
self.derived_set_property(id, value, pspec)
152146
}
153147

154-
fn property(&self, obj: &Self::Type, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
155-
self.derived_property(obj, id, pspec).unwrap()
148+
fn property(&self, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
149+
self.derived_property(id, pspec)
156150
}
157151
}
158152
impl Tab {
@@ -174,7 +168,7 @@ glib::wrapper! {
174168

175169
impl Tab {
176170
pub fn new(config: crate::config::Config) -> Self {
177-
let this: Self = glib::Object::new(&[]).unwrap();
171+
let this: Self = glib::Object::new();
178172
let imp = this.imp();
179173

180174
imp.config.replace(config);
@@ -222,14 +216,14 @@ impl Tab {
222216
imp.history.borrow_mut().push(item);
223217
}
224218

225-
self.emit_history_status();
219+
self.notify_history_status();
226220
self.log_history_position();
227221
imp.history.borrow().index().unwrap()
228222
}
229223
fn clear_stack_widgets(&self) {
230224
let imp = self.imp();
231225
let pages = imp.stack.pages();
232-
let mut iter = pages.iter::<gtk::StackPage>().unwrap();
226+
let mut iter = pages.iter::<gtk::StackPage>();
233227
let first_page = iter.next().unwrap().unwrap();
234228
imp.stack.set_visible_child(&first_page.child());
235229
for page in iter.skip(1) {
@@ -247,9 +241,9 @@ impl Tab {
247241

248242
self.set_progress(0.0);
249243
*imp.title.borrow_mut() = url.to_string();
250-
self.emit_title();
244+
self.notify_title();
251245
*imp.url.borrow_mut() = url.to_string();
252-
self.emit_url();
246+
self.notify_url();
253247

254248
let this = self.clone();
255249
let fut = async move {
@@ -286,13 +280,13 @@ impl Tab {
286280
let imp = self.imp();
287281

288282
imp.progress.set(0.0);
289-
self.emit_progress();
283+
self.notify_progress();
290284

291285
*imp.title.borrow_mut() = url.to_string();
292-
self.emit_title();
286+
self.notify_title();
293287

294288
*imp.url.borrow_mut() = url.to_string();
295-
self.emit_url();
289+
self.notify_url();
296290

297291
let this = self.clone();
298292
async move {
@@ -687,7 +681,7 @@ impl Tab {
687681
self.spawn_request(
688682
self.open_history(self.imp().history.borrow().current().unwrap().clone()),
689683
);
690-
self.emit_history_status();
684+
self.notify_history_status();
691685
}
692686
moved
693687
}

0 commit comments

Comments
 (0)