From 297e54b2c173089d0c71ae52eb5a8fe58b6b0f96 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 4 Dec 2024 05:01:55 +0200 Subject: [PATCH] replace features with adw 1.5 (support ubuntu 24.04 lts) --- Cargo.toml | 2 +- README.md | 2 +- .../browser/window/tab/item/page/content/status/loading.rs | 3 ++- .../window/tab/item/page/content/text/gemini/reader.rs | 4 ++-- .../window/tab/item/page/input/sensitive/form/widget.rs | 5 +++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 330312b4..828ef098 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/YGGverse/Yoda" [dependencies.adw] package = "libadwaita" version = "0.7.0" -features = ["v1_6"] +features = ["v1_5"] [dependencies.gemini] package = "ggemini" diff --git a/README.md b/README.md index b2bf0bb1..1cb1eab5 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ GTK 4 / Libadwaita client written in Rust * Gio `2.82` * Glib `2.56` * GTK `4.16` -* Libadwaita `1.6` (Ubuntu 24.10+) +* Libadwaita `1.5` (Ubuntu 24.04+) Use [rustup](https://rustup.rs) installer to setup latest Rust compiler and Cargo package manager: diff --git a/src/app/browser/window/tab/item/page/content/status/loading.rs b/src/app/browser/window/tab/item/page/content/status/loading.rs index cd36c934..a6520748 100644 --- a/src/app/browser/window/tab/item/page/content/status/loading.rs +++ b/src/app/browser/window/tab/item/page/content/status/loading.rs @@ -1,7 +1,8 @@ -use adw::{Spinner, StatusPage}; +use adw::StatusPage; use gtk::{ glib::{timeout_add_local, ControlFlow}, prelude::WidgetExt, + Spinner, // use adw::Spinner; @TODO adw 1.6 / ubuntu 24.10+ }; use std::time::Duration; diff --git a/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs b/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs index fc267997..8eda05cf 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs @@ -11,7 +11,6 @@ use widget::Widget; use crate::app::browser::window::{ action::Position, tab::item::Action as TabAction, Action as WindowAction, }; -use adw::StyleManager; use gemtext::line::{ code::{Inline, Multiline}, header::{Header, Level}, @@ -224,7 +223,8 @@ impl Reader { // Create new tag for new link let a = TextTag::builder() - .foreground_rgba(&StyleManager::default().accent_color_rgba()) // @TODO + .foreground("#3584e4") + // .foreground_rgba(&adw::StyleManager::default().accent_color_rgba()) @TODO adw 1.6 / ubuntu 24.10+ .sentence(true) .wrap_mode(WrapMode::Word) .build(); diff --git a/src/app/browser/window/tab/item/page/input/sensitive/form/widget.rs b/src/app/browser/window/tab/item/page/input/sensitive/form/widget.rs index 123abbac..d8a3d758 100644 --- a/src/app/browser/window/tab/item/page/input/sensitive/form/widget.rs +++ b/src/app/browser/window/tab/item/page/input/sensitive/form/widget.rs @@ -14,7 +14,7 @@ pub struct Widget { impl Widget { // Construct - pub fn new(action_send: SimpleAction, title: Option<&str>, max_length: Option) -> Self { + pub fn new(action_send: SimpleAction, title: Option<&str>, _max_length: Option) -> Self { // Init gobject let gobject = PasswordEntryRow::builder().show_apply_button(true).build(); @@ -22,9 +22,10 @@ impl Widget { gobject.set_title(value); } + /* @TODO adw 1.6 / ubuntu 24.10+ if let Some(value) = max_length { gobject.set_max_length(value); - } + } */ // Init events gobject.connect_apply(move |_| {