remove initial message

This commit is contained in:
yggverse 2024-12-12 13:31:11 +02:00
parent 2f6059db2f
commit 8b0a95cb6e
2 changed files with 10 additions and 7 deletions

View File

@ -3,7 +3,7 @@ use gtk::{glib::SignalHandlerId, prelude::ButtonExt, Align, Button};
// Defaults
const CSS_CLASSES: [&str; 1] = ["accent"];
const LABEL: &str = "Choose";
const LABEL: &str = "Choose location..";
const MARGIN: i32 = 16;
/// Choose destination [File](https://docs.gtk.org/gio/iface.File.html)

View File

@ -6,7 +6,6 @@ const CSS_CLASSES_DEFAULT: &[&str; 0] = &[];
const CSS_CLASSES_ERROR: &[&str; 1] = &["error"];
const CSS_CLASSES_SUCCESS: &[&str; 1] = &["success"];
const CSS_CLASSES_WARNING: &[&str; 1] = &["warning"];
const LABEL: &str = "Choose location to download";
const MARGIN: i32 = 16;
/// Indicate current download state as the text
@ -21,7 +20,7 @@ impl Status {
/// Create new `Self`
pub fn new() -> Self {
Self {
label: Label::builder().label(LABEL).margin_top(MARGIN).build(),
label: Label::builder().visible(false).margin_top(MARGIN).build(),
}
}
@ -29,21 +28,25 @@ impl Status {
pub fn set_default(&self, label: &str) {
self.label.set_css_classes(CSS_CLASSES_DEFAULT);
self.label.set_label(label)
self.label.set_label(label);
self.label.set_visible(true)
}
pub fn set_error(&self, label: &str) {
self.label.set_css_classes(CSS_CLASSES_ERROR);
self.label.set_label(label)
self.label.set_label(label);
self.label.set_visible(true)
}
pub fn set_success(&self, label: &str) {
self.label.set_css_classes(CSS_CLASSES_SUCCESS);
self.label.set_label(label)
self.label.set_label(label);
self.label.set_visible(true)
}
pub fn set_warning(&self, label: &str) {
self.label.set_css_classes(CSS_CLASSES_WARNING);
self.label.set_label(label)
self.label.set_label(label);
self.label.set_visible(true)
}
}