rework to work with latest iced

This commit is contained in:
Gabriel 2025-05-14 23:01:06 -04:00
parent ca139525a2
commit 9975448ab6
3 changed files with 8 additions and 11 deletions

View file

@ -6,8 +6,6 @@ It's got a long way to go, but I'm optimistic.
For now it uses hardcoded URLs while I work on the UI.
I don't consider this even usable yet, so please consider looking elsewhere until I have more features built.
![A fancy gif showing off the tool](current-status.webp)
## Building a great RSS Desktop Client
At minimum I need to build a functionally complete RSS reader which will include:

View file

@ -20,11 +20,12 @@ const feeds_table_create: &str = "CREATE TABLE IF NOT EXISTS 'feeds' (
'title' TEXT NOT NULL,
'description' TEXT,
'icon' BLOB,
'url' text not null unique on conflict replace,
'url' text not null unique on conflict ignore,
'subscribed' INTEGER,
'last_updated' TEXT ,
PRIMARY KEY('feedID')
);";
const feeds_index_create: &str = "CREATE INDEX IF NOT EXISTS 'subscribed_feeds_idx' ON 'feeds' (
'feedID' ASC
) WHERE 'subscribed' = 1;";
@ -32,7 +33,7 @@ const items_table_create: &str = "CREATE TABLE IF NOT EXISTS 'items' (
'itemID' INTEGER NOT NULL,
'title' TEXT NOT NULL,
'icon' BLOB,
'url' text not null unique on conflict replace,
'url' text not null unique on conflict ignore,
'description' TEXT,
'content' TEXT,
'read' INTEGER DEFAULT 0,
@ -59,7 +60,6 @@ pub fn add_feed(url: &str) {
[feed.title,url.to_owned(),feed.description]).unwrap();
conn.close();
store_items(new_feed);
//defaulting to Libre Solutions
}
@ -78,7 +78,7 @@ pub fn store_items(feed: rss::Channel) {
pub fn return_item() -> String{
let conn = Connection::open(DB_LOCATION).unwrap();
let item = conn.query_row("select title,content from items where rowid=?1",[1],|row|{
let item = conn.query_row("select title,content from items where rowid=?1",[488],|row|{
Ok(
Item { title: row.get(0).unwrap(), content: row.get(1).unwrap() }
)

View file

@ -17,9 +17,8 @@ iced::application("Really Sweet Stuff",State::update,State::view)
}*/
pub fn main() -> iced::Result{
db::initialize();
db::add_feed("https://libresolutions.network/archive/index.xml");
iced::application("Really Sweet Stuff",Viewer::update,Viewer::view)
.run()
//db::add_feed("https://gabe.rocks/rss");
iced::run(Viewer::update,Viewer::view)
}
@ -49,8 +48,8 @@ impl Viewer{
widget::scrollable(
markdown::view(
&self.content,
markdown::Settings::default(),
markdown::Style::from_palette(iced::Theme::Dark.palette())
markdown::Settings::with_style(markdown::Style::from_palette(iced::Theme::Dark.palette())),
).map(Changes::Nullchange))
)
.align_x(iced::alignment::Horizontal::Center)