diff --git a/Cargo.toml b/Cargo.toml index 9695b2c..c8d4f1e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reset" -version = "0.1.3" +version = "0.1.4" edition = "2021" description = "A wip universal Linux settings application." repository = "https://github.com/Xetibo/ReSet" diff --git a/src/components/window/reset_window.rs b/src/components/window/reset_window.rs index db84618..bc1d2ca 100644 --- a/src/components/window/reset_window.rs +++ b/src/components/window/reset_window.rs @@ -3,7 +3,7 @@ use adw::subclass::prelude::ObjectSubclassIsExt; use adw::BreakpointCondition; use glib::Object; use gtk::gio::ActionEntry; -use gtk::{gio, glib, AccessibleRole, Application, ListBoxRow, Orientation}; +use gtk::{gio, glib, AccessibleRole, Application, ListBoxRow, Orientation, StateFlags}; use gtk::{prelude::*, DirectionType}; use crate::components::window::handle_sidebar_click::*; @@ -242,14 +242,16 @@ impl ReSetWindow { connectivity_list, )); + let output = SidebarEntry::new( + "Output", + "audio-volume-high-symbolic", + Categories::Audio, + true, + HANDLE_VOLUME_CLICK, + ); + output.set_receives_default(true); let audio_list = vec![ - SidebarEntry::new( - "Output", - "audio-volume-high-symbolic", - Categories::Audio, - true, - HANDLE_VOLUME_CLICK, - ), + output, SidebarEntry::new( "Input", "audio-input-microphone-symbolic", @@ -320,7 +322,15 @@ impl ReSetWindow { for (main_entry, sub_entries) in sidebar_entries.iter() { self_imp.reset_sidebar_list.append(main_entry); for sub_entry in sub_entries { - self_imp.reset_sidebar_list.append(sub_entry); + // TODO change this to home when home offers dynamic selection + // this is just a placeholder for now, hence hardcoded + if &*sub_entry.imp().name.borrow() == "Output" { + self_imp.reset_sidebar_list.append(sub_entry); + sub_entry.grab_focus(); + sub_entry.set_state_flags(StateFlags::SELECTED, true); + } else { + self_imp.reset_sidebar_list.append(sub_entry); + } } let separator = gtk::Separator::builder() .margin_bottom(3) @@ -334,7 +344,7 @@ impl ReSetWindow { .selectable(false) .activatable(false) .can_target(false) - .focusable(false) + // .focusable(false) .accessible_role(AccessibleRole::Separator) .build(); // TODO how to simply skip this ? diff --git a/src/resources/resetMainWindow.ui b/src/resources/resetMainWindow.ui index 4451dd8..ae407c8 100644 --- a/src/resources/resetMainWindow.ui +++ b/src/resources/resetMainWindow.ui @@ -91,6 +91,7 @@ start + 39 Search (Ctrl + F) start diff --git a/src/resources/resetUI.cmb b/src/resources/resetUI.cmb index 16733be..1fd2a41 100644 --- a/src/resources/resetUI.cmb +++ b/src/resources/resetUI.cmb @@ -323,6 +323,7 @@ (3,18,"GtkWidget","margin-top","5",None,None,None,None,None,None,None,None,None), (3,19,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None), (3,20,"GtkSearchEntry","placeholder-text","Search (Ctrl + F)",None,None,None,None,None,None,None,None,None), + (3,20,"GtkWidget","height-request","39",None,None,None,None,None,None,None,None,None), (3,20,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None), (3,25,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None), (3,26,"GtkButton","icon-name","sidebar-show-symbolic",None,None,None,None,None,None,None,None,None),