mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
HackStudio: Expand project tree view by default
This commit is contained in:
parent
01408a511f
commit
a115702746
Notes:
sideshowbarker
2024-07-19 08:15:42 +09:00
Author: https://github.com/oriko1010 Commit: https://github.com/SerenityOS/serenity/commit/a1157027468 Pull-request: https://github.com/SerenityOS/serenity/pull/1481
2 changed files with 5 additions and 1 deletions
|
@ -187,6 +187,7 @@ int main(int argc, char** argv)
|
|||
// FIXME: Should we unlink the file here maybe?
|
||||
return;
|
||||
}
|
||||
g_project_tree_view->toggle_index(g_project_tree_view->model()->index(0, 0));
|
||||
open_file(filename);
|
||||
});
|
||||
|
||||
|
@ -199,6 +200,7 @@ int main(int argc, char** argv)
|
|||
GUI::MessageBox::show(String::format("Failed to add '%s' to project", filename.characters()), "Error", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, g_window);
|
||||
return;
|
||||
}
|
||||
g_project_tree_view->toggle_index(g_project_tree_view->model()->index(0, 0));
|
||||
open_file(filename);
|
||||
});
|
||||
|
||||
|
@ -249,6 +251,7 @@ int main(int argc, char** argv)
|
|||
g_project_tree_view->set_model(g_project->model());
|
||||
g_project_tree_view->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
g_project_tree_view->set_preferred_size(140, 0);
|
||||
g_project_tree_view->toggle_index(g_project_tree_view->model()->index(0, 0));
|
||||
|
||||
g_project_tree_view->on_context_menu_request = [&](const GUI::ModelIndex& index, const GUI::ContextMenuEvent& event) {
|
||||
if (index.is_valid()) {
|
||||
|
@ -573,6 +576,7 @@ void open_project(String filename)
|
|||
ASSERT(g_project);
|
||||
if (g_project_tree_view) {
|
||||
g_project_tree_view->set_model(g_project->model());
|
||||
g_project_tree_view->toggle_index(g_project_tree_view->model()->index(0, 0));
|
||||
g_project_tree_view->update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
virtual void scroll_into_view(const ModelIndex&, Gfx::Orientation);
|
||||
|
||||
virtual int item_count() const override;
|
||||
virtual void toggle_index(const ModelIndex&) override;
|
||||
|
||||
protected:
|
||||
TreeView();
|
||||
|
@ -60,7 +61,6 @@ private:
|
|||
int toggle_size() const { return 9; }
|
||||
int text_padding() const { return 2; }
|
||||
int tree_column_x_offset() const;
|
||||
virtual void toggle_index(const ModelIndex&) override;
|
||||
virtual void update_column_sizes() override;
|
||||
|
||||
template<typename Callback>
|
||||
|
|
Loading…
Reference in a new issue