1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:38:10 +00:00

LibGUI: Run clang-format on everything.

This commit is contained in:
Andreas Kling 2019-06-07 11:46:02 +02:00
parent bc951ca565
commit 7ad8790d80
43 changed files with 525 additions and 363 deletions

View file

@ -1,6 +1,6 @@
#include <LibGUI/GTreeView.h>
#include <LibGUI/GPainter.h>
#include <LibGUI/GScrollBar.h>
#include <LibGUI/GTreeView.h>
//#define DEBUG_ITEM_RECTS
@ -39,9 +39,9 @@ GModelIndex GTreeView::index_at_content_position(const Point& position, bool& is
{
is_toggle = false;
if (!model())
return { };
return {};
GModelIndex result;
traverse_in_paint_order([&] (const GModelIndex& index, const Rect& rect, const Rect& toggle_rect, int) {
traverse_in_paint_order([&](const GModelIndex& index, const Rect& rect, const Rect& toggle_rect, int) {
if (rect.contains(position)) {
result = index;
return IterationDecision::Abort;
@ -88,7 +88,7 @@ void GTreeView::traverse_in_paint_order(Callback callback) const
int indent_level = 0;
int y_offset = 0;
Function<IterationDecision(const GModelIndex&)> traverse_index = [&] (const GModelIndex& index) {
Function<IterationDecision(const GModelIndex&)> traverse_index = [&](const GModelIndex& index) {
int row_count_at_index = model.row_count(index);
if (index.is_valid()) {
auto& metadata = ensure_metadata_for_index(index);
@ -139,7 +139,7 @@ void GTreeView::paint_event(GPaintEvent& event)
auto& model = *this->model();
auto visible_content_rect = this->visible_content_rect();
traverse_in_paint_order([&] (const GModelIndex& index, const Rect& rect, const Rect& toggle_rect, int indent_level) {
traverse_in_paint_order([&](const GModelIndex& index, const Rect& rect, const Rect& toggle_rect, int indent_level) {
if (!rect.intersects(visible_content_rect))
return IterationDecision::Continue;
#ifdef DEBUG_ITEM_RECTS
@ -202,7 +202,7 @@ void GTreeView::scroll_into_view(const GModelIndex& a_index, Orientation orienta
if (!a_index.is_valid())
return;
Rect found_rect;
traverse_in_paint_order([&] (const GModelIndex& index, const Rect& rect, const Rect&, int) {
traverse_in_paint_order([&](const GModelIndex& index, const Rect& rect, const Rect&, int) {
if (index == a_index) {
found_rect = rect;
return IterationDecision::Abort;
@ -251,7 +251,7 @@ void GTreeView::update_content_size()
{
int height = 0;
int width = 0;
traverse_in_paint_order([&] (const GModelIndex&, const Rect& rect, const Rect&, int) {
traverse_in_paint_order([&](const GModelIndex&, const Rect& rect, const Rect&, int) {
width = max(width, rect.right());
height += rect.height();
return IterationDecision::Continue;
@ -267,7 +267,7 @@ void GTreeView::keydown_event(GKeyEvent& event)
if (event.key() == KeyCode::Key_Up) {
GModelIndex previous_index;
GModelIndex found_index;
traverse_in_paint_order([&] (const GModelIndex& index, const Rect&, const Rect&, int) {
traverse_in_paint_order([&](const GModelIndex& index, const Rect&, const Rect&, int) {
if (index == cursor_index) {
found_index = previous_index;
return IterationDecision::Abort;
@ -284,7 +284,7 @@ void GTreeView::keydown_event(GKeyEvent& event)
if (event.key() == KeyCode::Key_Down) {
GModelIndex previous_index;
GModelIndex found_index;
traverse_in_paint_order([&] (const GModelIndex& index, const Rect&, const Rect&, int) {
traverse_in_paint_order([&](const GModelIndex& index, const Rect&, const Rect&, int) {
if (previous_index == cursor_index) {
found_index = index;
return IterationDecision::Abort;