diff --git a/src/app/commands/cmd_change_pixel_format.cpp b/src/app/commands/cmd_change_pixel_format.cpp index 2819a90f9..c3b56a013 100644 --- a/src/app/commands/cmd_change_pixel_format.cpp +++ b/src/app/commands/cmd_change_pixel_format.cpp @@ -244,7 +244,7 @@ public: factor()->Change.connect([this]{ onIndexParamChange(); }); advancedCheck()->Click.connect( - [this](ui::Event&){ + [this](){ advanced()->setVisible(advancedCheck()->isSelected()); expandWindow(sizeHint()); }); diff --git a/src/app/commands/cmd_color_quantization.cpp b/src/app/commands/cmd_color_quantization.cpp index 8965407f2..1fcf01d5d 100644 --- a/src/app/commands/cmd_color_quantization.cpp +++ b/src/app/commands/cmd_color_quantization.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2019-2021 Igara Studio S.A. +// Copyright (C) 2019-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -49,7 +49,7 @@ public: rgbmapAlgorithmPlaceholder()->addChild(&m_algoSelector); advancedCheck()->Click.connect( - [this](ui::Event&){ + [this](){ advanced()->setVisible(advancedCheck()->isSelected()); expandWindow(sizeHint()); }); diff --git a/src/app/commands/cmd_options.cpp b/src/app/commands/cmd_options.cpp index b54c8ad75..7d2343cf9 100644 --- a/src/app/commands/cmd_options.cpp +++ b/src/app/commands/cmd_options.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -327,7 +327,7 @@ public: if (m_pref.general.dataRecovery()) enableDataRecovery()->setSelected(true); enableDataRecovery()->Click.connect( - [this](Event&){ + [this](){ const bool state = enableDataRecovery()->isSelected(); keepEditedSpriteData()->setEnabled(state); keepEditedSpriteData()->setSelected(state); diff --git a/src/app/commands/cmd_sprite_properties.cpp b/src/app/commands/cmd_sprite_properties.cpp index 6377e3654..86b413701 100644 --- a/src/app/commands/cmd_sprite_properties.cpp +++ b/src/app/commands/cmd_sprite_properties.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -201,7 +201,7 @@ void SpritePropertiesCommand::onExecute(Context* context) window.colorProfile()->Change.connect(updateButtons); window.assignColorProfile()->Click.connect( - [&](Event&){ + [&](){ selectedColorProfile = window.colorProfile()->getSelectedItemIndex(); ContextWriter writer(context); @@ -214,7 +214,7 @@ void SpritePropertiesCommand::onExecute(Context* context) updateButtons(); }); window.convertColorProfile()->Click.connect( - [&](Event&){ + [&](){ selectedColorProfile = window.colorProfile()->getSelectedItemIndex(); ContextWriter writer(context); diff --git a/src/app/commands/filters/filter_window.cpp b/src/app/commands/filters/filter_window.cpp index d86be92f1..6b0a1b284 100644 --- a/src/app/commands/filters/filter_window.cpp +++ b/src/app/commands/filters/filter_window.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2020 Igara Studio S.A. +// Copyright (C) 2020-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -150,17 +150,17 @@ void FilterWindow::setNewTarget(Target target) m_targetButton.setTarget(target); } -void FilterWindow::onOk(Event& ev) +void FilterWindow::onOk() { m_okButton.closeWindow(); } -void FilterWindow::onCancel(Event& ev) +void FilterWindow::onCancel() { m_cancelButton.closeWindow(); } -void FilterWindow::onShowPreview(Event& ev) +void FilterWindow::onShowPreview() { restartPreview(); diff --git a/src/app/commands/filters/filter_window.h b/src/app/commands/filters/filter_window.h index 449891c89..f9c5e205e 100644 --- a/src/app/commands/filters/filter_window.h +++ b/src/app/commands/filters/filter_window.h @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2022 Igara Studio S.A. +// Copyright (C) 2022-2023 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This program is distributed under the terms of @@ -52,9 +52,9 @@ namespace app { // Returns the container where derived classes should put controls. ui::Widget* getContainer() { return &m_container; } - void onOk(ui::Event& ev); - void onCancel(ui::Event& ev); - void onShowPreview(ui::Event& ev); + void onOk(); + void onCancel(); + void onShowPreview(); void onTargetButtonChange(); void onTiledChange(); diff --git a/src/app/script/dialog_class.cpp b/src/app/script/dialog_class.cpp index 713c3f1d6..ad4158e71 100644 --- a/src/app/script/dialog_class.cpp +++ b/src/app/script/dialog_class.cpp @@ -558,7 +558,7 @@ int Dialog_button_base(lua_State* L, T** outputWidget = nullptr) auto dlg = get_obj(L, 1); Dialog_connect_signal( L, 1, widget->Click, - [dlg, widget](lua_State* L, Event&){ + [dlg, widget](lua_State* L){ if (widget->type() == ui::kButtonWidget) dlg->lastButton = widget; }); diff --git a/src/app/script/security.cpp b/src/app/script/security.cpp index 477b98860..934682e79 100644 --- a/src/app/script/security.cpp +++ b/src/app/script/security.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2019-2021 Igara Studio S.A. +// Copyright (C) 2019-2023 Igara Studio S.A. // Copyright (C) 2018 David Capello // // This program is distributed under the terms of @@ -167,7 +167,7 @@ bool ask_access(lua_State* L, }); dlg.full()->Click.connect( - [&dlg, &allowButtonText](ui::Event&){ + [&dlg, &allowButtonText](){ if (dlg.full()->isSelected()) { dlg.dontShow()->setSelected(true); dlg.dontShow()->setEnabled(false); diff --git a/src/app/ui/aseprite_update.cpp b/src/app/ui/aseprite_update.cpp index 4e4e44994..29ac4ada4 100644 --- a/src/app/ui/aseprite_update.cpp +++ b/src/app/ui/aseprite_update.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2021 Igara Studio S.A. +// Copyright (C) 2021-2023 Igara Studio S.A. // // This program is distributed under the terms of // the End-User License Agreement for Aseprite. @@ -22,8 +22,7 @@ AsepriteUpdate::AsepriteUpdate(std::string version) , m_timer(500, this) { okButton()->setEnabled(false); - okButton()->Click.connect([this](ui::Event&) { - }); + okButton()->Click.connect([this]() { }); m_timer.Tick.connect([this] { this->onTimerTick(); }); log(base::string_printf("Downloading Aseprite %s...", version.c_str())); @@ -213,4 +212,4 @@ void AsepriteUpdate::log(std::string text) layout(); } -} \ No newline at end of file +} diff --git a/src/app/ui/color_button.cpp b/src/app/ui/color_button.cpp index 06f083e1e..85767706c 100644 --- a/src/app/ui/color_button.cpp +++ b/src/app/ui/color_button.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2020-2022 Igara Studio S.A. +// Copyright (C) 2020-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -295,9 +295,9 @@ void ColorButton::onPaint(PaintEvent& ev) g->drawUIText(text(), textcolor, gfx::ColorNone, textrc.origin(), 0); } -void ColorButton::onClick(Event& ev) +void ColorButton::onClick() { - ButtonBase::onClick(ev); + ButtonBase::onClick(); // If the popup window was not created or shown yet.. if (!m_window || !m_window->isVisible()) { diff --git a/src/app/ui/color_button.h b/src/app/ui/color_button.h index 2400225df..32bec4e51 100644 --- a/src/app/ui/color_button.h +++ b/src/app/ui/color_button.h @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2021 Igara Studio S.A. +// Copyright (C) 2021-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -57,7 +57,7 @@ namespace app { bool onProcessMessage(ui::Message* msg) override; void onSizeHint(ui::SizeHintEvent& ev) override; void onPaint(ui::PaintEvent& ev) override; - void onClick(ui::Event& ev) override; + void onClick() override; void onStartDrag() override; void onSelectWhenDragging() override; void onLoadLayout(ui::LoadLayoutEvent& ev) override; diff --git a/src/app/ui/color_popup.cpp b/src/app/ui/color_popup.cpp index a21f2188c..6419c80a4 100644 --- a/src/app/ui/color_popup.cpp +++ b/src/app/ui/color_popup.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2020-2022 Igara Studio S.A. +// Copyright (C) 2020-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -66,7 +66,7 @@ public: } private: - void onClick(Event& ev) override { + void onClick() override { m_colorPopup->setColorWithSignal(m_color, ChangeType); } diff --git a/src/app/ui/context_bar.cpp b/src/app/ui/context_bar.cpp index b72a97c8c..d0b3e6100 100644 --- a/src/app/ui/context_bar.cpp +++ b/src/app/ui/context_bar.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -366,8 +366,8 @@ protected: setStyle(SkinTheme::get(this)->styles.miniCheckBox()); } - void onClick(Event& ev) override { - CheckBox::onClick(ev); + void onClick() override { + CheckBox::onClick(); Tool* tool = App::instance()->activeTool(); Preferences::instance().tool(tool).contiguous(isSelected()); @@ -904,7 +904,7 @@ private: buttonset.setSelectedItem(int(pos)); visible.Click.connect( - [&visible](Event&){ + [&visible](){ Preferences::instance().selection.pivotVisibility( visible.isSelected()); }); @@ -1249,8 +1249,8 @@ protected: setStyle(SkinTheme::get(this)->styles.miniCheckBox()); } - void onClick(Event& ev) override { - CheckBox::onClick(ev); + void onClick() override { + CheckBox::onClick(); Tool* tool = App::instance()->activeTool(); Preferences::instance().tool(tool).freehandAlgorithm( @@ -1386,8 +1386,8 @@ protected: setStyle(SkinTheme::get(this)->styles.miniCheckBox()); } - void onClick(Event& ev) override { - CheckBox::onClick(ev); + void onClick() override { + CheckBox::onClick(); auto atm = App::instance()->activeToolManager(); if (atm->quickTool() && diff --git a/src/app/ui/drop_down_button.cpp b/src/app/ui/drop_down_button.cpp index aa6a5ab71..b66320faf 100644 --- a/src/app/ui/drop_down_button.cpp +++ b/src/app/ui/drop_down_button.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2022 Igara Studio S.A. +// Copyright (C) 2022-2023 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This program is distributed under the terms of @@ -44,13 +44,13 @@ DropDownButton::DropDownButton(const char* text) initTheme(); } -void DropDownButton::onButtonClick(Event& ev) +void DropDownButton::onButtonClick() { // Fire "Click" signal. Click(); } -void DropDownButton::onDropDownButtonClick(Event& ev) +void DropDownButton::onDropDownButtonClick() { DropDownClick(); } diff --git a/src/app/ui/drop_down_button.h b/src/app/ui/drop_down_button.h index 055966ab8..2070def15 100644 --- a/src/app/ui/drop_down_button.h +++ b/src/app/ui/drop_down_button.h @@ -1,4 +1,5 @@ // Aseprite +// Copyright (C) 2023 Igara Studio S.A. // Copyright (C) 2001-2016 David Capello // // This program is distributed under the terms of @@ -29,8 +30,8 @@ namespace app { obs::signal DropDownClick; protected: - void onButtonClick(ui::Event& ev); - void onDropDownButtonClick(ui::Event& ev); + void onButtonClick(); + void onDropDownButtonClick(); private: ui::Button* m_button; diff --git a/src/app/ui/enter_license.cpp b/src/app/ui/enter_license.cpp index fe48378cd..7eb8a5220 100644 --- a/src/app/ui/enter_license.cpp +++ b/src/app/ui/enter_license.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2021 Igara Studio S.A. +// Copyright (C) 2021-2023 Igara Studio S.A. // // This program is distributed under the terms of // the End-User License Agreement for Aseprite. @@ -32,7 +32,7 @@ EnterLicense::EnterLicense() : m_timer(500, this), m_activationInProgress(false) }); okButton()->setEnabled(false); - okButton()->Click.connect([this](ui::Event&) { + okButton()->Click.connect([this]() { startActivation(); }); @@ -108,4 +108,4 @@ void EnterLicense::showSuccess() m_activationInProgress = false; } -} \ No newline at end of file +} diff --git a/src/app/ui/notifications.cpp b/src/app/ui/notifications.cpp index b4c2fc28e..a24f95a89 100644 --- a/src/app/ui/notifications.cpp +++ b/src/app/ui/notifications.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2020-2022 Igara Studio S.A. +// Copyright (C) 2020-2023 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This program is distributed under the terms of @@ -70,7 +70,7 @@ void Notifications::onPaint(PaintEvent& ev) g, m_flagStyle, clientBounds(), info); } -void Notifications::onClick(ui::Event& ev) +void Notifications::onClick() { m_red = false; invalidate(); diff --git a/src/app/ui/notifications.h b/src/app/ui/notifications.h index 31e8ffef9..03141434e 100644 --- a/src/app/ui/notifications.h +++ b/src/app/ui/notifications.h @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2020 Igara Studio S.A. +// Copyright (C) 2020-2023 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This program is distributed under the terms of @@ -29,7 +29,7 @@ namespace app { protected: void onSizeHint(ui::SizeHintEvent& ev) override; void onPaint(ui::PaintEvent& ev) override; - void onClick(ui::Event& ev) override; + void onClick() override; private: ui::Style* m_flagStyle; diff --git a/src/app/ui/palettes_listbox.cpp b/src/app/ui/palettes_listbox.cpp index 6ee7717aa..dac696934 100644 --- a/src/app/ui/palettes_listbox.cpp +++ b/src/app/ui/palettes_listbox.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2020-2022 Igara Studio S.A. +// Copyright (C) 2020-2023 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This program is distributed under the terms of @@ -74,8 +74,8 @@ class PalettesListItem : public ResourceListItem { setBgColor(theme->colors.listitemNormalFace()); } - void onClick(Event& ev) override { - IconButton::onClick(ev); + void onClick() override { + IconButton::onClick(); std::string::size_type j, i = m_comment.find("http"); if (i != std::string::npos) { diff --git a/src/app/ui/preview_editor.cpp b/src/app/ui/preview_editor.cpp index fe2a6988d..d21609719 100644 --- a/src/app/ui/preview_editor.cpp +++ b/src/app/ui/preview_editor.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -114,11 +114,11 @@ private: setupIcons(); } - void onClick(Event& ev) override { + void onClick() override { m_isPlaying = !m_isPlaying; setupIcons(); - Button::onClick(ev); + Button::onClick(); } void onSetDecorativeWidgetBounds() override { diff --git a/src/app/ui/task_widget.cpp b/src/app/ui/task_widget.cpp index 343f3c6c2..fd6eaa59f 100644 --- a/src/app/ui/task_widget.cpp +++ b/src/app/ui/task_widget.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2019-2022 Igara Studio S.A. +// Copyright (C) 2019-2023 Igara Studio S.A. // // This program is distributed under the terms of // the End-User License Agreement for Aseprite. @@ -33,7 +33,7 @@ TaskWidget::TaskWidget(const Type type, addChild(&m_cancelButton); m_cancelButton.Click.connect( - [this](Event&){ + [this](){ m_task.cancel(); m_cancelButton.setEnabled(false); m_progressBar.setEnabled(false); diff --git a/src/ui/button.cpp b/src/ui/button.cpp index 40c5a8591..2c52fe2be 100644 --- a/src/ui/button.cpp +++ b/src/ui/button.cpp @@ -1,5 +1,5 @@ // Aseprite UI Library -// Copyright (C) 2019-2021 Igara Studio S.A. +// Copyright (C) 2019-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This file is released under the terms of the MIT license. @@ -50,10 +50,10 @@ WidgetType ButtonBase::behaviorType() const return m_behaviorType; } -void ButtonBase::onClick(Event& ev) +void ButtonBase::onClick() { // Fire Click() signal - Click(ev); + Click(); } bool ButtonBase::onProcessMessage(Message* msg) @@ -147,8 +147,7 @@ bool ButtonBase::onProcessMessage(Message* msg) case kCheckWidget: { // Fire onClick() event - Event ev(this); - onClick(ev); + onClick(); return true; } @@ -212,8 +211,7 @@ bool ButtonBase::onProcessMessage(Message* msg) case kCheckWidget: { // Fire onClick() event - Event ev(this); - onClick(ev); + onClick(); invalidate(); } @@ -225,8 +223,7 @@ bool ButtonBase::onProcessMessage(Message* msg) setSelected(true); // Fire onClick() event - Event ev(this); - onClick(ev); + onClick(); } break; } @@ -260,8 +257,7 @@ void ButtonBase::generateButtonSelectSignal() setSelected(false); // Fire onClick() event - Event ev(this); - onClick(ev); + onClick(); } void ButtonBase::onStartDrag() diff --git a/src/ui/button.h b/src/ui/button.h index d30af6e8a..20663fd50 100644 --- a/src/ui/button.h +++ b/src/ui/button.h @@ -1,5 +1,5 @@ // Aseprite UI Library -// Copyright (C) 2021 Igara Studio S.A. +// Copyright (C) 2021-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This file is released under the terms of the MIT license. @@ -33,14 +33,14 @@ namespace ui { WidgetType behaviorType() const; // Signals - obs::signal Click; + obs::signal Click; protected: // Events bool onProcessMessage(Message* msg) override; // New events - virtual void onClick(Event& ev); + virtual void onClick(); virtual void onStartDrag(); virtual void onSelectWhenDragging(); diff --git a/src/ui/combobox.cpp b/src/ui/combobox.cpp index d36be4832..9e3d33820 100644 --- a/src/ui/combobox.cpp +++ b/src/ui/combobox.cpp @@ -1,5 +1,5 @@ // Aseprite UI Library -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This file is released under the terms of the MIT license. @@ -632,7 +632,7 @@ void ComboBoxListBox::onChange() } // When the mouse is clicked we switch the visibility-status of the list-box -void ComboBox::onButtonClick(Event& ev) +void ComboBox::onButtonClick() { switchListBox(); } diff --git a/src/ui/combobox.h b/src/ui/combobox.h index 42c2841f8..3873b7215 100644 --- a/src/ui/combobox.h +++ b/src/ui/combobox.h @@ -1,5 +1,5 @@ // Aseprite UI Library -// Copyright (C) 2019-2021 Igara Studio S.A. +// Copyright (C) 2019-2023 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This file is released under the terms of the MIT license. @@ -115,7 +115,7 @@ namespace ui { private: void updateListBoxPos(); - void onButtonClick(Event& ev); + void onButtonClick(); void filterMessages(); void removeMessageFilters(); void putSelectedItemAsCustomWidget(); diff --git a/src/ui/window.cpp b/src/ui/window.cpp index bd322db3a..0ee806f23 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -70,8 +70,8 @@ public: protected: - void onClick(Event& ev) override { - ButtonBase::onClick(ev); + void onClick() override { + ButtonBase::onClick(); closeWindow(); }