summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/AboutDialog.cpp6
-rw-r--r--Libraries/LibGUI/CMakeLists.txt6
-rw-r--r--Libraries/LibGUI/FilePicker.cpp2
-rw-r--r--Libraries/LibGUI/FilePicker.h4
-rw-r--r--Libraries/LibGUI/ImageWidget.cpp (renamed from Libraries/LibGUI/Image.cpp)18
-rw-r--r--Libraries/LibGUI/ImageWidget.h (renamed from Libraries/LibGUI/Image.h)8
-rw-r--r--Libraries/LibGUI/MessageBox.cpp4
7 files changed, 24 insertions, 24 deletions
diff --git a/Libraries/LibGUI/AboutDialog.cpp b/Libraries/LibGUI/AboutDialog.cpp
index 43d6ca4687..0d71698585 100644
--- a/Libraries/LibGUI/AboutDialog.cpp
+++ b/Libraries/LibGUI/AboutDialog.cpp
@@ -30,7 +30,7 @@
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
#include <LibGUI/Label.h>
-#include <LibGUI/Image.h>
+#include <LibGUI/ImageWidget.h>
#include <LibGUI/Widget.h>
#include <LibGfx/Font.h>
@@ -53,7 +53,7 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window
widget.set_layout<VerticalBoxLayout>();
widget.layout()->set_spacing(0);
- auto& banner_image = widget.add<GUI::Image>();
+ auto& banner_image = widget.add<GUI::ImageWidget>();
banner_image.load_from_file("/res/brand-banner.png");
auto& content_container = widget.add<Widget>();
@@ -72,7 +72,7 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window
icon_wrapper.set_preferred_size(32, 48);
icon_wrapper.set_layout<VerticalBoxLayout>();
- auto& icon_image = icon_wrapper.add<Image>();
+ auto& icon_image = icon_wrapper.add<ImageWidget>();
icon_image.set_bitmap(m_icon);
}
diff --git a/Libraries/LibGUI/CMakeLists.txt b/Libraries/LibGUI/CMakeLists.txt
index 57800506f0..fd32ff4b44 100644
--- a/Libraries/LibGUI/CMakeLists.txt
+++ b/Libraries/LibGUI/CMakeLists.txt
@@ -29,11 +29,11 @@ set(SOURCES
FontDatabase.cpp
Frame.cpp
GroupBox.cpp
- Icon.cpp
- IconView.cpp
- Image.cpp
INILexer.cpp
INISyntaxHighlighter.cpp
+ Icon.cpp
+ IconView.cpp
+ ImageWidget.cpp
InputBox.cpp
JsonArrayModel.cpp
JSSyntaxHighlighter.cpp
diff --git a/Libraries/LibGUI/FilePicker.cpp b/Libraries/LibGUI/FilePicker.cpp
index d8c7c3b5a2..e0ed09cf22 100644
--- a/Libraries/LibGUI/FilePicker.cpp
+++ b/Libraries/LibGUI/FilePicker.cpp
@@ -266,7 +266,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, Options options, const
m_preview_container->set_layout<VerticalBoxLayout>();
m_preview_container->layout()->set_margins({ 8, 8, 8, 8 });
- m_preview_image = m_preview_container->add<Image>();
+ m_preview_image = m_preview_container->add<ImageWidget>();
m_preview_image->set_should_stretch(true);
m_preview_image->set_auto_resize(false);
m_preview_image->set_preferred_size(160, 160);
diff --git a/Libraries/LibGUI/FilePicker.h b/Libraries/LibGUI/FilePicker.h
index 11956bf7eb..52bff3d664 100644
--- a/Libraries/LibGUI/FilePicker.h
+++ b/Libraries/LibGUI/FilePicker.h
@@ -30,7 +30,7 @@
#include <AK/Optional.h>
#include <LibCore/StandardPaths.h>
#include <LibGUI/Dialog.h>
-#include <LibGUI/Image.h>
+#include <LibGUI/ImageWidget.h>
#include <LibGUI/Model.h>
namespace GUI {
@@ -93,7 +93,7 @@ private:
RefPtr<TextBox> m_filename_textbox;
RefPtr<TextBox> m_location_textbox;
RefPtr<Frame> m_preview_container;
- RefPtr<Image> m_preview_image;
+ RefPtr<ImageWidget> m_preview_image;
RefPtr<Label> m_preview_name_label;
RefPtr<Label> m_preview_geometry_label;
Mode m_mode { Mode::Open };
diff --git a/Libraries/LibGUI/Image.cpp b/Libraries/LibGUI/ImageWidget.cpp
index 097e42a983..1110c62f13 100644
--- a/Libraries/LibGUI/Image.cpp
+++ b/Libraries/LibGUI/ImageWidget.cpp
@@ -24,15 +24,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "Image.h"
#include <AK/MappedFile.h>
+#include <LibGUI/Image.h>
#include <LibGUI/Painter.h>
#include <LibGfx/Bitmap.h>
#include <LibGfx/ImageDecoder.h>
namespace GUI {
-Image::Image(const StringView&)
+ImageWidget::ImageWidget(const StringView&)
: m_timer(Core::Timer::construct())
{
@@ -43,11 +43,11 @@ Image::Image(const StringView&)
set_auto_resize(true);
}
-Image::~Image()
+ImageWidget::~ImageWidget()
{
}
-void Image::set_bitmap(const Gfx::Bitmap* bitmap)
+void ImageWidget::set_bitmap(const Gfx::Bitmap* bitmap)
{
if (m_bitmap == bitmap)
return;
@@ -59,7 +59,7 @@ void Image::set_bitmap(const Gfx::Bitmap* bitmap)
update();
}
-void Image::set_auto_resize(bool value)
+void ImageWidget::set_auto_resize(bool value)
{
m_auto_resize = value;
@@ -67,7 +67,7 @@ void Image::set_auto_resize(bool value)
set_preferred_size(m_bitmap->width(), m_bitmap->height());
}
-void Image::animate()
+void ImageWidget::animate()
{
m_current_frame_index = (m_current_frame_index + 1) % m_image_decoder->frame_count();
@@ -86,7 +86,7 @@ void Image::animate()
}
}
-void Image::load_from_file(const StringView& path)
+void ImageWidget::load_from_file(const StringView& path)
{
MappedFile mapped_file(path);
if (!mapped_file.is_valid())
@@ -108,13 +108,13 @@ void Image::load_from_file(const StringView& path)
}
}
-void Image::mousedown_event(GUI::MouseEvent&)
+void ImageWidget::mousedown_event(GUI::MouseEvent&)
{
if (on_click)
on_click();
}
-void Image::paint_event(PaintEvent& event)
+void ImageWidget::paint_event(PaintEvent& event)
{
Frame::paint_event(event);
diff --git a/Libraries/LibGUI/Image.h b/Libraries/LibGUI/ImageWidget.h
index f78ab5ae44..6ee492ed50 100644
--- a/Libraries/LibGUI/Image.h
+++ b/Libraries/LibGUI/ImageWidget.h
@@ -31,10 +31,10 @@
namespace GUI {
-class Image : public Frame {
- C_OBJECT(Image)
+class ImageWidget : public Frame {
+ C_OBJECT(ImageWidget)
public:
- virtual ~Image() override;
+ virtual ~ImageWidget() override;
void set_bitmap(const Gfx::Bitmap*);
Gfx::Bitmap* bitmap() { return m_bitmap.ptr(); }
@@ -51,7 +51,7 @@ public:
Function<void()> on_click;
protected:
- explicit Image(const StringView& text = {});
+ explicit ImageWidget(const StringView& text = {});
virtual void mousedown_event(GUI::MouseEvent&) override;
virtual void paint_event(PaintEvent&) override;
diff --git a/Libraries/LibGUI/MessageBox.cpp b/Libraries/LibGUI/MessageBox.cpp
index 9af920a8c7..17fe1fc5b3 100644
--- a/Libraries/LibGUI/MessageBox.cpp
+++ b/Libraries/LibGUI/MessageBox.cpp
@@ -27,7 +27,7 @@
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
#include <LibGUI/Label.h>
-#include <LibGUI/Image.h>
+#include <LibGUI/ImageWidget.h>
#include <LibGUI/MessageBox.h>
#include <LibGfx/Font.h>
#include <stdio.h>
@@ -116,7 +116,7 @@ void MessageBox::build()
message_container.layout()->set_spacing(8);
if (m_type != Type::None) {
- auto& icon_image = message_container.add<Image>();
+ auto& icon_image = message_container.add<ImageWidget>();
icon_image.set_bitmap(icon());
if (icon())
icon_width = icon()->width();