From 8b0a95cb6e9cb5308db773b71089951e61d332c7 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 12 Dec 2024 13:31:11 +0200 Subject: [PATCH] remove initial message --- .../item/page/content/status/download/choose.rs | 2 +- .../item/page/content/status/download/status.rs | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/browser/window/tab/item/page/content/status/download/choose.rs b/src/app/browser/window/tab/item/page/content/status/download/choose.rs index f2bbcd0b..c8f580ee 100644 --- a/src/app/browser/window/tab/item/page/content/status/download/choose.rs +++ b/src/app/browser/window/tab/item/page/content/status/download/choose.rs @@ -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) diff --git a/src/app/browser/window/tab/item/page/content/status/download/status.rs b/src/app/browser/window/tab/item/page/content/status/download/status.rs index 46a602c9..68489c78 100644 --- a/src/app/browser/window/tab/item/page/content/status/download/status.rs +++ b/src/app/browser/window/tab/item/page/content/status/download/status.rs @@ -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) } }