add option to set background to fullscreen
This commit is contained in:
parent
a2fa0a439a
commit
be95c817dd
3 changed files with 15 additions and 4 deletions
|
@ -14,6 +14,7 @@ result=`echo -e "$option_reboot\n$option_suspend\n$option_shutdown\n$option_logo
|
||||||
--orientation horizontal \
|
--orientation horizontal \
|
||||||
--hide-search true \
|
--hide-search true \
|
||||||
--content-vcenter true \
|
--content-vcenter true \
|
||||||
|
--blurred-background-fullscreen true \
|
||||||
--blurred-background true `
|
--blurred-background true `
|
||||||
|
|
||||||
case "$result" in
|
case "$result" in
|
||||||
|
@ -45,5 +46,3 @@ case "$result" in
|
||||||
*)
|
*)
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -430,9 +430,16 @@ pub struct Config {
|
||||||
search_query: Option<String>,
|
search_query: Option<String>,
|
||||||
|
|
||||||
/// Blur the background of the screen
|
/// Blur the background of the screen
|
||||||
/// can be style via `background`
|
/// can be styled via `background`
|
||||||
#[clap(long = "blurred-background")]
|
#[clap(long = "blurred-background")]
|
||||||
blurred_background: Option<bool>,
|
blurred_background: Option<bool>,
|
||||||
|
|
||||||
|
/// Set the background to full screen.
|
||||||
|
/// Might look better for some things, but
|
||||||
|
/// there can only be one fullscreened app at the time.
|
||||||
|
/// Defaults to false.
|
||||||
|
#[clap(long = "blurred-background-fullscreen")]
|
||||||
|
blurred_background_fullscreen: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
|
@ -700,6 +707,11 @@ impl Config {
|
||||||
pub fn blurred_background(&self) -> bool {
|
pub fn blurred_background(&self) -> bool {
|
||||||
self.blurred_background.unwrap_or(false)
|
self.blurred_background.unwrap_or(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
|
pub fn blurred_background_fullscreen(&self) -> bool {
|
||||||
|
self.blurred_background_fullscreen.unwrap_or(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_false() -> bool {
|
fn default_false() -> bool {
|
||||||
|
|
|
@ -760,7 +760,7 @@ fn create_background(config: &Config) -> Option<ApplicationWindow> {
|
||||||
let background = ApplicationWindow::builder()
|
let background = ApplicationWindow::builder()
|
||||||
.decorated(false)
|
.decorated(false)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.fullscreened(false)
|
.fullscreened(config.blurred_background_fullscreen())
|
||||||
// arbitrary huge window so it fills the whole screen
|
// arbitrary huge window so it fills the whole screen
|
||||||
.default_width(100_000)
|
.default_width(100_000)
|
||||||
.default_height(100_000)
|
.default_height(100_000)
|
||||||
|
|
Loading…
Add table
Reference in a new issue