mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 14:51:30 +11:00
Merge pull request #773 from IvanUkhov/title
Generalize WindowBuilder::with_title
This commit is contained in:
commit
547161af27
|
@ -32,7 +32,7 @@ fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
let window = glutin::WindowBuilder::new()
|
let window = glutin::WindowBuilder::new()
|
||||||
.with_title("Hello world!".to_string())
|
.with_title("Hello world!")
|
||||||
.with_fullscreen(monitor)
|
.with_fullscreen(monitor)
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -63,8 +63,8 @@ impl<'a> WindowBuilder<'a> {
|
||||||
|
|
||||||
/// Requests a specific title for the window.
|
/// Requests a specific title for the window.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn with_title(mut self, title: String) -> WindowBuilder<'a> {
|
pub fn with_title<T: Into<String>>(mut self, title: T) -> WindowBuilder<'a> {
|
||||||
self.window.title = title;
|
self.window.title = title.into();
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue