Skip to content

Commit

Permalink
[+] add refresh button for Add Panel
Browse files Browse the repository at this point in the history
  • Loading branch information
heng30 committed Apr 4, 2024
1 parent 520cfef commit 9d77018
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/version.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub static VERSION: &str = "v0.5.1";
pub static VERSION: &str = "v0.6.0";
2 changes: 1 addition & 1 deletion ui/logic.slint
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export global Logic {
callback switch-rss(string, string); // from_suuid, to_suuid
callback toggle-rss-favorite(string); // suuid
callback sync-rss(string); // suuid
callback sync-rss_all();
callback sync-rss-all();
callback get-rss-config-to-ui(string) -> RssConfig; // suuid
callback exist-rss(string) -> bool; // suuid

Expand Down
23 changes: 17 additions & 6 deletions ui/panel/bodyer/add.slint
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,29 @@ import { CheckBox, ComboBox, LineEdit } from "std-widgets.slint";
import { Theme, Icons } from "../../theme.slint";
import { Store, TabIndex, RssConfig } from "../../store.slint";
import { Logic } from "../../logic.slint";
import { CancelBtn, ConfirmBtn, Tag, IconBtn, NoMessageImg, Label, Head, SettingDetailInner, SettingDetailInnerVbox, SettingDetailLabel } from "../../base/widgets.slint";
import { CancelBtn, ConfirmBtn, Tag, IconBtn, NoMessageImg, Label, Head, SettingDetailInner, SettingDetailInnerVbox, SettingDetailLabel, CenterLayout } from "../../base/widgets.slint";

enum BtnIndex {
New,
Edit,
Delete,
}

component AHead inherits Head {
icon: Icons.add-small;
title: Logic.tr(Store.is-cn, "添加");
hbox-alignment: LayoutAlignment.space-between;

CenterLayout {
IconBtn {
icon: Icons.refresh;
icon-width: Theme.icon-size * 1.2;
background: Colors.transparent;
clicked => { Logic.sync-rss-all(); }
}
}
}

component RssList inherits Rectangle {
private property<length> item-height: 40px;
private property<color> selected-item-color: Theme.lighter-border-color;
Expand Down Expand Up @@ -281,11 +296,7 @@ component Body inherits Rectangle {
private property <BtnIndex> rss-list-btns-index: BtnIndex.New;

rsslist-vbox := VerticalLayout {
Head {
hbox-alignment: LayoutAlignment.start;
icon: Icons.add-small;
title: Logic.tr(Store.is-cn, "添加");
}
AHead { }

rsslist := RssList { }

Expand Down

0 comments on commit 9d77018

Please sign in to comment.