mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibGUI: Do AbstractView::set_column_hidden() => set_column_visible()
This API felt backwards, so let's change it.
This commit is contained in:
parent
cbc582e0df
commit
52de9b1753
Notes:
sideshowbarker
2024-07-18 20:46:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/52de9b17537
7 changed files with 21 additions and 21 deletions
|
@ -427,14 +427,14 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
|||
|
||||
auto directories_model = GUI::FileSystemModel::create({}, GUI::FileSystemModel::Mode::DirectoriesOnly);
|
||||
tree_view.set_model(directories_model);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::Icon, true);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::Size, true);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::Owner, true);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::Group, true);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::Permissions, true);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::ModificationTime, true);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::Inode, true);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::SymlinkTarget, true);
|
||||
tree_view.set_column_visible(GUI::FileSystemModel::Column::Icon, false);
|
||||
tree_view.set_column_visible(GUI::FileSystemModel::Column::Size, false);
|
||||
tree_view.set_column_visible(GUI::FileSystemModel::Column::Owner, false);
|
||||
tree_view.set_column_visible(GUI::FileSystemModel::Column::Group, false);
|
||||
tree_view.set_column_visible(GUI::FileSystemModel::Column::Permissions, false);
|
||||
tree_view.set_column_visible(GUI::FileSystemModel::Column::ModificationTime, false);
|
||||
tree_view.set_column_visible(GUI::FileSystemModel::Column::Inode, false);
|
||||
tree_view.set_column_visible(GUI::FileSystemModel::Column::SymlinkTarget, false);
|
||||
bool is_reacting_to_tree_view_selection_change = false;
|
||||
|
||||
auto& directory_view = splitter.add<DirectoryView>(DirectoryView::Mode::Normal);
|
||||
|
|
|
@ -699,9 +699,9 @@ void HackStudioWidget::create_project_tree_view(GUI::Widget& parent)
|
|||
m_project_tree_view->set_selection_mode(GUI::AbstractView::SelectionMode::MultiSelection);
|
||||
|
||||
for (int column_index = 0; column_index < m_project->model().column_count(); ++column_index)
|
||||
m_project_tree_view->set_column_hidden(column_index, true);
|
||||
m_project_tree_view->set_column_visible(column_index, false);
|
||||
|
||||
m_project_tree_view->set_column_hidden(GUI::FileSystemModel::Column::Name, false);
|
||||
m_project_tree_view->set_column_visible(GUI::FileSystemModel::Column::Name, true);
|
||||
|
||||
m_project_tree_view->on_context_menu_request = [this](const GUI::ModelIndex& index, const GUI::ContextMenuEvent& event) {
|
||||
if (index.is_valid()) {
|
||||
|
|
|
@ -372,9 +372,9 @@ void AbstractTableView::set_default_column_width(int column, int width)
|
|||
column_header().set_default_section_size(column, width);
|
||||
}
|
||||
|
||||
void AbstractTableView::set_column_hidden(int column, bool hidden)
|
||||
void AbstractTableView::set_column_visible(int column, bool visible)
|
||||
{
|
||||
column_header().set_section_visible(column, !hidden);
|
||||
column_header().set_section_visible(column, visible);
|
||||
}
|
||||
|
||||
void AbstractTableView::set_column_headers_visible(bool visible)
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
bool column_headers_visible() const;
|
||||
void set_column_headers_visible(bool);
|
||||
|
||||
void set_column_hidden(int, bool);
|
||||
void set_column_visible(int, bool);
|
||||
|
||||
int column_width(int column) const;
|
||||
void set_column_width(int column, int width);
|
||||
|
|
|
@ -113,11 +113,11 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& file_
|
|||
m_view->set_model(SortingProxyModel::create(*m_model));
|
||||
m_view->set_model_column(FileSystemModel::Column::Name);
|
||||
m_view->set_key_column_and_sort_order(GUI::FileSystemModel::Column::Name, GUI::SortOrder::Ascending);
|
||||
m_view->set_column_hidden(FileSystemModel::Column::Owner, true);
|
||||
m_view->set_column_hidden(FileSystemModel::Column::Group, true);
|
||||
m_view->set_column_hidden(FileSystemModel::Column::Permissions, true);
|
||||
m_view->set_column_hidden(FileSystemModel::Column::Inode, true);
|
||||
m_view->set_column_hidden(FileSystemModel::Column::SymlinkTarget, true);
|
||||
m_view->set_column_visible(FileSystemModel::Column::Owner, true);
|
||||
m_view->set_column_visible(FileSystemModel::Column::Group, true);
|
||||
m_view->set_column_visible(FileSystemModel::Column::Permissions, true);
|
||||
m_view->set_column_visible(FileSystemModel::Column::Inode, true);
|
||||
m_view->set_column_visible(FileSystemModel::Column::SymlinkTarget, true);
|
||||
|
||||
set_path(path);
|
||||
|
||||
|
|
|
@ -116,9 +116,9 @@ void MultiView::set_model_column(int column)
|
|||
m_columns_view->set_model_column(column);
|
||||
}
|
||||
|
||||
void MultiView::set_column_hidden(int column_index, bool hidden)
|
||||
void MultiView::set_column_visible(int column_index, bool visible)
|
||||
{
|
||||
m_table_view->set_column_hidden(column_index, hidden);
|
||||
m_table_view->set_column_visible(column_index, visible);
|
||||
}
|
||||
|
||||
void MultiView::build_actions()
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
int model_column() const { return m_model_column; }
|
||||
void set_model_column(int);
|
||||
|
||||
void set_column_hidden(int column_index, bool hidden);
|
||||
void set_column_visible(int column_index, bool visible);
|
||||
|
||||
void set_key_column_and_sort_order(int column, SortOrder);
|
||||
|
||||
|
|
Loading…
Reference in a new issue