Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
[*] Improve UI
Browse files Browse the repository at this point in the history
  • Loading branch information
heng30 committed Sep 30, 2023
1 parent 14dcb2e commit 86b4472
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
18 changes: 8 additions & 10 deletions rssbox/ui/base/tab-btn.slint
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export component TabBtn inherits Rectangle {
VerticalLayout {
alignment: center;
img := Image {
height: txt.font-size;
height: Theme.icon-size;
width: self.height;
colorize: root.item-color;

Expand All @@ -30,16 +30,14 @@ export component TabBtn inherits Rectangle {
}
}

VerticalLayout {
alignment: center;
txt := Text {
color: root.item-color;
font-size: Theme.default-font-size;
txt := Text {
vertical-alignment: center;
color: root.item-color;
font-size: Theme.default-font-size;

animate color {
duration: Theme.default-animate-duration;
easing: ease-in-out;
}
animate color {
duration: Theme.default-animate-duration;
easing: ease-in-out;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rssbox/ui/dialog/setting/ui.slint
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export component UI inherits VerticalLayout {
}

font-size-spin-box := SpinBox {
minimum: 15;
minimum: 10;
maximum: 50;
}
}
Expand Down
33 changes: 21 additions & 12 deletions rssbox/ui/leftPanel/header.slint
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
import { Theme } from "../theme.slint";
import { Store } from "../store.slint";
import { Logic } from "../logic.slint";
import { TabBtn } from "../base/tab-btn.slint";
import { IconBtn } from "../base/icon-btn.slint";

export component Header inherits HorizontalLayout {
export component Header inherits Rectangle {
height: Theme.header-height;
alignment: space-around;

TabBtn {
text-color: Theme.regular-text-color;
function anchor-pos-x(index: int) -> length {
return Theme.padding + index * Theme.icon-size + Theme.spacing * 2 * index;
}

IconBtn {
x: anchor-pos-x(0);
z: 2;
tip-pos: "right";
tip-text: Store.translator.new;
icon: @image-url("../images/add.svg");
text: Store.translator.new;
clicked => {
Logic.reset-rss-dialog();
Store.rss-dialog-setting.handle-type = "rss-add";
Store.rss-dialog-setting.show = true;
}
}
TabBtn {
text-color: Theme.regular-text-color;
IconBtn {
x: anchor-pos-x(1);
z: 1;
tip-pos: "right";
tip-text: Store.translator.edit;
icon: @image-url("../images/edit-text.svg");
text: Store.translator.edit;
clicked => {
Logic.set-rss-dialog(Store.current-rss-uuid);
Store.rss-dialog-setting.handle-type = "rss-edit";
Store.rss-dialog-setting.show = true;
}
}
TabBtn {
text-color: Theme.regular-text-color;
IconBtn {
x: anchor-pos-x(2);
z: 0;
tip-pos: "right";
tip-text: Store.translator.delete;
icon: @image-url("../images/delete-light.svg");
text: Store.translator.delete;
clicked => {
Store.ok-cancel-dialog-setting.title-type = "warning";
Store.ok-cancel-dialog-setting.title-text = Store.translator.warning;
Expand Down

0 comments on commit 86b4472

Please sign in to comment.