Add CSS provider for thumbnail grid styling
Load application CSS at startup with rounded corners for thumbnail frames and grid padding.
This commit is contained in:
@@ -137,7 +137,32 @@ fn setup_shortcuts(app: &adw::Application) {
|
||||
app.set_accels_for_action("win.show-shortcuts", &["<Control>question", "F1"]);
|
||||
}
|
||||
|
||||
fn load_css() {
|
||||
let provider = gtk::CssProvider::new();
|
||||
provider.load_from_string(
|
||||
r#"
|
||||
.thumbnail-frame {
|
||||
border-radius: 8px;
|
||||
background: @card_bg_color;
|
||||
}
|
||||
.thumbnail-grid {
|
||||
padding: 8px;
|
||||
}
|
||||
.thumbnail-check {
|
||||
opacity: 0.9;
|
||||
}
|
||||
"#,
|
||||
);
|
||||
gtk::style_context_add_provider_for_display(
|
||||
>k::gdk::Display::default().expect("Could not get default display"),
|
||||
&provider,
|
||||
gtk::STYLE_PROVIDER_PRIORITY_APPLICATION,
|
||||
);
|
||||
}
|
||||
|
||||
fn build_ui(app: &adw::Application) {
|
||||
load_css();
|
||||
|
||||
// Restore last-used wizard settings from session
|
||||
let sess = pixstrip_core::storage::SessionStore::new();
|
||||
let sess_state = sess.load().unwrap_or_default();
|
||||
|
||||
Reference in New Issue
Block a user