diff --git a/build.rs b/build.rs
index 7ff2fa1..0feb24c 100644
--- a/build.rs
+++ b/build.rs
@@ -9,4 +9,9 @@ fn main() {
"src/resources/icons/resources.gresource.xml",
"src.icons.gresource",
);
+ glib_build_tools::compile_resources(
+ &["src/resources/style"],
+ "src/resources/style/resources.gresource.xml",
+ "src.style.gresource",
+ );
}
diff --git a/src/main.rs b/src/main.rs
index 3e6bc47..db7c682 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,10 +1,13 @@
+#![allow(non_snake_case)]
+
+use gtk::{Application, CssProvider, gio};
+use gtk::gdk::Display;
+use gtk::prelude::*;
+
+use crate::components::window::window::Window;
mod components;
-use gtk::prelude::*;
-use gtk::{gio, Application};
-use crate::components::window::window::Window;
-
const APP_ID: &str = "org.Xetibo.ReSet";
fn main() {
@@ -12,17 +15,32 @@ fn main() {
.expect("Failed to register resources.");
gio::resources_register_include!("src.icons.gresource")
.expect("Failed to register resources.");
+ gio::resources_register_include!("src.style.gresource")
+ .expect("Failed to register resources.");
let app = Application::builder().application_id(APP_ID).build();
app.connect_startup(move |_| {
adw::init().unwrap();
+ loadCss();
});
app.connect_activate(buildUI);
app.run();
}
+fn loadCss() {
+ let provider = CssProvider::new();
+ provider.load_from_resource("/org/Xetibo/ReSet/style/style.css");
+
+ gtk::style_context_add_provider_for_display(
+ &Display::default().expect("Could not connect to a display."),
+ &provider,
+ gtk::STYLE_PROVIDER_PRIORITY_APPLICATION,
+ );
+
+}
+
#[allow(non_snake_case)]
fn buildUI(app: &Application) {
let window = Window::new(app);
diff --git a/src/resources/resetBluetooth.ui b/src/resources/resetBluetooth.ui
index 9c5b737..5c09e6e 100644
--- a/src/resources/resetBluetooth.ui
+++ b/src/resources/resetBluetooth.ui
@@ -4,13 +4,14 @@
start
- 5
vertical
start
400
@@ -57,6 +59,10 @@
@@ -85,6 +92,10 @@
+ boxed-list
+
+ 5
+ 5
True
start
diff --git a/src/resources/resetBluetoothEntry.ui b/src/resources/resetBluetoothEntry.ui
index 5d629d1..c26999e 100644
--- a/src/resources/resetBluetoothEntry.ui
+++ b/src/resources/resetBluetoothEntry.ui
@@ -6,6 +6,7 @@
False
+ 5
input-mouse-symbolic
diff --git a/src/resources/resetMainWindow.ui b/src/resources/resetMainWindow.ui
index 5e22d44..63ff7af 100644
--- a/src/resources/resetMainWindow.ui
+++ b/src/resources/resetMainWindow.ui
@@ -86,6 +86,7 @@
+ resetClose
start
window-close-symbolic
5
diff --git a/src/resources/resetUI.cmb b/src/resources/resetUI.cmb
index e411a28..3288001 100644
--- a/src/resources/resetUI.cmb
+++ b/src/resources/resetUI.cmb
@@ -53,7 +53,7 @@
(4,64,"GtkLabel",None,63,None,None,None,None,None),
(4,65,"GtkScrolledWindow",None,63,None,None,None,1,None),
(4,66,"GtkViewport",None,65,None,None,None,None,None),
- (4,68,"GtkListBox","resetWifiList",66,None,None,None,1,None),
+ (4,69,"GtkListBox","resetWifiList",66,None,None,None,1,None),
(5,1,"GtkListBoxRow","resetWifiEntry",None,None,None,None,None,None),
(5,2,"GtkBox",None,1,None,None,None,None,None),
(5,4,"GtkLabel","resetWifiLabel",2,None,None,None,1,None),
@@ -158,6 +158,7 @@
(3,28,"GtkButton","icon-name","go-previous-symbolic-rtl",None,None,None,None,None,None,None,None,None),
(3,28,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(3,31,"GtkButton","icon-name","window-close-symbolic",None,None,None,None,None,None,None,None,None),
+ (3,31,"GtkWidget","css-classes","resetClose",None,None,None,None,None,None,None,None,None),
(3,31,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
(3,31,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(3,32,"GtkFlowBox","column-spacing","25",None,None,None,None,None,None,None,None,None),
@@ -187,15 +188,17 @@
(3,39,"GtkButton","label","About",None,None,None,None,None,None,None,None,None),
(4,7,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(4,7,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
- (4,7,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(4,7,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(4,7,"GtkWidget","width-request","400",None,None,None,None,None,None,None,None,None),
(4,42,"GtkButton","label","Advanced",None,None,None,None,None,None,None,None,None),
(4,42,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
+ (4,42,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(4,42,"GtkWidget","margin-top","5",None,None,None,None,None,None,None,None,None),
(4,42,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(4,54,"GtkListBox","show-separators","True",None,None,None,None,None,None,None,None,None),
+ (4,54,"GtkWidget","css-classes","boxed-list",None,None,None,None,None,None,None,None,None),
(4,54,"GtkWidget","margin-bottom","10",None,None,None,None,None,None,None,None,None),
+ (4,54,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(4,54,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(4,55,"GtkListBoxRow","selectable","False",None,None,None,None,None,None,None,None,None),
(4,56,"GtkListBoxRow","selectable","False",None,None,None,None,None,None,None,None,None),
@@ -218,10 +221,17 @@
(4,64,"GtkLabel","justify","right",None,None,None,None,None,None,None,None,None),
(4,64,"GtkLabel","label","Available networks",None,None,None,None,None,None,None,None,None),
(4,64,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
+ (4,64,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(4,65,"GtkScrolledWindow","propagate-natural-height","True",None,None,None,None,None,None,None,None,None),
- (4,68,"GtkListBox","show-separators","True",None,None,None,None,None,None,None,None,None),
- (4,68,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
+ (4,69,"GtkListBox","show-separators","True",None,None,None,None,None,None,None,None,None),
+ (4,69,"GtkWidget","css-classes","boxed-list",None,None,None,None,None,None,None,None,None),
+ (4,69,"GtkWidget","margin-bottom","10",None,None,None,None,None,None,None,None,None),
+ (4,69,"GtkWidget","margin-end","5",None,None,None,None,None,None,None,None,None),
+ (4,69,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
+ (4,69,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(5,1,"GtkListBoxRow","selectable","False",None,None,None,None,None,None,None,None,None),
+ (5,1,"GtkWidget","height-request","40",None,None,None,None,None,None,None,None,None),
+ (5,2,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(5,4,"GtkLabel","ellipsize","end",None,None,None,None,None,None,None,None,None),
(5,4,"GtkLabel","label","LoremIpsumInternet",None,None,None,None,None,None,None,None,None),
(5,4,"GtkLabel","single-line-mode","True",None,None,None,None,None,None,None,None,None),
@@ -230,7 +240,7 @@
(5,4,"GtkWidget","margin-end","10",None,None,None,None,None,None,None,None,None),
(5,4,"GtkWidget","width-request","200",None,None,None,None,None,None,None,None,None),
(5,5,"GtkButton","has-frame","False",None,None,None,None,None,None,None,None,None),
- (5,5,"GtkButton","icon-name","text-x-generic-symbolic",None,None,None,None,None,None,None,None,None),
+ (5,5,"GtkButton","icon-name","info-symbolic",None,None,None,None,None,None,None,None,None),
(5,5,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
(5,5,"GtkWidget","valign","center",None,None,None,None,None,None,None,None,None),
(5,6,"GtkBox","spacing","-1",None,None,None,None,None,None,None,None,None),
@@ -288,7 +298,6 @@
(8,23,"GtkLabel","label","Show Applications",None,None,None,None,None,None,None,None,None),
(10,1,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(10,1,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
- (10,1,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(10,1,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(10,1,"GtkWidget","width-request","400",None,None,None,None,None,None,None,None,None),
(10,18,"GtkButton","label","Advanced",None,None,None,None,None,None,None,None,None),
@@ -303,15 +312,25 @@
(10,44,"GtkLabel","justify","right",None,None,None,None,None,None,None,None,None),
(10,44,"GtkLabel","label","Connected devices",None,None,None,None,None,None,None,None,None),
(10,44,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
+ (10,44,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(10,45,"GtkListBox","show-separators","True",None,None,None,None,None,None,None,None,None),
+ (10,45,"GtkWidget","css-classes","boxed-list\n",None,None,None,None,None,None,None,None,None),
+ (10,45,"GtkWidget","margin-end","5",None,None,None,None,None,None,None,None,None),
+ (10,45,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(10,45,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(10,46,"GtkLabel","justify","right",None,None,None,None,None,None,None,None,None),
- (10,46,"GtkLabel","label","Available device",None,None,None,None,None,None,None,None,None),
+ (10,46,"GtkLabel","label","Available devices",None,None,None,None,None,None,None,None,None),
(10,46,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
+ (10,46,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(10,47,"GtkListBox","show-separators","True",None,None,None,None,None,None,None,None,None),
+ (10,47,"GtkWidget","css-classes","boxed-list\n",None,None,None,None,None,None,None,None,None),
+ (10,47,"GtkWidget","margin-end","5",None,None,None,None,None,None,None,None,None),
+ (10,47,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(10,47,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(10,48,"GtkListBox","show-separators","True",None,None,None,None,None,None,None,None,None),
+ (10,48,"GtkWidget","css-classes","boxed-list",None,None,None,None,None,None,None,None,None),
(10,48,"GtkWidget","margin-bottom","10",None,None,None,None,None,None,None,None,None),
+ (10,48,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(10,48,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(10,49,"GtkListBoxRow","selectable","False",None,None,None,None,None,None,None,None,None),
(10,50,"GtkWidget","height-request","40",None,None,None,None,None,None,None,None,None),
@@ -323,6 +342,7 @@
(10,52,"GtkWidget","margin-end","5",None,None,None,None,None,None,None,None,None),
(10,52,"GtkWidget","valign","center",None,None,None,None,None,None,None,None,None),
(11,1,"GtkListBoxRow","selectable","False",None,None,None,None,None,None,None,None,None),
+ (11,2,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(11,3,"GtkImage","icon-name","input-mouse-symbolic",None,None,None,None,None,None,None,None,None),
(11,3,"GtkWidget","margin-end","15",None,None,None,None,None,None,None,None,None),
(11,4,"GtkLabel","ellipsize","end",None,None,None,None,None,None,None,None,None),
diff --git a/src/resources/resetWiFi.ui b/src/resources/resetWiFi.ui
index 26359fe..e75b3fc 100644
--- a/src/resources/resetWiFi.ui
+++ b/src/resources/resetWiFi.ui
@@ -4,13 +4,14 @@
start
- 5
vertical
start
400
+ boxed-list
10
+ 5
True
start
@@ -72,6 +73,7 @@
start
right
Available networks
+ 5
@@ -81,6 +83,10 @@
+ boxed-list
+ 10
+ 5
+ 5
True
start
@@ -95,6 +101,7 @@
start
Advanced
+ 5
5
start
diff --git a/src/resources/resetWifiEntry.ui b/src/resources/resetWifiEntry.ui
index 122a9e8..166f40f 100644
--- a/src/resources/resetWifiEntry.ui
+++ b/src/resources/resetWifiEntry.ui
@@ -3,9 +3,11 @@
+ 40
False
+ 5
-1
diff --git a/src/resources/style/resources.gresource.xml b/src/resources/style/resources.gresource.xml
new file mode 100644
index 0000000..72592d3
--- /dev/null
+++ b/src/resources/style/resources.gresource.xml
@@ -0,0 +1,6 @@
+
+
+
+ style.css
+
+
diff --git a/src/resources/style/style.css b/src/resources/style/style.css
new file mode 100644
index 0000000..eac5068
--- /dev/null
+++ b/src/resources/style/style.css
@@ -0,0 +1,3 @@
+button.resetClose {
+ border-radius: 25px;
+}
\ No newline at end of file