Skip to content

Commit

Permalink
Give my widgets CSS names properly
Browse files Browse the repository at this point in the history
  • Loading branch information
RealKC committed Dec 22, 2023
1 parent 8224bdd commit 956d7cf
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/appwindow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions src/editor/colourchooser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ mod underlying {

fn class_init(klass: &mut Self::Class) {
klass.set_layout_manager_type::<gtk4::BoxLayout>();
klass.set_css_name("kcshot-colour-chooser");
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/editor/colourchooserdialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions src/editor/colourwheel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ mod underlying {

fn class_init(klass: &mut Self::Class) {
klass.set_layout_manager_type::<gtk4::BinLayout>();
klass.set_css_name("tri-colour-wheel");
}

fn new() -> Self {
Expand Down
2 changes: 2 additions & 0 deletions src/editor/textdialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions src/editor/textdialog/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions src/editor/toolbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ mod underlying {

fn class_init(klass: &mut Self::Class) {
klass.set_layout_manager_type::<gtk4::BoxLayout>();
klass.set_css_name("kcshot-toolbar");

klass.bind_template();
klass.bind_template_callbacks();
Expand Down
1 change: 1 addition & 0 deletions src/editor/toolbar/toolbutton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ mod underlying {
fn class_init(klass: &mut Self::Class) {
klass.set_layout_manager_type::<gtk4::BinLayout>();
klass.set_accessible_role(gtk4::AccessibleRole::Button);
klass.set_css_name("kcshot-tool-button");

klass.bind_template();
klass.bind_template_callbacks();
Expand Down
2 changes: 2 additions & 0 deletions src/editor/underlying.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions src/settings_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 956d7cf

Please sign in to comment.