👷 add more ids for styling

This commit is contained in:
Vladislav Nepogodin 2023-02-19 01:10:10 +04:00
parent 6c1fd2b120
commit 245c9ef2ae
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9
4 changed files with 27 additions and 3 deletions

View File

@ -55,7 +55,10 @@ impl ApplicationBrowser {
let app_browser_box = gtk::Box::new(gtk::Orientation::Vertical, 0); let app_browser_box = gtk::Box::new(gtk::Orientation::Vertical, 0);
app_browser_box.set_expand(true); app_browser_box.set_expand(true);
let child_name = "appBrowserpage";
let button_box = gtk::Box::new(gtk::Orientation::Horizontal, 10); let button_box = gtk::Box::new(gtk::Orientation::Horizontal, 10);
button_box.set_widget_name(child_name);
let advanced_button = gtk::ToggleButton::with_label("advanced"); let advanced_button = gtk::ToggleButton::with_label("advanced");
advanced_button.set_tooltip_text(Some("Toggle an extended selection of packages")); advanced_button.set_tooltip_text(Some("Toggle an extended selection of packages"));
advanced_button.connect_clicked(on_advanced_clicked); advanced_button.connect_clicked(on_advanced_clicked);

View File

@ -252,7 +252,11 @@ fn build_ui(application: &gtk::Application) {
stack.set_visible_child_name(&format!("{name}page")); stack.set_visible_child_name(&format!("{name}page"));
})); }));
let child_name =
format!("{}page", page.unwrap().path().file_name().unwrap().to_str().unwrap());
let grid = gtk::Grid::new(); let grid = gtk::Grid::new();
grid.set_widget_name(&child_name);
grid.attach(&back_btn, 0, 1, 1, 1); grid.attach(&back_btn, 0, 1, 1, 1);
grid.attach(&label, 1, 2, 1, 1); grid.attach(&label, 1, 2, 1, 1);
viewport.add(&grid); viewport.add(&grid);
@ -260,8 +264,6 @@ fn build_ui(application: &gtk::Application) {
scrolled_window.show_all(); scrolled_window.show_all();
let stack: gtk::Stack = builder.object("stack").unwrap(); let stack: gtk::Stack = builder.object("stack").unwrap();
let child_name =
format!("{}page", page.unwrap().path().file_name().unwrap().to_str().unwrap());
stack.add_named(&scrolled_window, &child_name); stack.add_named(&scrolled_window, &child_name);
} }

View File

@ -296,6 +296,13 @@ pub fn create_tweaks_page(builder: &Builder) {
let fixes_section_box = create_fixes_section(); let fixes_section_box = create_fixes_section();
let apps_section_box_opt = create_apps_section(); let apps_section_box_opt = create_apps_section();
let child_name = "tweaksBrowserpage";
options_section_box.set_widget_name(&format!("{child_name}_options"));
fixes_section_box.set_widget_name(&format!("{child_name}_fixes"));
if apps_section_box_opt.is_some() {
apps_section_box_opt.as_ref().unwrap().set_widget_name(&format!("{child_name}_apps"));
}
let grid = gtk::Grid::new(); let grid = gtk::Grid::new();
grid.set_hexpand(true); grid.set_hexpand(true);
grid.set_margin_start(10); grid.set_margin_start(10);
@ -304,6 +311,7 @@ pub fn create_tweaks_page(builder: &Builder) {
grid.set_margin_bottom(5); grid.set_margin_bottom(5);
grid.attach(&back_btn, 0, 1, 1, 1); grid.attach(&back_btn, 0, 1, 1, 1);
let box_collection = gtk::Box::new(gtk::Orientation::Vertical, 5); let box_collection = gtk::Box::new(gtk::Orientation::Vertical, 5);
box_collection.set_widget_name(child_name);
box_collection.pack_start(&options_section_box, false, false, 10); box_collection.pack_start(&options_section_box, false, false, 10);
box_collection.pack_start(&fixes_section_box, false, false, 10); box_collection.pack_start(&fixes_section_box, false, false, 10);
@ -319,7 +327,6 @@ pub fn create_tweaks_page(builder: &Builder) {
viewport.show_all(); viewport.show_all();
let stack: gtk::Stack = builder.object("stack").unwrap(); let stack: gtk::Stack = builder.object("stack").unwrap();
let child_name = "tweaksBrowserpage";
stack.add_named(&viewport, child_name); stack.add_named(&viewport, child_name);
} }

View File

@ -3,6 +3,18 @@ window {
border-bottom-right-radius: 7px; border-bottom-right-radius: 7px;
} }
#tweaksBrowserpage button {
padding: 5px 15px;
border: none;
border-radius: 5px 5px 5px 5px;
}
#appBrowserpage button {
padding: 5px 20px;
border: none;
border-radius: 5px 5px 5px 5px;
}
.homepage button { .homepage button {
transition: border 100ms ease-in-out; transition: border 100ms ease-in-out;
padding: 10px 30px; padding: 10px 30px;