Add footer buttons

This commit is contained in:
2026-06-04 00:11:04 +02:00
parent 0f4391d388
commit 799aebb49c
6 changed files with 104 additions and 12 deletions

1
assets/album.svg Normal file
View File

@@ -0,0 +1 @@
<svg width="1.375em" height="1.375em" viewBox="0 0 24 24" class="shrink-0 -scale-x-100 svelte-ztbs85" stroke="transparent" stroke-width="2" role="img" aria-hidden="true"><!----><!----><path d="M6,19L9,15.14L11.14,17.72L14.14,13.86L18,19H6M6,4H11V12L8.5,10.5L6,12M18,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V4A2,2 0 0,0 18,2Z" fill="currentColor"></path></svg>

After

Width:  |  Height:  |  Size: 374 B

1
assets/photos.svg Normal file
View File

@@ -0,0 +1 @@
<svg width="1.375em" height="1.375em" viewBox="0 0 24 24" class="shrink-0 svelte-ztbs85" stroke="transparent" stroke-width="2" role="img" aria-hidden="true"><!----><!----><path d="M22,16V4A2,2 0 0,0 20,2H8A2,2 0 0,0 6,4V16A2,2 0 0,0 8,18H20A2,2 0 0,0 22,16M11,12L13.03,14.71L16,11L20,16H8M2,6V20A2,2 0 0,0 4,22H18V20H4V6" fill="currentColor"></path></svg>

After

Width:  |  Height:  |  Size: 356 B

1
assets/search.svg Normal file
View File

@@ -0,0 +1 @@
<svg width="1.375em" height="1.375em" viewBox="0 0 24 24" class="shrink-0 svelte-ztbs85" stroke="transparent" stroke-width="2" role="img" aria-hidden="true"><!----><!----><path d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z" fill="currentColor"></path></svg>

After

Width:  |  Height:  |  Size: 473 B

View File

@@ -2,25 +2,20 @@ import { AboutSlint, Button, Palette, HorizontalBox, ScrollView } from "std-widg
import { Timeline } from "timeline.slint";
import { ImageViewer } from "image-viewer.slint";
import { LoginView } from "login.slint";
import { Header } from "header.slint";
import { Footer, FooterButton } from "footer.slint";
import { Global } from "global.slint";
export { Global }
component Header inherits Rectangle {
width: 100%;
height: 48px;
background: Palette.alternate-background;
HorizontalBox {
height: parent.height;
Text {
text: "immich";
}
}
enum View {
Timeline,
Albums
}
export component AppWindow inherits Window {
out property <length> window-height: self.height;
out property <View> view: View.Timeline;
// Do not base preferred-width on children
preferred-width: 480px;
@@ -36,7 +31,28 @@ export component AppWindow inherits Window {
Header {}
if !Global.logged-in: LoginView {}
if Global.logged-in: Timeline {}
if Global.logged-in && view == View.Timeline: Timeline {}
Footer {
FooterButton {
title: "Photos";
icon: @image-url("../assets/photos.svg");
clicked => { view = View.Timeline }
}
FooterButton {
title: "Search";
icon: @image-url("../assets/search.svg");
}
FooterButton {
title: "Album";
icon: @image-url("../assets/album.svg");
clicked => { view = View.Albums}
}
FooterButton {
title: "Library";
icon: @image-url("../assets/album.svg"); // TODO
}
}
}
if Global.viewed-image.asset-id != "" : ImageViewer {

59
ui/footer.slint Normal file
View File

@@ -0,0 +1,59 @@
import { Palette } from "std-widgets.slint";
export component FooterButton inherits Rectangle {
in property <string> title: "Button";
in property <image> icon;
callback clicked <=> touch.clicked;
states [
pressed when touch.pressed: {
background: #0000ff30;
}
hovered when touch.has-hover: {
background: #0000ff15;
}
default: {
background: #0000;
}
]
animate background {
duration: 0.1s;
easing: ease-in-out;
}
border-radius: 20px;
VerticalLayout {
padding: 10px;
padding-left: 20px;
padding-right: 20px;
Image {
source: icon;
colorize: #accbfa;
}
Text {
text: title;
horizontal-alignment: center;
}
}
touch := TouchArea {}
}
export component Footer inherits Rectangle {
width: 100%;
height: 88px;
background: Palette.alternate-background;
HorizontalLayout {
height: parent.height;
spacing: 16px;
padding-top: 8px;
padding-bottom: 16px;
padding-left: 16px;
padding-right: 16px;
@children
}
}

14
ui/header.slint Normal file
View File

@@ -0,0 +1,14 @@
import { HorizontalBox, Palette } from "std-widgets.slint";
export component Header inherits Rectangle {
width: 100%;
height: 48px;
background: Palette.alternate-background;
HorizontalBox {
height: parent.height;
Text {
text: "immich";
}
}
}