mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -21,7 +21,7 @@ void GraphWidget::add_value(Vector<u64, 1>&& value)
|
|||
|
||||
void GraphWidget::paint_event(GUI::PaintEvent& event)
|
||||
{
|
||||
const auto& system_palette = GUI::Application::the()->palette();
|
||||
auto const& system_palette = GUI::Application::the()->palette();
|
||||
|
||||
GUI::Frame::paint_event(event);
|
||||
GUI::Painter painter(*this);
|
||||
|
@ -35,18 +35,18 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
|
|||
if (!m_values.is_empty()) {
|
||||
// Draw one set of values at a time
|
||||
for (size_t k = 0; k < m_value_format.size(); k++) {
|
||||
const auto& format = m_value_format[k];
|
||||
auto const& format = m_value_format[k];
|
||||
if (format.graph_color_role == ColorRole::Base) {
|
||||
continue;
|
||||
}
|
||||
const auto& line_color = system_palette.color(format.graph_color_role);
|
||||
const auto& background_color = line_color.with_alpha(0x7f);
|
||||
auto const& line_color = system_palette.color(format.graph_color_role);
|
||||
auto const& background_color = line_color.with_alpha(0x7f);
|
||||
m_calculated_points.clear_with_capacity();
|
||||
for (size_t i = 0; i < m_values.size(); i++) {
|
||||
int x = inner_rect.right() - (i * 2) + 1;
|
||||
if (x < 0)
|
||||
break;
|
||||
const auto& current_values = m_values.at(m_values.size() - i - 1);
|
||||
auto const& current_values = m_values.at(m_values.size() - i - 1);
|
||||
if (current_values.size() <= k) {
|
||||
// Don't have a data point
|
||||
m_calculated_points.append({ -1, -1 });
|
||||
|
@ -67,8 +67,8 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
|
|||
Gfx::Path path;
|
||||
size_t points_in_path = 0;
|
||||
bool started_path = false;
|
||||
const Gfx::IntPoint* current_point = nullptr;
|
||||
const Gfx::IntPoint* first_point = nullptr;
|
||||
Gfx::IntPoint const* current_point = nullptr;
|
||||
Gfx::IntPoint const* first_point = nullptr;
|
||||
auto check_fill_area = [&]() {
|
||||
if (!started_path)
|
||||
return;
|
||||
|
@ -109,9 +109,9 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
|
|||
}
|
||||
if (format.graph_color_role != ColorRole::Base) {
|
||||
// Draw the line for the data points we have
|
||||
const Gfx::IntPoint* previous_point = nullptr;
|
||||
Gfx::IntPoint const* previous_point = nullptr;
|
||||
for (size_t i = 0; i < m_calculated_points.size(); i++) {
|
||||
const auto& current_point = m_calculated_points[i];
|
||||
auto const& current_point = m_calculated_points[i];
|
||||
if (current_point.x() < 0) {
|
||||
previous_point = nullptr;
|
||||
continue;
|
||||
|
@ -125,11 +125,11 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
|
|||
}
|
||||
|
||||
if (!m_values.is_empty() && !m_value_format.is_empty()) {
|
||||
const auto& current_values = m_values.last();
|
||||
auto const& current_values = m_values.last();
|
||||
int y = 0;
|
||||
for (size_t i = 0; i < min(m_value_format.size(), current_values.size()); i++) {
|
||||
const auto& format = m_value_format[i];
|
||||
const auto& graph_color = system_palette.color(format.graph_color_role);
|
||||
auto const& format = m_value_format[i];
|
||||
auto const& graph_color = system_palette.color(format.graph_color_role);
|
||||
if (!format.text_formatter)
|
||||
continue;
|
||||
auto constrain_rect = inner_rect.shrunken(8, 8);
|
||||
|
|
|
@ -36,7 +36,7 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph)
|
|||
layout()->set_margins({ 8, 0, 0 });
|
||||
layout()->set_spacing(3);
|
||||
|
||||
auto build_widgets_for_label = [this](const String& description) -> RefPtr<GUI::Label> {
|
||||
auto build_widgets_for_label = [this](String const& description) -> RefPtr<GUI::Label> {
|
||||
auto& container = add<GUI::Widget>();
|
||||
container.set_layout<GUI::HorizontalBoxLayout>();
|
||||
container.set_fixed_size(275, 12);
|
||||
|
|
|
@ -18,7 +18,7 @@ class PagemapPaintingDelegate final : public GUI::TableCellPaintingDelegate {
|
|||
public:
|
||||
virtual ~PagemapPaintingDelegate() override = default;
|
||||
|
||||
virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Gfx::Palette&, const GUI::ModelIndex& index) override
|
||||
virtual void paint(GUI::Painter& painter, Gfx::IntRect const& a_rect, Gfx::Palette const&, const GUI::ModelIndex& index) override
|
||||
{
|
||||
auto rect = a_rect.shrunken(2, 2);
|
||||
auto pagemap = index.data(GUI::ModelRole::Custom).to_string();
|
||||
|
@ -93,7 +93,7 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget()
|
|||
[](auto&) {
|
||||
return GUI::Variant(0);
|
||||
},
|
||||
[](const JsonObject& object) {
|
||||
[](JsonObject const& object) {
|
||||
auto pagemap = object.get("pagemap").as_string_or({});
|
||||
return pagemap;
|
||||
});
|
||||
|
|
|
@ -64,7 +64,7 @@ class UnavailableProcessWidget final : public GUI::Frame {
|
|||
public:
|
||||
virtual ~UnavailableProcessWidget() override = default;
|
||||
|
||||
const String& text() const { return m_text; }
|
||||
String const& text() const { return m_text; }
|
||||
void set_text(String text) { m_text = move(text); }
|
||||
|
||||
private:
|
||||
|
@ -390,7 +390,7 @@ class ProgressbarPaintingDelegate final : public GUI::TableCellPaintingDelegate
|
|||
public:
|
||||
virtual ~ProgressbarPaintingDelegate() override = default;
|
||||
|
||||
virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Palette& palette, const GUI::ModelIndex& index) override
|
||||
virtual void paint(GUI::Painter& painter, Gfx::IntRect const& a_rect, Palette const& palette, const GUI::ModelIndex& index) override
|
||||
{
|
||||
auto rect = a_rect.shrunken(2, 2);
|
||||
auto percentage = index.data(GUI::ModelRole::Custom).to_i32();
|
||||
|
@ -707,7 +707,7 @@ NonnullRefPtr<GUI::Widget> build_performance_tab()
|
|||
cpu_graphs.append(cpu_graph);
|
||||
}
|
||||
}
|
||||
ProcessModel::the().on_cpu_info_change = [cpu_graphs](const NonnullOwnPtrVector<ProcessModel::CpuInfo>& cpus) mutable {
|
||||
ProcessModel::the().on_cpu_info_change = [cpu_graphs](NonnullOwnPtrVector<ProcessModel::CpuInfo> const& cpus) mutable {
|
||||
float sum_cpu = 0;
|
||||
for (size_t i = 0; i < cpus.size(); ++i) {
|
||||
cpu_graphs[i].add_value({ static_cast<size_t>(cpus[i].total_cpu_percent), static_cast<size_t>(cpus[i].total_cpu_percent_kernel) });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue