mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-04 08:56:59 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b95cf7a05 | ||
|
|
c2e9be45de | ||
|
|
0a9bc30b72 |
No files matched your search
Generated
+6
-6
@@ -4096,7 +4096,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pstr-app"
|
name = "pstr-app"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"eframe",
|
"eframe",
|
||||||
@@ -4116,7 +4116,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pstr-cli"
|
name = "pstr-cli"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
@@ -4134,7 +4134,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pstr-core"
|
name = "pstr-core"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"directories",
|
"directories",
|
||||||
"futures",
|
"futures",
|
||||||
@@ -4152,7 +4152,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pstr-meta"
|
name = "pstr-meta"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"keyring",
|
"keyring",
|
||||||
"pstr-core",
|
"pstr-core",
|
||||||
@@ -4166,7 +4166,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pstr-player"
|
name = "pstr-player"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"libloading",
|
"libloading",
|
||||||
@@ -4180,7 +4180,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pstr-stream"
|
name = "pstr-stream"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"futures",
|
"futures",
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ members = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/narrrl/proton-stream"
|
repository = "https://github.com/narrrl/proton-stream"
|
||||||
|
|||||||
@@ -230,19 +230,22 @@ pub fn card(ui: &mut egui::Ui, card: Card<'_>) -> egui::Response {
|
|||||||
match &card.art {
|
match &card.art {
|
||||||
Some((texture, ArtShape::Landscape)) => {
|
Some((texture, ArtShape::Landscape)) => {
|
||||||
let size = texture.size_vec2();
|
let size = texture.size_vec2();
|
||||||
painter.image(
|
painter.add(
|
||||||
texture.id(),
|
egui::epaint::RectShape::filled(image_rect, radius, Color32::WHITE)
|
||||||
image_rect,
|
.with_texture(texture.id(), cover_uv(size, image_rect.size())),
|
||||||
cover_uv(size, image_rect.size()),
|
|
||||||
Color32::WHITE,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Some((texture, ArtShape::Portrait)) => {
|
Some((texture, ArtShape::Portrait)) => {
|
||||||
painter.image(
|
painter.add(
|
||||||
texture.id(),
|
egui::epaint::RectShape::filled(
|
||||||
contain_rect(texture.size_vec2(), image_rect),
|
contain_rect(texture.size_vec2(), image_rect),
|
||||||
Rect::from_min_max(egui::pos2(0.0, 0.0), egui::pos2(1.0, 1.0)),
|
radius,
|
||||||
Color32::WHITE,
|
Color32::WHITE,
|
||||||
|
)
|
||||||
|
.with_texture(
|
||||||
|
texture.id(),
|
||||||
|
Rect::from_min_max(egui::pos2(0.0, 0.0), egui::pos2(1.0, 1.0)),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
@@ -276,14 +279,38 @@ pub fn card(ui: &mut egui::Ui, card: Card<'_>) -> egui::Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(progress) = card.progress {
|
if let Some(progress) = card.progress {
|
||||||
let track = Rect::from_min_size(
|
let clip_rect = Rect::from_min_size(
|
||||||
image_rect.left_bottom() - Vec2::new(0.0, 4.0),
|
image_rect.left_bottom() - Vec2::new(0.0, 4.0),
|
||||||
Vec2::new(width, 4.0),
|
Vec2::new(width, 4.0),
|
||||||
);
|
);
|
||||||
painter.rect_filled(track, CornerRadius::ZERO, Color32::from_black_alpha(150));
|
let clipped_painter = painter.with_clip_rect(clip_rect);
|
||||||
|
|
||||||
|
let track = Rect::from_min_size(
|
||||||
|
image_rect.left_bottom() - Vec2::new(0.0, 16.0),
|
||||||
|
Vec2::new(width, 16.0),
|
||||||
|
);
|
||||||
|
let track_radius = CornerRadius {
|
||||||
|
nw: 0,
|
||||||
|
ne: 0,
|
||||||
|
sw: 8,
|
||||||
|
se: 8,
|
||||||
|
};
|
||||||
|
clipped_painter.rect_filled(track, track_radius, Color32::from_black_alpha(150));
|
||||||
|
|
||||||
let mut played = track;
|
let mut played = track;
|
||||||
played.set_width(track.width() * progress.clamp(0.0, 1.0));
|
played.set_width(track.width() * progress.clamp(0.0, 1.0));
|
||||||
theme::accent_fill(painter, played, CornerRadius::ZERO, 0.0);
|
|
||||||
|
let played_radius = CornerRadius {
|
||||||
|
nw: 0,
|
||||||
|
ne: 0,
|
||||||
|
sw: 8,
|
||||||
|
se: if played.max.x >= track.max.x - 0.1 {
|
||||||
|
8
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
},
|
||||||
|
};
|
||||||
|
theme::accent_fill(&clipped_painter, played, played_radius, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if hovered {
|
if hovered {
|
||||||
|
|||||||
@@ -230,11 +230,17 @@ fn play_pause(ui: &mut egui::Ui, playback: &Playback, actions: &mut Vec<Action>,
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
// Pause is symmetric, so it is centred the ordinary way.
|
// Pause is symmetric, so it is centred the ordinary way.
|
||||||
let (bar, height, gap) = (size * 0.09, size * 0.32, size * 0.10);
|
let bar = (size * 0.09).round();
|
||||||
for side in [-1.0f32, 1.0] {
|
let height = (size * 0.32).round();
|
||||||
let x = centre.x + side * (gap / 2.0 + bar / 2.0);
|
let gap = (size * 0.10).round();
|
||||||
|
let y = (centre.y - height / 2.0).round();
|
||||||
|
|
||||||
|
for x in [
|
||||||
|
(centre.x - gap / 2.0 - bar).round(),
|
||||||
|
(centre.x + gap / 2.0).round(),
|
||||||
|
] {
|
||||||
painter.rect_filled(
|
painter.rect_filled(
|
||||||
Rect::from_center_size(pos2(x, centre.y), Vec2::new(bar, height)),
|
Rect::from_min_size(pos2(x, y), Vec2::new(bar, height)),
|
||||||
CornerRadius::same((bar / 2.0).round() as u8),
|
CornerRadius::same((bar / 2.0).round() as u8),
|
||||||
theme::on_accent(),
|
theme::on_accent(),
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@
|
|||||||
# builds from the registry alone.
|
# builds from the registry alone.
|
||||||
|
|
||||||
pkgname=proton-stream
|
pkgname=proton-stream
|
||||||
pkgver=0.1.0
|
pkgver=0.1.1
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Netflix-style desktop client for Proton Drive public links: browse and stream a share"
|
pkgdesc="Netflix-style desktop client for Proton Drive public links: browse and stream a share"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
|
|||||||
Reference in new issue
Block a user