Remove unwanted dependencies
- Remove `winit` from dependencies because it is already re-exported in `i-slint-backend-winit` - Cargo fmt and clippy fixes
This commit is contained in:
parent
04f2050af0
commit
7b82e65493
@ -9,7 +9,6 @@ readme = "README.md"
|
||||
[dependencies]
|
||||
i-slint-backend-winit = { version = "1.14.1", features = ["x11"] }
|
||||
slint = { version = "1.14.1", features = ["backend-winit"] }
|
||||
winit = { version = "0.30.12", features = ["x11rb"] }
|
||||
|
||||
[build-dependencies]
|
||||
slint-build = "1.14.1"
|
||||
|
||||
15
src/main.rs
15
src/main.rs
@ -1,17 +1,16 @@
|
||||
use i_slint_backend_winit::{
|
||||
Backend,
|
||||
winit::platform::x11::{WindowAttributesExtX11, WindowType},
|
||||
};
|
||||
use slint::{LogicalPosition, LogicalSize};
|
||||
use i_slint_backend_winit::{Backend, winit};
|
||||
|
||||
slint::include_modules!();
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
use winit::platform::x11::{WindowAttributesExtX11, WindowType};
|
||||
|
||||
// Configure winit attributes before any Slint window is created.
|
||||
let backend = Backend::builder()
|
||||
.with_window_attributes_hook(|attrs| {
|
||||
// Mark the X11 window as a dock so WMs treat it as a panel/topbar.
|
||||
attrs
|
||||
.with_x11_window_type(vec![WindowType::Dock])
|
||||
attrs.with_x11_window_type(vec![WindowType::Dock])
|
||||
// hide from taskbar / pagers (useful for panels)
|
||||
//.with_skip_taskbar(true)
|
||||
})
|
||||
@ -26,7 +25,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
ui.set_bar_width(bar_width);
|
||||
ui.set_bar_height(bar_height);
|
||||
|
||||
ui.window().set_size(LogicalSize::new(bar_width as f32, bar_height as f32));
|
||||
#[allow(clippy::cast_precision_loss)]
|
||||
ui.window()
|
||||
.set_size(LogicalSize::new(bar_width as f32, bar_height as f32));
|
||||
ui.window().set_position(LogicalPosition::new(0.0, 0.0));
|
||||
|
||||
ui.run()?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user