From 9ee1fde65370454f12bdc49eed97f70caabeaadb Mon Sep 17 00:00:00 2001 From: scorpion-26 Date: Wed, 19 Jul 2023 01:05:33 +0200 Subject: [PATCH] Add GetHeight for Window --- src/Window.cpp | 7 +++++++ src/Window.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Window.cpp b/src/Window.cpp index a36564a..e6a9c10 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -145,3 +145,10 @@ int Window::GetWidth() const gdk_monitor_get_geometry(m_Monitor, &rect); return rect.width; } + +int Window::GetHeight() const +{ + GdkRectangle rect{}; + gdk_monitor_get_geometry(m_Monitor, &rect); + return rect.height; +} diff --git a/src/Window.h b/src/Window.h index a51a891..64ac667 100644 --- a/src/Window.h +++ b/src/Window.h @@ -33,7 +33,7 @@ public: void SetMainWidget(std::unique_ptr&& mainWidget); int GetWidth() const; - + int GetHeight() const; private: void UpdateMargin();