mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:47:44 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -75,7 +75,7 @@ bool ViewWidget::is_previous_available() const
|
|||
return false;
|
||||
}
|
||||
|
||||
Vector<String> ViewWidget::load_files_from_directory(const String& path) const
|
||||
Vector<String> ViewWidget::load_files_from_directory(String const& path) const
|
||||
{
|
||||
Vector<String> files_in_directory;
|
||||
|
||||
|
@ -90,7 +90,7 @@ Vector<String> ViewWidget::load_files_from_directory(const String& path) const
|
|||
return files_in_directory;
|
||||
}
|
||||
|
||||
void ViewWidget::set_path(const String& path)
|
||||
void ViewWidget::set_path(String const& path)
|
||||
{
|
||||
m_path = path;
|
||||
m_files_in_same_dir = load_files_from_directory(path);
|
||||
|
@ -151,7 +151,7 @@ void ViewWidget::mouseup_event(GUI::MouseEvent& event)
|
|||
GUI::AbstractZoomPanWidget::mouseup_event(event);
|
||||
}
|
||||
|
||||
void ViewWidget::load_from_file(const String& path)
|
||||
void ViewWidget::load_from_file(String const& path)
|
||||
{
|
||||
auto show_error = [&] {
|
||||
GUI::MessageBox::show(window(), String::formatted("Failed to open {}", path), "Cannot open image", GUI::MessageBox::Type::Error);
|
||||
|
@ -186,7 +186,7 @@ void ViewWidget::load_from_file(const String& path)
|
|||
on_image_change(m_bitmap);
|
||||
|
||||
if (m_decoded_image->is_animated && m_decoded_image->frames.size() > 1) {
|
||||
const auto& first_frame = m_decoded_image->frames[0];
|
||||
auto const& first_frame = m_decoded_image->frames[0];
|
||||
m_timer->set_interval(first_frame.duration);
|
||||
m_timer->on_timeout = [this] { animate(); };
|
||||
m_timer->start();
|
||||
|
@ -229,7 +229,7 @@ void ViewWidget::resize_window()
|
|||
window()->resize(new_size);
|
||||
}
|
||||
|
||||
void ViewWidget::set_bitmap(const Gfx::Bitmap* bitmap)
|
||||
void ViewWidget::set_bitmap(Gfx::Bitmap const* bitmap)
|
||||
{
|
||||
if (m_bitmap == bitmap)
|
||||
return;
|
||||
|
@ -246,7 +246,7 @@ void ViewWidget::animate()
|
|||
|
||||
m_current_frame_index = (m_current_frame_index + 1) % m_decoded_image->frames.size();
|
||||
|
||||
const auto& current_frame = m_decoded_image->frames[m_current_frame_index];
|
||||
auto const& current_frame = m_decoded_image->frames[m_current_frame_index];
|
||||
set_bitmap(current_frame.bitmap);
|
||||
|
||||
if ((int)current_frame.duration != m_timer->interval()) {
|
||||
|
|
|
@ -29,13 +29,13 @@ public:
|
|||
|
||||
virtual ~ViewWidget() override = default;
|
||||
|
||||
const Gfx::Bitmap* bitmap() const { return m_bitmap.ptr(); }
|
||||
const String& path() const { return m_path; }
|
||||
Gfx::Bitmap const* bitmap() const { return m_bitmap.ptr(); }
|
||||
String const& path() const { return m_path; }
|
||||
void set_toolbar_height(int height) { m_toolbar_height = height; }
|
||||
int toolbar_height() { return m_toolbar_height; }
|
||||
bool scaled_for_first_image() { return m_scaled_for_first_image; }
|
||||
void set_scaled_for_first_image(bool val) { m_scaled_for_first_image = val; }
|
||||
void set_path(const String& path);
|
||||
void set_path(String const& path);
|
||||
void resize_window();
|
||||
void set_scaling_mode(Gfx::Painter::ScalingMode);
|
||||
|
||||
|
@ -46,11 +46,11 @@ public:
|
|||
void flip(Gfx::Orientation);
|
||||
void rotate(Gfx::RotationDirection);
|
||||
void navigate(Directions);
|
||||
void load_from_file(const String&);
|
||||
void load_from_file(String const&);
|
||||
|
||||
Function<void()> on_doubleclick;
|
||||
Function<void(const GUI::DropEvent&)> on_drop;
|
||||
Function<void(const Gfx::Bitmap*)> on_image_change;
|
||||
Function<void(Gfx::Bitmap const*)> on_image_change;
|
||||
|
||||
private:
|
||||
ViewWidget();
|
||||
|
@ -60,9 +60,9 @@ private:
|
|||
virtual void mouseup_event(GUI::MouseEvent&) override;
|
||||
virtual void drop_event(GUI::DropEvent&) override;
|
||||
|
||||
void set_bitmap(const Gfx::Bitmap* bitmap);
|
||||
void set_bitmap(Gfx::Bitmap const* bitmap);
|
||||
void animate();
|
||||
Vector<String> load_files_from_directory(const String& path) const;
|
||||
Vector<String> load_files_from_directory(String const& path) const;
|
||||
|
||||
String m_path;
|
||||
RefPtr<Gfx::Bitmap> m_bitmap;
|
||||
|
|
|
@ -45,7 +45,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto app_icon = GUI::Icon::default_icon("filetype-image");
|
||||
|
||||
const char* path = nullptr;
|
||||
char const* path = nullptr;
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_positional_argument(path, "The image file to be displayed.", "file", Core::ArgsParser::Required::No);
|
||||
args_parser.parse(arguments);
|
||||
|
@ -244,7 +244,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
widget->set_scaling_mode(Gfx::Painter::ScalingMode::BilinearBlend);
|
||||
});
|
||||
|
||||
widget->on_image_change = [&](const Gfx::Bitmap* bitmap) {
|
||||
widget->on_image_change = [&](Gfx::Bitmap const* bitmap) {
|
||||
bool should_enable_image_actions = (bitmap != nullptr);
|
||||
bool should_enable_forward_actions = (widget->is_next_available() && should_enable_image_actions);
|
||||
bool should_enable_backward_actions = (widget->is_previous_available() && should_enable_image_actions);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue