Compare commits
1 Commits
8e36091a19
...
962b507190
Author | SHA1 | Date |
---|---|---|
Savanni D'Gerinel | 962b507190 |
|
@ -339,7 +339,6 @@ dependencies = [
|
||||||
"geo-types",
|
"geo-types",
|
||||||
"gio",
|
"gio",
|
||||||
"glib",
|
"glib",
|
||||||
"glib-build-tools",
|
|
||||||
"gtk4",
|
"gtk4",
|
||||||
"ifc",
|
"ifc",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
|
|
@ -26,7 +26,3 @@ serde_json = { version = "1" }
|
||||||
serde = { version = "1" }
|
serde = { version = "1" }
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
unic-langid = { version = "0.9" }
|
unic-langid = { version = "0.9" }
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
glib-build-tools = "0.16"
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
fn main() {
|
|
||||||
glib_build_tools::compile_resources(
|
|
||||||
"resources",
|
|
||||||
"resources/gresources.xml",
|
|
||||||
"com.luminescent-dreams.dashboard.gresource",
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<gresources>
|
|
||||||
<gresource prefix="/com/luminescent-dreams/dashboard/">
|
|
||||||
<file>style.css</file>
|
|
||||||
</gresource>
|
|
||||||
</gresources>
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
@define-color background_color @purple_5;
|
|
||||||
|
|
||||||
label {
|
|
||||||
font-size: 200%;
|
|
||||||
}
|
|
|
@ -3,8 +3,7 @@ use crate::{
|
||||||
types::State,
|
types::State,
|
||||||
};
|
};
|
||||||
use adw::prelude::AdwApplicationWindowExt;
|
use adw::prelude::AdwApplicationWindowExt;
|
||||||
use gio::resources_lookup_data;
|
use gtk::prelude::*;
|
||||||
use gtk::{prelude::*, STYLE_PROVIDER_PRIORITY_USER};
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct ApplicationWindow {
|
pub struct ApplicationWindow {
|
||||||
|
@ -19,21 +18,6 @@ impl ApplicationWindow {
|
||||||
pub fn new(app: &adw::Application) -> Self {
|
pub fn new(app: &adw::Application) -> Self {
|
||||||
let window = adw::ApplicationWindow::new(app);
|
let window = adw::ApplicationWindow::new(app);
|
||||||
|
|
||||||
let stylesheet = String::from_utf8(
|
|
||||||
resources_lookup_data(
|
|
||||||
"/com/luminescent-dreams/dashboard/style.css",
|
|
||||||
gio::ResourceLookupFlags::NONE,
|
|
||||||
)
|
|
||||||
.expect("stylesheet should just be available")
|
|
||||||
.to_vec(),
|
|
||||||
)
|
|
||||||
.expect("to parse stylesheet");
|
|
||||||
|
|
||||||
let provider = gtk::CssProvider::new();
|
|
||||||
provider.load_from_data(&stylesheet);
|
|
||||||
let context = window.style_context();
|
|
||||||
context.add_provider(&provider, STYLE_PROVIDER_PRIORITY_USER);
|
|
||||||
|
|
||||||
let layout = gtk::Box::builder()
|
let layout = gtk::Box::builder()
|
||||||
.orientation(gtk::Orientation::Vertical)
|
.orientation(gtk::Orientation::Vertical)
|
||||||
.hexpand(true)
|
.hexpand(true)
|
||||||
|
@ -49,6 +33,8 @@ impl ApplicationWindow {
|
||||||
.margin_start(8)
|
.margin_start(8)
|
||||||
.margin_end(8)
|
.margin_end(8)
|
||||||
.build();
|
.build();
|
||||||
|
next_event.add_css_class("card");
|
||||||
|
next_event.add_css_class("activatable");
|
||||||
layout.append(&next_event);
|
layout.append(&next_event);
|
||||||
|
|
||||||
let transit_card = TransitCard::new();
|
let transit_card = TransitCard::new();
|
||||||
|
|
|
@ -38,6 +38,8 @@ glib::wrapper! {
|
||||||
impl Date {
|
impl Date {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let s: Self = Object::builder().build();
|
let s: Self = Object::builder().build();
|
||||||
|
s.add_css_class("card");
|
||||||
|
s.add_css_class("activatable");
|
||||||
s.set_margin_bottom(8);
|
s.set_margin_bottom(8);
|
||||||
s.set_margin_top(8);
|
s.set_margin_top(8);
|
||||||
s.set_margin_start(8);
|
s.set_margin_start(8);
|
||||||
|
|
|
@ -70,9 +70,6 @@ pub struct Core {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
gio::resources_register_include!("com.luminescent-dreams.dashboard.gresource")
|
|
||||||
.expect("Failed to register resources");
|
|
||||||
|
|
||||||
let app = adw::Application::builder()
|
let app = adw::Application::builder()
|
||||||
.application_id("com.luminescent-dreams.dashboard")
|
.application_id("com.luminescent-dreams.dashboard")
|
||||||
.resource_base_path("/com/luminescent-dreams/dashboard")
|
.resource_base_path("/com/luminescent-dreams/dashboard")
|
||||||
|
|
Loading…
Reference in New Issue