Add Window::title getter on Windows and macOS

This commit is contained in:
Amr Bashir 2022-11-03 10:11:37 -07:00 committed by GitHub
parent a7a7cc64cd
commit 08f9e374e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 64 additions and 7 deletions

View file

@ -589,6 +589,11 @@ impl Window {
pub fn theme(&self) -> Option<Theme> {
x11_or_wayland!(match self; Window(window) => window.theme())
}
#[inline]
pub fn title(&self) -> String {
x11_or_wayland!(match self; Window(window) => window.title())
}
}
/// Hooks for X11 errors.

View file

@ -624,6 +624,11 @@ impl Window {
pub fn theme(&self) -> Option<Theme> {
None
}
#[inline]
pub fn title(&self) -> String {
String::new()
}
}
impl Drop for Window {

View file

@ -1551,4 +1551,9 @@ impl UnownedWindow {
pub fn theme(&self) -> Option<Theme> {
None
}
#[inline]
pub fn title(&self) -> String {
String::new()
}
}