panel: Apply a hard limit of 1/2 height
This commit is contained in:
19
src/state.rs
19
src/state.rs
@ -241,16 +241,19 @@ impl Application {
|
|||||||
fn get_preferred_height(output: &OutputState) -> Option<u32> {
|
fn get_preferred_height(output: &OutputState) -> Option<u32> {
|
||||||
output.get_pixel_size()
|
output.get_pixel_size()
|
||||||
.map(|px_size| {
|
.map(|px_size| {
|
||||||
if px_size.width > px_size.height {
|
let height = {
|
||||||
px_size.width / 5
|
if px_size.width > px_size.height {
|
||||||
} else {
|
px_size.width / 5
|
||||||
if (px_size.width < 540) & (px_size.width > 0) {
|
|
||||||
px_size.width * 7 / 12 // to match 360×210
|
|
||||||
} else {
|
} else {
|
||||||
// Here we switch to wide layout, less height needed
|
if (px_size.width < 540) & (px_size.width > 0) {
|
||||||
px_size.width * 7 / 22
|
px_size.width * 7 / 12 // to match 360×210
|
||||||
|
} else {
|
||||||
|
// Here we switch to wide layout, less height needed
|
||||||
|
px_size.width * 7 / 22
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
cmp::min(height, px_size.height / 2)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user