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]
|
[dependencies]
|
||||||
i-slint-backend-winit = { version = "1.14.1", features = ["x11"] }
|
i-slint-backend-winit = { version = "1.14.1", features = ["x11"] }
|
||||||
slint = { version = "1.14.1", features = ["backend-winit"] }
|
slint = { version = "1.14.1", features = ["backend-winit"] }
|
||||||
winit = { version = "0.30.12", features = ["x11rb"] }
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
slint-build = "1.14.1"
|
slint-build = "1.14.1"
|
||||||
|
|||||||
19
src/main.rs
19
src/main.rs
@ -1,19 +1,18 @@
|
|||||||
|
use i_slint_backend_winit::{
|
||||||
|
Backend,
|
||||||
|
winit::platform::x11::{WindowAttributesExtX11, WindowType},
|
||||||
|
};
|
||||||
use slint::{LogicalPosition, LogicalSize};
|
use slint::{LogicalPosition, LogicalSize};
|
||||||
use i_slint_backend_winit::{Backend, winit};
|
|
||||||
|
|
||||||
slint::include_modules!();
|
slint::include_modules!();
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
use winit::platform::x11::{WindowAttributesExtX11, WindowType};
|
|
||||||
|
|
||||||
// Configure winit attributes before any Slint window is created.
|
// Configure winit attributes before any Slint window is created.
|
||||||
let backend = Backend::builder()
|
let backend = Backend::builder()
|
||||||
.with_window_attributes_hook(|attrs| {
|
.with_window_attributes_hook(|attrs| {
|
||||||
// Mark the X11 window as a dock so WMs treat it as a panel/topbar.
|
// Mark the X11 window as a dock so WMs treat it as a panel/topbar.
|
||||||
attrs
|
attrs.with_x11_window_type(vec![WindowType::Dock])
|
||||||
.with_x11_window_type(vec![WindowType::Dock])
|
// hide from taskbar / pagers (useful for panels)
|
||||||
// hide from taskbar / pagers (useful for panels)
|
//.with_skip_taskbar(true)
|
||||||
//.with_skip_taskbar(true)
|
|
||||||
})
|
})
|
||||||
.build()?;
|
.build()?;
|
||||||
|
|
||||||
@ -26,7 +25,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
ui.set_bar_width(bar_width);
|
ui.set_bar_width(bar_width);
|
||||||
ui.set_bar_height(bar_height);
|
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.window().set_position(LogicalPosition::new(0.0, 0.0));
|
||||||
|
|
||||||
ui.run()?;
|
ui.run()?;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user