Implement Driftwood AppImage manager

This commit is contained in:
2026-02-26 23:04:27 +02:00
commit c3620b487d
33 changed files with 10399 additions and 0 deletions

24
src/ui/widgets.rs Normal file
View File

@@ -0,0 +1,24 @@
use gtk::prelude::*;
/// Create a status badge pill label with the given text and style class.
/// Style classes: "success", "warning", "error", "info", "neutral"
pub fn status_badge(text: &str, style_class: &str) -> gtk::Label {
let label = gtk::Label::new(Some(text));
label.add_css_class("status-badge");
label.add_css_class(style_class);
label
}
/// Create a badge showing integration status.
pub fn integration_badge(integrated: bool) -> gtk::Label {
if integrated {
status_badge("Integrated", "success")
} else {
status_badge("Not integrated", "neutral")
}
}
/// Format bytes into a human-readable string.
pub fn format_size(bytes: i64) -> String {
humansize::format_size(bytes as u64, humansize::BINARY)
}