Basic UI work
This commit is contained in:
parent
ba677af0f4
commit
9ed29eab94
6 changed files with 77 additions and 7 deletions
|
|
@ -1,7 +1,16 @@
|
|||
use gtk4::{
|
||||
gdk::Display, gio::ApplicationFlags, prelude::*, CssProvider, StyleContext,
|
||||
STYLE_PROVIDER_PRIORITY_APPLICATION,
|
||||
};
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#[macro_use]
|
||||
extern crate relm4_macros;
|
||||
|
||||
pub mod task;
|
||||
pub mod ui;
|
||||
|
||||
use gtk4::{gio::ApplicationFlags, prelude::*, Orientation};
|
||||
use once_cell::sync::Lazy;
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
static RT: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("failed to build tokio runtime"));
|
||||
|
||||
fn main() {
|
||||
let application = gtk4::Application::new(
|
||||
|
|
@ -17,6 +26,21 @@ fn build_ui(application: >k4::Application) {
|
|||
.application(application)
|
||||
.title("COSMIC Network Applet")
|
||||
.default_width(400)
|
||||
.default_height(600)
|
||||
.default_height(300)
|
||||
.build();
|
||||
|
||||
view! {
|
||||
main_box = gtk4::Box {
|
||||
set_orientation: Orientation::Vertical,
|
||||
set_spacing: 20,
|
||||
set_margin_top: 20,
|
||||
set_margin_bottom: 20,
|
||||
set_margin_start: 24,
|
||||
set_margin_end: 24
|
||||
}
|
||||
}
|
||||
ui::toggles::add_toggles(&main_box);
|
||||
window.set_child(Some(&main_box));
|
||||
|
||||
window.show();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue