1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 03:07:35 +00:00

Meta+Applications: Make clang-format-10 clean

This commit is contained in:
Ben Wiederhake 2020-09-18 09:49:51 +02:00 committed by Andreas Kling
parent 8940bc3503
commit 9ef1461ec9
27 changed files with 57 additions and 51 deletions

View file

@ -32,6 +32,7 @@ namespace PixelPaint {
class CreateNewLayerDialog final : public GUI::Dialog {
C_OBJECT(CreateNewLayerDialog);
public:
const Gfx::IntSize& layer_size() const { return m_layer_size; }
const String& layer_name() const { return m_layer_name; }

View file

@ -27,8 +27,8 @@
#pragma once
#include "Tool.h"
#include <LibGfx/Point.h>
#include <LibGUI/ActionGroup.h>
#include <LibGfx/Point.h>
namespace PixelPaint {

View file

@ -28,8 +28,8 @@
#include "Tool.h"
#include <LibGUI/ActionGroup.h>
#include <LibGfx/Point.h>
#include <LibGfx/Forward.h>
#include <LibGfx/Point.h>
namespace PixelPaint {

View file

@ -45,7 +45,7 @@ public:
virtual void image_did_add_layer(size_t) { }
virtual void image_did_remove_layer(size_t) { }
virtual void image_did_modify_layer(size_t) { }
virtual void image_did_modify_layer_stack() {}
virtual void image_did_modify_layer_stack() { }
virtual void image_did_change() { }
};

View file

@ -29,8 +29,8 @@
#include "Layer.h"
#include "Tool.h"
#include <LibGUI/Painter.h>
#include <LibGfx/Rect.h>
#include <LibGfx/Palette.h>
#include <LibGfx/Rect.h>
namespace PixelPaint {

View file

@ -108,22 +108,28 @@ void MoveTool::on_context_menu(Layer& layer, GUI::ContextMenuEvent& event)
{
if (!m_context_menu) {
m_context_menu = GUI::Menu::construct();
m_context_menu->add_action(GUI::CommonActions::make_move_to_front_action([this](auto&) {
m_editor->image()->move_layer_to_front(*m_context_menu_layer);
m_editor->layers_did_change();
}, m_editor));
m_context_menu->add_action(GUI::CommonActions::make_move_to_back_action([this](auto&) {
m_editor->image()->move_layer_to_back(*m_context_menu_layer);
m_editor->layers_did_change();
}, m_editor));
m_context_menu->add_action(GUI::CommonActions::make_move_to_front_action(
[this](auto&) {
m_editor->image()->move_layer_to_front(*m_context_menu_layer);
m_editor->layers_did_change();
},
m_editor));
m_context_menu->add_action(GUI::CommonActions::make_move_to_back_action(
[this](auto&) {
m_editor->image()->move_layer_to_back(*m_context_menu_layer);
m_editor->layers_did_change();
},
m_editor));
m_context_menu->add_separator();
m_context_menu->add_action(GUI::Action::create("Delete layer", Gfx::Bitmap::load_from_file("/res/icons/16x16/delete.png"), [this](auto&) {
m_editor->image()->remove_layer(*m_context_menu_layer);
// FIXME: This should not be done imperatively here. Perhaps a Image::Client interface that ImageEditor can implement?
if (m_editor->active_layer() == m_context_menu_layer)
m_editor->set_active_layer(nullptr);
m_editor->layers_did_change();
}, m_editor));
m_context_menu->add_action(GUI::Action::create(
"Delete layer", Gfx::Bitmap::load_from_file("/res/icons/16x16/delete.png"), [this](auto&) {
m_editor->image()->remove_layer(*m_context_menu_layer);
// FIXME: This should not be done imperatively here. Perhaps a Image::Client interface that ImageEditor can implement?
if (m_editor->active_layer() == m_context_menu_layer)
m_editor->set_active_layer(nullptr);
m_editor->layers_did_change();
},
m_editor));
}
m_context_menu_layer = layer;
m_context_menu->popup(event.screen_position());

View file

@ -27,8 +27,8 @@
#pragma once
#include "Tool.h"
#include <LibGfx/Point.h>
#include <LibGUI/ActionGroup.h>
#include <LibGfx/Point.h>
namespace PixelPaint {

View file

@ -39,7 +39,6 @@ public:
private:
virtual const char* class_name() const override { return "PickerTool"; }
};
}

View file

@ -27,8 +27,8 @@
#pragma once
#include "Tool.h"
#include <LibGfx/Point.h>
#include <LibGUI/Forward.h>
#include <LibGfx/Point.h>
namespace PixelPaint {

View file

@ -40,14 +40,14 @@ public:
virtual const char* class_name() const = 0;
virtual void on_mousedown(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) {}
virtual void on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) {}
virtual void on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) {}
virtual void on_context_menu(Layer&, GUI::ContextMenuEvent&) {}
virtual void on_tool_button_contextmenu(GUI::ContextMenuEvent&) {}
virtual void on_second_paint(const Layer&, GUI::PaintEvent&) {}
virtual void on_keydown(GUI::KeyEvent&) {}
virtual void on_keyup(GUI::KeyEvent&) {}
virtual void on_mousedown(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) { }
virtual void on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) { }
virtual void on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) { }
virtual void on_context_menu(Layer&, GUI::ContextMenuEvent&) { }
virtual void on_tool_button_contextmenu(GUI::ContextMenuEvent&) { }
virtual void on_second_paint(const Layer&, GUI::PaintEvent&) { }
virtual void on_keydown(GUI::KeyEvent&) { }
virtual void on_keyup(GUI::KeyEvent&) { }
virtual bool is_move_tool() const { return false; }