pika-drivers/src/main.rs

47 lines
1.2 KiB
Rust
Raw Normal View History

2024-02-21 22:35:49 +03:00
mod save_window_size;
mod build_ui;
use std::collections::HashMap;
2023-06-29 20:39:35 +03:00
use std::process::Command;
2023-07-01 15:40:07 +03:00
use std::thread;
2023-06-29 20:39:35 +03:00
use gtk::prelude::*;
use gtk::*;
2023-07-02 14:59:49 +03:00
use gtk::prelude::*;
2023-06-29 20:39:35 +03:00
use glib::*;
2023-07-02 14:59:49 +03:00
use adw::*;
2023-06-30 18:01:45 +01:00
use gdk::Display;
2023-07-02 14:59:49 +03:00
use adw::prelude::*;
2023-07-01 02:20:39 +03:00
2024-02-21 22:35:49 +03:00
#[derive(PartialEq, Debug, Eq, Hash, Clone, Ord, PartialOrd)]
pub struct DriverPackage {
driver: String,
version: String,
device: String,
description: String,
icon: String,
}
2023-07-01 02:20:39 +03:00
const PROJECT_VERSION: &str = env!("CARGO_PKG_VERSION");
2024-02-21 22:35:49 +03:00
use build_ui::build_ui;
2023-06-29 20:39:35 +03:00
fn main() {
2023-07-02 14:59:49 +03:00
let application = adw::Application::new(Some("com.pika.drivers"), Default::default());
2023-06-30 18:01:45 +01:00
application.connect_startup(|app| {
// The CSS "magic" happens here.
let provider = CssProvider::new();
2023-07-01 02:39:34 +03:00
provider.load_from_data(include_str!("style.css"));
2023-06-30 18:01:45 +01:00
// We give the CssProvided to the default screen so the CSS rules we added
// can be applied to our window.
gtk::style_context_add_provider_for_display(
&Display::default().expect("Could not connect to a display."),
&provider,
STYLE_PROVIDER_PRIORITY_APPLICATION,
);
app.connect_activate(build_ui);
});
application.run();
2023-06-29 20:39:35 +03:00
}