mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:37:46 +00:00
WindowServer: Implement tile window overlay
This adds a tiling mode that will show a tile window overlay rather than immediately tiling a window, triggering window resizes.
This commit is contained in:
parent
035b0f9df6
commit
fe54a0ca27
15 changed files with 279 additions and 71 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibGfx/Painter.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <WindowServer/MultiScaleBitmaps.h>
|
||||
#include <WindowServer/Screen.h>
|
||||
|
||||
|
@ -27,6 +28,7 @@ public:
|
|||
virtual ~Overlay();
|
||||
|
||||
enum class ZOrder {
|
||||
SnapWindow,
|
||||
WindowGeometry,
|
||||
Dnd,
|
||||
WindowStackSwitch,
|
||||
|
@ -192,4 +194,26 @@ private:
|
|||
int const m_target_column;
|
||||
};
|
||||
|
||||
class TileWindowOverlay : public Overlay {
|
||||
public:
|
||||
TileWindowOverlay(Window&, Gfx::IntRect const&, Gfx::Palette&&);
|
||||
|
||||
virtual ZOrder zorder() const override { return ZOrder::SnapWindow; }
|
||||
virtual void render(Gfx::Painter&, Screen const&) override;
|
||||
|
||||
void set_overlay_rect(Gfx::IntRect const& rect)
|
||||
{
|
||||
set_rect(rect);
|
||||
}
|
||||
|
||||
void set_tiled_frame_rect(Gfx::IntRect const& rect) { m_tiled_frame_rect = rect; }
|
||||
Gfx::IntRect const& tiled_frame_rect() const { return m_tiled_frame_rect; }
|
||||
bool is_window(Window& window) const { return &m_window == &window; }
|
||||
|
||||
private:
|
||||
Window& m_window;
|
||||
Gfx::IntRect m_tiled_frame_rect;
|
||||
Gfx::Palette m_palette;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue