diff options
38 files changed, 1 insertions, 216 deletions
diff --git a/Applications/Browser/InspectorWidget.cpp b/Applications/Browser/InspectorWidget.cpp index 8b86f2db08..ef9f019777 100644 --- a/Applications/Browser/InspectorWidget.cpp +++ b/Applications/Browser/InspectorWidget.cpp @@ -60,10 +60,7 @@ InspectorWidget::InspectorWidget() auto& tab_widget = splitter.add<GUI::TabWidget>(); m_style_table_view = tab_widget.add_tab<GUI::TableView>("Styles"); - m_style_table_view->set_size_columns_to_fit_content(true); - m_computed_style_table_view = tab_widget.add_tab<GUI::TableView>("Computed"); - m_computed_style_table_view->set_size_columns_to_fit_content(true); } InspectorWidget::~InspectorWidget() diff --git a/Applications/Calendar/AddEventDialog.cpp b/Applications/Calendar/AddEventDialog.cpp index 9d0eabe022..429690b50f 100644 --- a/Applications/Calendar/AddEventDialog.cpp +++ b/Applications/Calendar/AddEventDialog.cpp @@ -146,11 +146,6 @@ String AddEventDialog::MonthListModel::column_name(int column) const } } -GUI::Model::ColumnMetadata AddEventDialog::MonthListModel::column_metadata([[maybe_unused]] int column) const -{ - return {}; -} - GUI::Variant AddEventDialog::MonthListModel::data(const GUI::ModelIndex& index, Role role) const { auto& month = Calendar::name_of_month(index.row() + 1); diff --git a/Applications/Calendar/AddEventDialog.h b/Applications/Calendar/AddEventDialog.h index ff03044f7d..3d8ace75f1 100644 --- a/Applications/Calendar/AddEventDialog.h +++ b/Applications/Calendar/AddEventDialog.h @@ -58,7 +58,6 @@ private: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override; virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; } virtual String column_name(int) const override; - virtual ColumnMetadata column_metadata(int) const override; virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override; virtual void update() override; diff --git a/Applications/DisplaySettings/ItemListModel.h b/Applications/DisplaySettings/ItemListModel.h index fdc2f8d911..e35be9b7e9 100644 --- a/Applications/DisplaySettings/ItemListModel.h +++ b/Applications/DisplaySettings/ItemListModel.h @@ -52,11 +52,6 @@ public: return "Data"; } - virtual ColumnMetadata column_metadata(int) const override - { - return { 70 }; - } - virtual GUI::Variant data(const GUI::ModelIndex& index, Role role = Role::Display) const override { if (role == Role::TextAlignment) diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp index b6fc9c01bf..00e2cd7784 100644 --- a/Applications/IRCClient/IRCAppWindow.cpp +++ b/Applications/IRCClient/IRCAppWindow.cpp @@ -333,7 +333,6 @@ void IRCAppWindow::setup_widgets() m_window_list = horizontal_container.add<GUI::TableView>(); m_window_list->set_headers_visible(false); m_window_list->set_alternating_row_colors(false); - m_window_list->set_size_columns_to_fit_content(true); m_window_list->set_model(m_client->client_window_list_model()); m_window_list->set_activates_on_selection(true); m_window_list->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill); diff --git a/Applications/IRCClient/IRCChannelMemberListModel.cpp b/Applications/IRCClient/IRCChannelMemberListModel.cpp index 6e7b9d1fc4..7b415ec817 100644 --- a/Applications/IRCClient/IRCChannelMemberListModel.cpp +++ b/Applications/IRCClient/IRCChannelMemberListModel.cpp @@ -57,15 +57,6 @@ String IRCChannelMemberListModel::column_name(int column) const ASSERT_NOT_REACHED(); } -GUI::Model::ColumnMetadata IRCChannelMemberListModel::column_metadata(int column) const -{ - switch (column) { - case Column::Name: - return { 70 }; - } - ASSERT_NOT_REACHED(); -} - GUI::Variant IRCChannelMemberListModel::data(const GUI::ModelIndex& index, Role role) const { if (role == Role::TextAlignment) diff --git a/Applications/IRCClient/IRCChannelMemberListModel.h b/Applications/IRCClient/IRCChannelMemberListModel.h index 2bc62b795e..aab7451391 100644 --- a/Applications/IRCClient/IRCChannelMemberListModel.h +++ b/Applications/IRCClient/IRCChannelMemberListModel.h @@ -42,7 +42,6 @@ public: virtual int row_count(const GUI::ModelIndex&) const override; virtual int column_count(const GUI::ModelIndex&) const override; virtual String column_name(int column) const override; - virtual ColumnMetadata column_metadata(int column) const override; virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override; virtual void update() override; virtual String nick_at(const GUI::ModelIndex& index) const; diff --git a/Applications/IRCClient/IRCWindowListModel.cpp b/Applications/IRCClient/IRCWindowListModel.cpp index 4c2c227d58..6e024c7878 100644 --- a/Applications/IRCClient/IRCWindowListModel.cpp +++ b/Applications/IRCClient/IRCWindowListModel.cpp @@ -59,15 +59,6 @@ String IRCWindowListModel::column_name(int column) const ASSERT_NOT_REACHED(); } -GUI::Model::ColumnMetadata IRCWindowListModel::column_metadata(int column) const -{ - switch (column) { - case Column::Name: - return { 70 }; - } - ASSERT_NOT_REACHED(); -} - GUI::Variant IRCWindowListModel::data(const GUI::ModelIndex& index, Role role) const { if (role == Role::TextAlignment) diff --git a/Applications/IRCClient/IRCWindowListModel.h b/Applications/IRCClient/IRCWindowListModel.h index e4d289bcbe..a93ddd49fb 100644 --- a/Applications/IRCClient/IRCWindowListModel.h +++ b/Applications/IRCClient/IRCWindowListModel.h @@ -44,7 +44,6 @@ public: virtual int row_count(const GUI::ModelIndex&) const override; virtual int column_count(const GUI::ModelIndex&) const override; virtual String column_name(int column) const override; - virtual ColumnMetadata column_metadata(int column) const override; virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override; virtual void update() override; diff --git a/Applications/PixelPaint/main.cpp b/Applications/PixelPaint/main.cpp index 3f5fd536c5..75d9e4e82a 100644 --- a/Applications/PixelPaint/main.cpp +++ b/Applications/PixelPaint/main.cpp @@ -89,7 +89,6 @@ int main(int argc, char** argv) right_panel.set_layout<GUI::VerticalBoxLayout>(); auto& layer_table_view = right_panel.add<GUI::TableView>(); - layer_table_view.set_size_columns_to_fit_content(true); window->show(); diff --git a/Applications/SystemMonitor/DevicesModel.cpp b/Applications/SystemMonitor/DevicesModel.cpp index d4049baf38..69091402cc 100644 --- a/Applications/SystemMonitor/DevicesModel.cpp +++ b/Applications/SystemMonitor/DevicesModel.cpp @@ -73,24 +73,6 @@ String DevicesModel::column_name(int column) const } } -GUI::Model::ColumnMetadata DevicesModel::column_metadata(int column) const -{ - switch (column) { - case Column::Device: - return { 70 }; - case Column::Major: - return { 32 }; - case Column::Minor: - return { 32 }; - case Column::ClassName: - return { 120 }; - case Column::Type: - return { 120 }; - default: - ASSERT_NOT_REACHED(); - } -} - GUI::Variant DevicesModel::data(const GUI::ModelIndex& index, Role role) const { ASSERT(is_valid(index)); diff --git a/Applications/SystemMonitor/DevicesModel.h b/Applications/SystemMonitor/DevicesModel.h index 61f17f705a..dde59df53e 100644 --- a/Applications/SystemMonitor/DevicesModel.h +++ b/Applications/SystemMonitor/DevicesModel.h @@ -47,7 +47,6 @@ public: virtual int row_count(const GUI::ModelIndex&) const override; virtual int column_count(const GUI::ModelIndex&) const override; virtual String column_name(int column) const override; - virtual ColumnMetadata column_metadata(int column) const override; virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override; virtual void update() override; diff --git a/Applications/SystemMonitor/NetworkStatisticsWidget.cpp b/Applications/SystemMonitor/NetworkStatisticsWidget.cpp index b5abb54702..0908239e81 100644 --- a/Applications/SystemMonitor/NetworkStatisticsWidget.cpp +++ b/Applications/SystemMonitor/NetworkStatisticsWidget.cpp @@ -44,7 +44,6 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() adapters_group_box.set_preferred_size(0, 120); m_adapter_table_view = adapters_group_box.add<GUI::TableView>(); - m_adapter_table_view->set_size_columns_to_fit_content(true); Vector<GUI::JsonArrayModel::FieldSpec> net_adapters_fields; net_adapters_fields.empend("name", "Name", Gfx::TextAlignment::CenterLeft); @@ -64,7 +63,6 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() sockets_group_box.set_preferred_size(0, 0); m_socket_table_view = sockets_group_box.add<GUI::TableView>(); - m_socket_table_view->set_size_columns_to_fit_content(true); Vector<GUI::JsonArrayModel::FieldSpec> net_tcp_fields; net_tcp_fields.empend("peer_address", "Peer", Gfx::TextAlignment::CenterLeft); diff --git a/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp b/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp index cd8487873b..9e8505f5dc 100644 --- a/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp +++ b/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp @@ -34,7 +34,6 @@ ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget() set_layout<GUI::VerticalBoxLayout>(); layout()->set_margins({ 4, 4, 4, 4 }); m_table_view = add<GUI::TableView>(); - m_table_view->set_size_columns_to_fit_content(true); Vector<GUI::JsonArrayModel::FieldSpec> pid_fds_fields; pid_fds_fields.empend("fd", "FD", Gfx::TextAlignment::CenterRight); diff --git a/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp b/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp index 9c5e92c16d..bd5b4fbabb 100644 --- a/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp +++ b/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp @@ -69,7 +69,6 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget() set_layout<GUI::VerticalBoxLayout>(); layout()->set_margins({ 4, 4, 4, 4 }); m_table_view = add<GUI::TableView>(); - m_table_view->set_size_columns_to_fit_content(true); Vector<GUI::JsonArrayModel::FieldSpec> pid_vm_fields; pid_vm_fields.empend("Address", Gfx::TextAlignment::CenterLeft, [](auto& object) { return String::format("%#x", object.get("address").to_u32()); diff --git a/Applications/SystemMonitor/ProcessModel.cpp b/Applications/SystemMonitor/ProcessModel.cpp index 4cbfd95a99..9af7d1f5fc 100644 --- a/Applications/SystemMonitor/ProcessModel.cpp +++ b/Applications/SystemMonitor/ProcessModel.cpp @@ -128,68 +128,6 @@ String ProcessModel::column_name(int column) const } } -GUI::Model::ColumnMetadata ProcessModel::column_metadata(int column) const -{ - switch (column) { - case Column::Icon: - return { 16 }; - case Column::PID: - return { 32 }; - case Column::TID: - return { 32 }; - case Column::State: - return { 75 }; - case Column::Priority: - return { 16 }; - case Column::EffectivePriority: - return { 16 }; - case Column::User: - return { 50 }; - case Column::Virtual: - return { 65 }; - case Column::Physical: - return { 65 }; - case Column::DirtyPrivate: - return { 65 }; - case Column::CleanInode: - return { 65 }; - case Column::PurgeableVolatile: - return { 65 }; - case Column::PurgeableNonvolatile: - return { 65 }; - case Column::CPU: - return { 32 }; - case Column::Name: - return { 140 }; - case Column::Syscalls: - return { 60 }; - case Column::InodeFaults: - return { 60 }; - case Column::ZeroFaults: - return { 60 }; - case Column::CowFaults: - return { 60 }; - case Column::FileReadBytes: - return { 60 }; - case Column::FileWriteBytes: - return { 60 }; - case Column::UnixSocketReadBytes: - return { 60 }; - case Column::UnixSocketWriteBytes: - return { 60 }; - case Column::IPv4SocketReadBytes: - return { 60 }; - case Column::IPv4SocketWriteBytes: - return { 60 }; - case Column::Pledge: - return { 60 }; - case Column::Veil: - return { 60 }; - default: - ASSERT_NOT_REACHED(); - } -} - static String pretty_byte_size(size_t size) { return String::format("%uK", size / 1024); diff --git a/Applications/SystemMonitor/ProcessModel.h b/Applications/SystemMonitor/ProcessModel.h index 9da382822d..61d1f4056a 100644 --- a/Applications/SystemMonitor/ProcessModel.h +++ b/Applications/SystemMonitor/ProcessModel.h @@ -84,7 +84,6 @@ public: virtual int row_count(const GUI::ModelIndex&) const override; virtual int column_count(const GUI::ModelIndex&) const override; virtual String column_name(int column) const override; - virtual ColumnMetadata column_metadata(int column) const override; virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override; virtual void update() override; diff --git a/Applications/SystemMonitor/ProcessTableView.cpp b/Applications/SystemMonitor/ProcessTableView.cpp index f8cf68955b..74fc1485d0 100644 --- a/Applications/SystemMonitor/ProcessTableView.cpp +++ b/Applications/SystemMonitor/ProcessTableView.cpp @@ -31,7 +31,6 @@ ProcessTableView::ProcessTableView() { - set_size_columns_to_fit_content(true); set_model(GUI::SortingProxyModel::create(ProcessModel::create())); model()->set_key_column_and_sort_order(ProcessModel::Column::CPU, GUI::SortOrder::Descending); refresh(); diff --git a/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp b/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp index 7423e50e6b..4121057fef 100644 --- a/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp +++ b/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp @@ -34,7 +34,6 @@ ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget() set_layout<GUI::VerticalBoxLayout>(); layout()->set_margins({ 4, 4, 4, 4 }); m_table_view = add<GUI::TableView>(); - m_table_view->set_size_columns_to_fit_content(true); Vector<GUI::JsonArrayModel::FieldSpec> pid_unveil_fields; pid_unveil_fields.empend("path", "Path", Gfx::TextAlignment::CenterLeft); diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp index 180bd00133..9bf95ca2dc 100644 --- a/Applications/SystemMonitor/main.cpp +++ b/Applications/SystemMonitor/main.cpp @@ -309,7 +309,6 @@ NonnullRefPtr<GUI::Widget> build_file_systems_tab() self.set_layout<GUI::VerticalBoxLayout>(); self.layout()->set_margins({ 4, 4, 4, 4 }); auto& fs_table_view = self.add<GUI::TableView>(); - fs_table_view.set_size_columns_to_fit_content(true); Vector<GUI::JsonArrayModel::FieldSpec> df_fields; df_fields.empend("mount_point", "Mount point", Gfx::TextAlignment::CenterLeft); @@ -402,7 +401,6 @@ NonnullRefPtr<GUI::Widget> build_pci_devices_tab() self.set_layout<GUI::VerticalBoxLayout>(); self.layout()->set_margins({ 4, 4, 4, 4 }); auto& pci_table_view = self.add<GUI::TableView>(); - pci_table_view.set_size_columns_to_fit_content(true); auto db = PCIDB::Database::open(); @@ -461,7 +459,6 @@ NonnullRefPtr<GUI::Widget> build_devices_tab() self.layout()->set_margins({ 4, 4, 4, 4 }); auto& devices_table_view = self.add<GUI::TableView>(); - devices_table_view.set_size_columns_to_fit_content(true); devices_table_view.set_model(GUI::SortingProxyModel::create(DevicesModel::create())); devices_table_view.model()->update(); }; diff --git a/DevTools/HackStudio/FindInFilesWidget.cpp b/DevTools/HackStudio/FindInFilesWidget.cpp index 966865eeb0..ecc70acc97 100644 --- a/DevTools/HackStudio/FindInFilesWidget.cpp +++ b/DevTools/HackStudio/FindInFilesWidget.cpp @@ -143,7 +143,6 @@ FindInFilesWidget::FindInFilesWidget() m_button->set_preferred_size(100, 0); m_result_view = add<GUI::TableView>(); - m_result_view->set_size_columns_to_fit_content(true); m_result_view->on_activation = [](auto& index) { auto& match = *(const Match*)index.internal_data(); diff --git a/DevTools/HackStudio/Locator.cpp b/DevTools/HackStudio/Locator.cpp index 1c9431b0c4..5f31c0af37 100644 --- a/DevTools/HackStudio/Locator.cpp +++ b/DevTools/HackStudio/Locator.cpp @@ -151,7 +151,6 @@ Locator::Locator() m_popup_window->set_rect(0, 0, 500, 200); m_suggestion_view = m_popup_window->set_main_widget<GUI::TableView>(); - m_suggestion_view->set_size_columns_to_fit_content(true); m_suggestion_view->set_headers_visible(false); m_suggestion_view->on_activation = [this](auto& index) { diff --git a/DevTools/Inspector/main.cpp b/DevTools/Inspector/main.cpp index e2face9e24..38fe69f016 100644 --- a/DevTools/Inspector/main.cpp +++ b/DevTools/Inspector/main.cpp @@ -94,7 +94,6 @@ int main(int argc, char** argv) tree_view.set_activates_on_selection(true); auto& properties_table_view = splitter.add<GUI::TableView>(); - properties_table_view.set_size_columns_to_fit_content(true); properties_table_view.set_editable(true); properties_table_view.aid_create_editing_delegate = [](auto&) { return make<GUI::StringModelEditingDelegate>(); diff --git a/DevTools/ProfileViewer/main.cpp b/DevTools/ProfileViewer/main.cpp index 193e52173b..0cd47c37a5 100644 --- a/DevTools/ProfileViewer/main.cpp +++ b/DevTools/ProfileViewer/main.cpp @@ -69,11 +69,9 @@ int main(int argc, char** argv) auto& tree_view = bottom_splitter.add<GUI::TreeView>(); tree_view.set_headers_visible(true); - tree_view.set_size_columns_to_fit_content(true); tree_view.set_model(profile->model()); auto& disassembly_view = bottom_splitter.add<GUI::TableView>(); - disassembly_view.set_size_columns_to_fit_content(true); tree_view.on_selection = [&](auto& index) { profile->set_disassembly_index(index); diff --git a/DevTools/VisualBuilder/VBWidgetPropertyModel.cpp b/DevTools/VisualBuilder/VBWidgetPropertyModel.cpp index d59ffdf615..96fd12e3bd 100644 --- a/DevTools/VisualBuilder/VBWidgetPropertyModel.cpp +++ b/DevTools/VisualBuilder/VBWidgetPropertyModel.cpp @@ -57,14 +57,6 @@ String VBWidgetPropertyModel::column_name(int column) const } } -GUI::Model::ColumnMetadata VBWidgetPropertyModel::column_metadata(int column) const -{ - UNUSED_PARAM(column); - if (column == Column::Name) - return { 110 }; - return { 90 }; -} - GUI::Variant VBWidgetPropertyModel::data(const GUI::ModelIndex& index, Role role) const { if (role == Role::TextAlignment) { diff --git a/DevTools/VisualBuilder/VBWidgetPropertyModel.h b/DevTools/VisualBuilder/VBWidgetPropertyModel.h index 480c23ec88..d75b489533 100644 --- a/DevTools/VisualBuilder/VBWidgetPropertyModel.h +++ b/DevTools/VisualBuilder/VBWidgetPropertyModel.h @@ -46,7 +46,6 @@ public: virtual int row_count(const GUI::ModelIndex&) const override; virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; } virtual String column_name(int column) const override; - virtual ColumnMetadata column_metadata(int column) const override; virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override; virtual void update() override { did_update(); } virtual bool is_editable(const GUI::ModelIndex&) const override; diff --git a/Libraries/LibGUI/AbstractTableView.cpp b/Libraries/LibGUI/AbstractTableView.cpp index 094f637d01..9e8694b0ad 100644 --- a/Libraries/LibGUI/AbstractTableView.cpp +++ b/Libraries/LibGUI/AbstractTableView.cpp @@ -59,9 +59,6 @@ void AbstractTableView::select_all() void AbstractTableView::update_column_sizes() { - if (!m_size_columns_to_fit_content) - return; - if (!model()) return; @@ -249,13 +246,7 @@ int AbstractTableView::column_width(int column_index) const { if (!model()) return 0; - auto& column_data = this->column_data(column_index); - if (!column_data.has_initialized_width) { - ASSERT(!m_size_columns_to_fit_content); - column_data.has_initialized_width = true; - column_data.width = model()->column_metadata(column_index).preferred_width; - } - return column_data.width; + return column_data(column_index).width; } void AbstractTableView::mousemove_event(MouseEvent& event) diff --git a/Libraries/LibGUI/AbstractTableView.h b/Libraries/LibGUI/AbstractTableView.h index 7fece2dd44..8ef3486f1d 100644 --- a/Libraries/LibGUI/AbstractTableView.h +++ b/Libraries/LibGUI/AbstractTableView.h @@ -52,9 +52,6 @@ public: bool is_column_hidden(int) const; void set_column_hidden(int, bool); - void set_size_columns_to_fit_content(bool b) { m_size_columns_to_fit_content = b; } - bool size_columns_to_fit_content() const { return m_size_columns_to_fit_content; } - void set_cell_painting_delegate(int column, OwnPtr<TableCellPaintingDelegate>&&); int horizontal_padding() const { return m_horizontal_padding; } @@ -117,7 +114,6 @@ protected: private: bool m_headers_visible { true }; - bool m_size_columns_to_fit_content { false }; bool m_in_column_resize { false }; bool m_alternating_row_colors { true }; int m_horizontal_padding { 5 }; diff --git a/Libraries/LibGUI/FileSystemModel.cpp b/Libraries/LibGUI/FileSystemModel.cpp index 622bf94abc..fd1fe6fe3d 100644 --- a/Libraries/LibGUI/FileSystemModel.cpp +++ b/Libraries/LibGUI/FileSystemModel.cpp @@ -568,31 +568,6 @@ String FileSystemModel::column_name(int column) const ASSERT_NOT_REACHED(); } -Model::ColumnMetadata FileSystemModel::column_metadata(int column) const -{ - switch (column) { - case Column::Icon: - return { 16 }; - case Column::Name: - return { 120 }; - case Column::Size: - return { 80 }; - case Column::Owner: - return { 50 }; - case Column::Group: - return { 50 }; - case Column::ModificationTime: - return { 110 }; - case Column::Permissions: - return { 65 }; - case Column::Inode: - return { 60 }; - case Column::SymlinkTarget: - return { 120 }; - } - ASSERT_NOT_REACHED(); -} - bool FileSystemModel::accepts_drag(const ModelIndex& index, const StringView& data_type) { if (!index.is_valid()) diff --git a/Libraries/LibGUI/FileSystemModel.h b/Libraries/LibGUI/FileSystemModel.h index 2a80933da2..5e5ee27ea7 100644 --- a/Libraries/LibGUI/FileSystemModel.h +++ b/Libraries/LibGUI/FileSystemModel.h @@ -141,7 +141,6 @@ public: virtual int row_count(const ModelIndex& = ModelIndex()) const override; virtual int column_count(const ModelIndex& = ModelIndex()) const override; virtual String column_name(int column) const override; - virtual ColumnMetadata column_metadata(int column) const override; virtual Variant data(const ModelIndex&, Role = Role::Display) const override; virtual void update() override; virtual ModelIndex parent_index(const ModelIndex&) const override; diff --git a/Libraries/LibGUI/JsonArrayModel.cpp b/Libraries/LibGUI/JsonArrayModel.cpp index 9dd75001da..fee86003ea 100644 --- a/Libraries/LibGUI/JsonArrayModel.cpp +++ b/Libraries/LibGUI/JsonArrayModel.cpp @@ -91,12 +91,6 @@ bool JsonArrayModel::remove(int row) return true; } -Model::ColumnMetadata JsonArrayModel::column_metadata(int column) const -{ - ASSERT(column < static_cast<int>(m_fields.size())); - return { 100 }; -} - Variant JsonArrayModel::data(const ModelIndex& index, Role role) const { auto& field_spec = m_fields[index.column()]; diff --git a/Libraries/LibGUI/JsonArrayModel.h b/Libraries/LibGUI/JsonArrayModel.h index f6366cf637..0c59663663 100644 --- a/Libraries/LibGUI/JsonArrayModel.h +++ b/Libraries/LibGUI/JsonArrayModel.h @@ -69,7 +69,6 @@ public: virtual int row_count(const ModelIndex& = ModelIndex()) const override { return m_array.size(); } virtual int column_count(const ModelIndex& = ModelIndex()) const override { return m_fields.size(); } virtual String column_name(int column) const override { return m_fields[column].column_name; } - virtual ColumnMetadata column_metadata(int) const override; virtual Variant data(const ModelIndex&, Role = Role::Display) const override; virtual void update() override; diff --git a/Libraries/LibGUI/Model.h b/Libraries/LibGUI/Model.h index 0ec45006ee..15a2789ff9 100644 --- a/Libraries/LibGUI/Model.h +++ b/Libraries/LibGUI/Model.h @@ -46,10 +46,6 @@ enum class SortOrder { class Model : public RefCounted<Model> { public: - struct ColumnMetadata { - int preferred_width { 0 }; - }; - enum UpdateFlag { DontInvalidateIndexes = 0, InvalidateAllIndexes = 1 << 0, @@ -73,7 +69,6 @@ public: virtual int column_count(const ModelIndex& = ModelIndex()) const = 0; virtual String row_name(int) const { return {}; } virtual String column_name(int) const { return {}; } - virtual ColumnMetadata column_metadata(int) const { return {}; } virtual Variant data(const ModelIndex&, Role = Role::Display) const = 0; virtual void update() = 0; virtual ModelIndex parent_index(const ModelIndex&) const { return {}; } diff --git a/Libraries/LibGUI/SortingProxyModel.cpp b/Libraries/LibGUI/SortingProxyModel.cpp index 27dc08f145..7bf6d7f6dc 100644 --- a/Libraries/LibGUI/SortingProxyModel.cpp +++ b/Libraries/LibGUI/SortingProxyModel.cpp @@ -74,11 +74,6 @@ String SortingProxyModel::column_name(int index) const return target().column_name(index); } -Model::ColumnMetadata SortingProxyModel::column_metadata(int index) const -{ - return target().column_metadata(index); -} - Variant SortingProxyModel::data(const ModelIndex& index, Role role) const { auto target_index = map_to_target(index); diff --git a/Libraries/LibGUI/SortingProxyModel.h b/Libraries/LibGUI/SortingProxyModel.h index 4198ad1494..942a7403a3 100644 --- a/Libraries/LibGUI/SortingProxyModel.h +++ b/Libraries/LibGUI/SortingProxyModel.h @@ -39,7 +39,6 @@ public: virtual int column_count(const ModelIndex& = ModelIndex()) const override; virtual String row_name(int) const override; virtual String column_name(int) const override; - virtual ColumnMetadata column_metadata(int) const override; virtual Variant data(const ModelIndex&, Role = Role::Display) const override; virtual void update() override; virtual StringView drag_data_type() const override; diff --git a/Libraries/LibGUI/TreeView.cpp b/Libraries/LibGUI/TreeView.cpp index 51b9ae8456..e3b2f113e0 100644 --- a/Libraries/LibGUI/TreeView.cpp +++ b/Libraries/LibGUI/TreeView.cpp @@ -56,7 +56,6 @@ TreeView::TreeView() set_fill_with_background_color(true); set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); - set_size_columns_to_fit_content(true); set_headers_visible(false); m_expand_bitmap = Gfx::Bitmap::load_from_file("/res/icons/treeview-expand.png"); m_collapse_bitmap = Gfx::Bitmap::load_from_file("/res/icons/treeview-collapse.png"); @@ -515,9 +514,6 @@ int TreeView::item_count() const void TreeView::update_column_sizes() { - if (!size_columns_to_fit_content()) - return; - if (!model()) return; diff --git a/MenuApplets/ClipboardHistory/ClipboardHistoryModel.cpp b/MenuApplets/ClipboardHistory/ClipboardHistoryModel.cpp index a6c0179c47..84f89cc764 100644 --- a/MenuApplets/ClipboardHistory/ClipboardHistoryModel.cpp +++ b/MenuApplets/ClipboardHistory/ClipboardHistoryModel.cpp @@ -47,18 +47,6 @@ String ClipboardHistoryModel::column_name(int column) const } } -GUI::Model::ColumnMetadata ClipboardHistoryModel::column_metadata(int column) const -{ - switch (column) { - case Column::Data: - return { 200 }; - case Column::Type: - return { 100 }; - default: - ASSERT_NOT_REACHED(); - } -} - GUI::Variant ClipboardHistoryModel::data(const GUI::ModelIndex& index, Role) const { auto& data_and_type = m_history_items[index.row()]; diff --git a/MenuApplets/ClipboardHistory/ClipboardHistoryModel.h b/MenuApplets/ClipboardHistory/ClipboardHistoryModel.h index 5f1357563f..6229234e55 100644 --- a/MenuApplets/ClipboardHistory/ClipboardHistoryModel.h +++ b/MenuApplets/ClipboardHistory/ClipboardHistoryModel.h @@ -48,7 +48,6 @@ public: private: virtual int row_count(const GUI::ModelIndex&) const override { return m_history_items.size(); } virtual String column_name(int) const override; - virtual GUI::Model::ColumnMetadata column_metadata(int column) const override; virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; } virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override; virtual void update() override; |