From 562d4871a179cdcf4291356437776627753cf80a Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Thu, 24 Aug 2023 22:33:36 -0400 Subject: [PATCH] Create padding within the content view --- kifu/gtk/resources/style.css | 4 +++- kifu/gtk/src/ui/home.rs | 5 ++++- kifu/gtk/src/ui/mod.rs | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/kifu/gtk/resources/style.css b/kifu/gtk/resources/style.css index c8af75c..4282dcd 100644 --- a/kifu/gtk/resources/style.css +++ b/kifu/gtk/resources/style.css @@ -1 +1,3 @@ -@define_color accent_color: @purple_5; +.content { + padding: 8px; +} diff --git a/kifu/gtk/src/ui/home.rs b/kifu/gtk/src/ui/home.rs index c9a166b..daf0691 100644 --- a/kifu/gtk/src/ui/home.rs +++ b/kifu/gtk/src/ui/home.rs @@ -131,7 +131,10 @@ impl Home { players.append(&white_player); *s.imp().white_player.borrow_mut() = Some(white_player.clone()); - let new_game_button = gtk::Button::builder().label(&view.start_game.label).build(); + let new_game_button = gtk::Button::builder() + .css_classes(vec!["suggested-action"]) + .label(&view.start_game.label) + .build(); s.append(&new_game_button); let library = Library::new(); diff --git a/kifu/gtk/src/ui/mod.rs b/kifu/gtk/src/ui/mod.rs index c1f1034..5b5bfcd 100644 --- a/kifu/gtk/src/ui/mod.rs +++ b/kifu/gtk/src/ui/mod.rs @@ -56,8 +56,8 @@ impl AppWindow { let provider = gtk::CssProvider::new(); provider.load_from_data(&stylesheet); - let content = window.style_context(); - content.add_provider(&provider, STYLE_PROVIDER_PRIORITY_USER); + let context = window.style_context(); + context.add_provider(&provider, STYLE_PROVIDER_PRIORITY_USER); let header = adw::HeaderBar::builder() .title_widget(>k::Label::new(Some("Kifu"))) @@ -74,7 +74,7 @@ impl AppWindow { header.pack_end(&hamburger); - let content = adw::Bin::new(); + let content = adw::Bin::builder().css_classes(vec!["content"]).build(); content.set_child(Some( &adw::StatusPage::builder().title("Nothing here").build(), ));