// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT import { Measurements, Palette } from "../common.slint"; import { AppState } from "../appState.slint"; import { HaText } from "general/haText.slint"; export component MusicPlayer inherits Rectangle { property title: "Time"; property current-page: AppState.current-page; property artist: "Pink Floyd"; property album: "Dark Side Of The Moon"; property unlocked: false; property cover-art: @image-url("../images/album.png"); property is-active: false; in property name; in property id; in property index; in property full-screen: false; Rectangle { width: 90%; height: 90%; background: black; border-radius: 30px; } tile := Rectangle { Image { x: -5px; y: 0px; source: cover-art; } VerticalLayout { alignment: stretch; spacing: 2px; padding-top: 0px; padding-bottom: 20px; VerticalLayout { alignment: start; padding-top: (tile.height > Measurements.small-height-tile) ? 18px : 9px; padding: 20px; spacing: 5px; HaText { color: white; text: title; font-size: 2rem; font-weight: 500; horizontal-alignment: right; vertical-alignment: center; } HaText { color: white; text: artist; font-size: 1rem; font-weight: 400; horizontal-alignment: right; vertical-alignment: center; } HaText { color: white; text: album; font-size: 1rem; font-weight: 400; horizontal-alignment: right; vertical-alignment: center; } } } controls := Rectangle { y: root.height - self.height - 0px; width: 95%; height: 60px; HorizontalLayout { Rectangle { Rectangle { width: 40px; height: self.width; border-radius: self.height / 2; background: white; Image { source: @image-url("../images/back.svg"); width: 18px; height: self.width; colorize: Palette.music-alternate-foreground; } } } Rectangle { height: 60px; width: self.height; Rectangle { width: 60px; height: self.width; border-radius: self.height / 2; background: white; property playing: true; Image { source: playing ? @image-url("../images/pause.svg") : @image-url("../images/play.svg"); colorize: Palette.music-alternate-foreground; } TouchArea { clicked => { playing = !playing; } } } } Rectangle { Rectangle { width: 40px; height: self.width; border-radius: self.height / 2; background: white; Image { source: @image-url("../images/fwd.svg"); width: 18px; height: self.width; colorize: Palette.music-alternate-foreground; } } } } } } }