diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp index 24d8765a2c..5026073027 100644 --- a/Userland/Libraries/LibGUI/IconView.cpp +++ b/Userland/Libraries/LibGUI/IconView.cpp @@ -431,7 +431,7 @@ void IconView::get_item_rects(int item_index, ItemData& item_data, const Gfx::Fo item_data.text_rect = { 0, item_data.icon_rect.bottom() + 6 + 1, 0, font.glyph_height() }; item_data.wrapped_text_lines.clear(); - if ((unwrapped_text_width > available_width) && (item_data.selected || m_hovered_index == item_data.index || cursor_index() == item_data.index)) { + if ((unwrapped_text_width > available_width) && (item_data.selected || m_hovered_index == item_data.index || cursor_index() == item_data.index || m_always_wrap_item_labels)) { int current_line_width = 0; int current_line_start = 0; int widest_line_width = 0; diff --git a/Userland/Libraries/LibGUI/IconView.h b/Userland/Libraries/LibGUI/IconView.h index c36960a1e2..c26d34b766 100644 --- a/Userland/Libraries/LibGUI/IconView.h +++ b/Userland/Libraries/LibGUI/IconView.h @@ -53,6 +53,9 @@ public: Gfx::IntSize effective_item_size() const { return m_effective_item_size; } + bool always_wrap_item_labels() const { return m_always_wrap_item_labels; } + void set_always_wrap_item_labels(bool value) { m_always_wrap_item_labels = value; } + int model_column() const { return m_model_column; } void set_model_column(int column) { m_model_column = column; } @@ -157,6 +160,8 @@ private: Gfx::IntSize m_effective_item_size { 80, 80 }; + bool m_always_wrap_item_labels { false }; + bool m_rubber_banding { false }; bool m_rubber_banding_store_selection { false }; RefPtr m_out_of_view_timer;