From 956d7cf2bfa8f6fb1eb1c703d0d861cc667d5943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C8=9Bca=20Dumitru?= Date: Fri, 22 Dec 2023 17:55:00 +0200 Subject: [PATCH] Give my widgets CSS names properly --- src/appwindow.rs | 2 ++ src/editor/colourchooser.rs | 1 + src/editor/colourchooserdialog.rs | 2 ++ src/editor/colourwheel.rs | 1 + src/editor/textdialog.rs | 2 ++ src/editor/textdialog/text_input.rs | 2 ++ src/editor/toolbar.rs | 1 + src/editor/toolbar/toolbutton.rs | 1 + src/editor/underlying.rs | 2 ++ src/settings_window.rs | 2 ++ 10 files changed, 16 insertions(+) diff --git a/src/appwindow.rs b/src/appwindow.rs index 1a163cf..2266e43 100644 --- a/src/appwindow.rs +++ b/src/appwindow.rs @@ -70,6 +70,8 @@ mod underlying { type ParentType = gtk4::ApplicationWindow; fn class_init(klass: &mut Self::Class) { + klass.set_css_name("kcshot-app-window"); + klass.bind_template(); klass.bind_template_callbacks(); } diff --git a/src/editor/colourchooser.rs b/src/editor/colourchooser.rs index 63d7359..c5cff16 100644 --- a/src/editor/colourchooser.rs +++ b/src/editor/colourchooser.rs @@ -76,6 +76,7 @@ mod underlying { fn class_init(klass: &mut Self::Class) { klass.set_layout_manager_type::(); + klass.set_css_name("kcshot-colour-chooser"); } } diff --git a/src/editor/colourchooserdialog.rs b/src/editor/colourchooserdialog.rs index e599a3f..cb79d76 100644 --- a/src/editor/colourchooserdialog.rs +++ b/src/editor/colourchooserdialog.rs @@ -70,6 +70,8 @@ mod underlying { type ParentType = gtk4::Window; fn class_init(klass: &mut Self::Class) { + klass.set_css_name("kcshot-colour-chooser-dialog"); + klass.bind_template(); klass.bind_template_callbacks(); } diff --git a/src/editor/colourwheel.rs b/src/editor/colourwheel.rs index 665177b..2e57bfa 100644 --- a/src/editor/colourwheel.rs +++ b/src/editor/colourwheel.rs @@ -324,6 +324,7 @@ mod underlying { fn class_init(klass: &mut Self::Class) { klass.set_layout_manager_type::(); + klass.set_css_name("tri-colour-wheel"); } fn new() -> Self { diff --git a/src/editor/textdialog.rs b/src/editor/textdialog.rs index f8e3a79..f2e36c7 100644 --- a/src/editor/textdialog.rs +++ b/src/editor/textdialog.rs @@ -44,6 +44,8 @@ mod underlying { type ParentType = gtk4::Window; fn class_init(klass: &mut Self::Class) { + klass.set_css_name("kcshot-text-dialog"); + klass.bind_template(); klass.bind_template_callbacks(); } diff --git a/src/editor/textdialog/text_input.rs b/src/editor/textdialog/text_input.rs index 0fde2e8..9becacc 100644 --- a/src/editor/textdialog/text_input.rs +++ b/src/editor/textdialog/text_input.rs @@ -84,6 +84,8 @@ mod underlying { type ParentType = gtk4::Widget; fn class_init(klass: &mut Self::Class) { + klass.set_css_name("kcshot-text-input"); + klass.bind_template(); klass.bind_template_callbacks(); } diff --git a/src/editor/toolbar.rs b/src/editor/toolbar.rs index 9e7c903..dacb18f 100644 --- a/src/editor/toolbar.rs +++ b/src/editor/toolbar.rs @@ -99,6 +99,7 @@ mod underlying { fn class_init(klass: &mut Self::Class) { klass.set_layout_manager_type::(); + klass.set_css_name("kcshot-toolbar"); klass.bind_template(); klass.bind_template_callbacks(); diff --git a/src/editor/toolbar/toolbutton.rs b/src/editor/toolbar/toolbutton.rs index 4374dc5..a99d9d2 100644 --- a/src/editor/toolbar/toolbutton.rs +++ b/src/editor/toolbar/toolbutton.rs @@ -88,6 +88,7 @@ mod underlying { fn class_init(klass: &mut Self::Class) { klass.set_layout_manager_type::(); klass.set_accessible_role(gtk4::AccessibleRole::Button); + klass.set_css_name("kcshot-tool-button"); klass.bind_template(); klass.bind_template_callbacks(); diff --git a/src/editor/underlying.rs b/src/editor/underlying.rs index 87db4a5..b37d074 100644 --- a/src/editor/underlying.rs +++ b/src/editor/underlying.rs @@ -120,6 +120,8 @@ impl ObjectSubclass for EditorWindow { type ParentType = gtk4::ApplicationWindow; fn class_init(klass: &mut Self::Class) { + klass.set_css_name("kcshot-editor-window"); + klass.bind_template(); klass.bind_template_callbacks(); } diff --git a/src/settings_window.rs b/src/settings_window.rs index b8ae4f7..d92760b 100644 --- a/src/settings_window.rs +++ b/src/settings_window.rs @@ -42,6 +42,8 @@ mod underlying { type ParentType = gtk4::Window; fn class_init(klass: &mut Self::Class) { + klass.set_css_name("kcshot-settings-window"); + klass.bind_template(); klass.bind_template_callbacks(); }