mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 03:02:49 +00:00
Add Window::GetWidth()
This commit is contained in:
parent
6815d8e017
commit
a34ffd8334
2 changed files with 9 additions and 0 deletions
|
@ -138,3 +138,10 @@ void Window::SetMargin(Anchor anchor, int32_t margin)
|
||||||
UpdateMargin();
|
UpdateMargin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Window::GetWidth() const
|
||||||
|
{
|
||||||
|
GdkRectangle rect{};
|
||||||
|
gdk_monitor_get_geometry(m_Monitor, &rect);
|
||||||
|
return rect.width;
|
||||||
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ public:
|
||||||
|
|
||||||
void SetMainWidget(std::unique_ptr<Widget>&& mainWidget);
|
void SetMainWidget(std::unique_ptr<Widget>&& mainWidget);
|
||||||
|
|
||||||
|
int GetWidth() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateMargin();
|
void UpdateMargin();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue