mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
eedb4f6b2f
This needs more work and polish, but it's a step in a more pleasant and useful direction. Also turn QuickShow into a fully-fledged "application". (By that, I really just mean giving it its own Applications/ subdirectory.)
32 lines
791 B
C++
32 lines
791 B
C++
#pragma once
|
|
|
|
#include <LibGUI/GFrame.h>
|
|
|
|
class GLabel;
|
|
class QSLabel;
|
|
|
|
class QSWidget final : public GFrame {
|
|
public:
|
|
QSWidget(GWidget* parent);
|
|
virtual ~QSWidget() override;
|
|
|
|
void set_bitmap(NonnullRefPtr<GraphicsBitmap>);
|
|
|
|
Function<void(int)> on_scale_change;
|
|
|
|
private:
|
|
virtual void paint_event(GPaintEvent&) override;
|
|
virtual void resize_event(GResizeEvent&) override;
|
|
virtual void mousedown_event(GMouseEvent&) override;
|
|
virtual void mouseup_event(GMouseEvent&) override;
|
|
virtual void mousemove_event(GMouseEvent&) override;
|
|
virtual void mousewheel_event(GMouseEvent&) override;
|
|
|
|
void relayout();
|
|
|
|
RefPtr<GraphicsBitmap> m_bitmap;
|
|
Rect m_bitmap_rect;
|
|
int m_scale { 100 };
|
|
Point m_pan_origin;
|
|
Point m_pan_bitmap_origin;
|
|
};
|