1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Add Frame::set_window_title() (#828)

* Add `Frame::set_window_title()`

* Changelog and fmt for `Frame::set_window_title()`

Co-authored-by: Caleb Smith <caleb@myrvmail.com>
This commit is contained in:
Caleb Smith
2021-10-22 17:03:17 -05:00
committed by GitHub
parent 26c6cea117
commit 79d1ede496
6 changed files with 18 additions and 3 deletions

View File

@@ -279,6 +279,11 @@ impl<'a> Frame<'a> {
self.0.output.window_size = Some(size);
}
/// Set the desired title of the window.
pub fn set_window_title(&mut self, title: &str) {
self.0.output.window_title = Some(title.to_owned());
}
/// Set whether to show window decorations (i.e. a frame around you app).
/// If false it will be difficult to move and resize the app.
pub fn set_decorations(&mut self, decorated: bool) {
@@ -439,7 +444,7 @@ pub mod backend {
}
/// Action that can be taken by the user app.
#[derive(Clone, Copy, Debug, Default, PartialEq)]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct AppOutput {
/// Set to `true` to stop the app.
/// This does nothing for web apps.
@@ -448,6 +453,9 @@ pub mod backend {
/// Set to some size to resize the outer window (e.g. glium window) to this size.
pub window_size: Option<egui::Vec2>,
/// Set to some string to rename the outer window (e.g. glium window) to this title.
pub window_title: Option<String>,
/// Set to some bool to change window decorations
pub decorated: Option<bool>,