68 lines
1.8 KiB
Plaintext
68 lines
1.8 KiB
Plaintext
import { AboutSlint, Button, Palette, HorizontalBox, ScrollView } from "std-widgets.slint";
|
|
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";
|
|
import { Albums } from "albums.slint";
|
|
export { Global }
|
|
|
|
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;
|
|
|
|
changed width => {
|
|
Global.set-timeline-width(self.width);
|
|
}
|
|
|
|
VerticalLayout {
|
|
padding: 0px;
|
|
width: 100%;
|
|
|
|
Header {}
|
|
|
|
if !Global.logged-in: LoginView {}
|
|
if Global.logged-in && view == View.Timeline: Timeline {}
|
|
if Global.logged-in && view == View.Albums: Albums {}
|
|
|
|
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;
|
|
Global.load-albums();
|
|
}
|
|
}
|
|
FooterButton {
|
|
title: "Library";
|
|
icon: @image-url("../assets/album.svg"); // TODO
|
|
}
|
|
}
|
|
}
|
|
|
|
if Global.viewed-image.asset-id != "" : ImageViewer {
|
|
image: Global.viewed-image.image;
|
|
}
|
|
}
|
|
|