summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorsec05 <spencer.ec09@gmail.com>2023-05-24 17:12:40 -0400
committerAndrew Kaster <andrewdkaster@gmail.com>2023-05-25 17:45:16 -0600
commit6a886e4aac134c73f54257290e7f07eef5a190b7 (patch)
tree6a4c85c742482eee53b54ece8032094c95b71501 /Userland/Applications
parent624f43c12bc8b303f9266b5063490fa92d914c1c (diff)
downloadserenity-6a886e4aac134c73f54257290e7f07eef5a190b7.zip
Browser: Download Widget file and directory text changes
fixes #18678 This is because the "From:" URL regularly overflows the line, leading to an unreadable mess. Make sure that the labels for the widget don't wrap as well, as the widget is fixed height and width.
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/Browser/DownloadWidget.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Userland/Applications/Browser/DownloadWidget.cpp b/Userland/Applications/Browser/DownloadWidget.cpp
index 2c06e5aa32..f7c120de9b 100644
--- a/Userland/Applications/Browser/DownloadWidget.cpp
+++ b/Userland/Applications/Browser/DownloadWidget.cpp
@@ -6,6 +6,7 @@
*/
#include "DownloadWidget.h"
+#include <AK/LexicalPath.h>
#include <AK/NumberFormat.h>
#include <AK/StringBuilder.h>
#include <LibCore/Proxy.h>
@@ -69,9 +70,10 @@ DownloadWidget::DownloadWidget(const URL& url)
m_browser_image->load_from_file("/res/graphics/download-animation.gif"sv);
animation_container.add_spacer().release_value_but_fixme_should_propagate_errors();
- auto& source_label = add<GUI::Label>(String::formatted("From: {}", url).release_value_but_fixme_should_propagate_errors());
+ auto& source_label = add<GUI::Label>(String::formatted("File: {}", m_url.basename()).release_value_but_fixme_should_propagate_errors());
source_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
source_label.set_fixed_height(16);
+ source_label.set_text_wrapping(Gfx::TextWrapping::DontWrap);
m_progressbar = add<GUI::Progressbar>();
m_progressbar->set_fixed_height(20);
@@ -79,10 +81,14 @@ DownloadWidget::DownloadWidget(const URL& url)
m_progress_label = add<GUI::Label>();
m_progress_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
m_progress_label->set_fixed_height(16);
+ m_progress_label->set_text_wrapping(Gfx::TextWrapping::DontWrap);
- auto& destination_label = add<GUI::Label>(String::formatted("To: {}", m_destination_path).release_value_but_fixme_should_propagate_errors());
+ auto destination_label_path = LexicalPath(m_destination_path).dirname().to_deprecated_string();
+
+ auto& destination_label = add<GUI::Label>(String::formatted("To: {}", destination_label_path).release_value_but_fixme_should_propagate_errors());
destination_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
destination_label.set_fixed_height(16);
+ destination_label.set_text_wrapping(Gfx::TextWrapping::DontWrap);
m_close_on_finish_checkbox = add<GUI::CheckBox>("Close when finished"_string.release_value_but_fixme_should_propagate_errors());
m_close_on_finish_checkbox->set_checked(close_on_finish);