Compare commits
3 commits
2f322774c9
...
d37ec6a19a
Author | SHA1 | Date | |
---|---|---|---|
d37ec6a19a | |||
f0f69b7323 | |||
48a5beb8b6 |
4 changed files with 19 additions and 15 deletions
|
@ -35,12 +35,12 @@ template $AudreyUiWindow: Adw.ApplicationWindow {
|
|||
vexpand: true;
|
||||
|
||||
Adw.ViewStackPage {
|
||||
icon-name: "media-optical-cd";
|
||||
title: _("Albums");
|
||||
icon-name: "folder-music-symbolic";
|
||||
title: _("Browse");
|
||||
|
||||
child: Adw.NavigationView {
|
||||
Adw.NavigationPage {
|
||||
title: _("Albums");
|
||||
title: _("Browse");
|
||||
vexpand: true;
|
||||
|
||||
child: Adw.ToolbarView {
|
||||
|
|
|
@ -17,15 +17,19 @@ mod imp {
|
|||
impl ObjectImpl for Application {}
|
||||
|
||||
impl ApplicationImpl for Application {
|
||||
// called once by the primary instance
|
||||
fn startup(&self) {
|
||||
self.parent_startup();
|
||||
ui::Window::new(self.obj().as_ref());
|
||||
}
|
||||
|
||||
// executed by the primary instance
|
||||
fn activate(&self) {
|
||||
self.parent_activate();
|
||||
match self.obj().active_window() {
|
||||
None => {
|
||||
let window = ui::Window::new(self.obj().as_ref());
|
||||
window.present();
|
||||
}
|
||||
Some(win) => win.present(),
|
||||
}
|
||||
self.obj()
|
||||
.active_window()
|
||||
.expect("no window was active")
|
||||
.present();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,6 @@ fn main() -> glib::ExitCode {
|
|||
|
||||
init_tracing();
|
||||
|
||||
ui::Playbar::ensure_type();
|
||||
ui::PlayQueue::ensure_type();
|
||||
|
||||
gtk::disable_setlocale();
|
||||
bindtextdomain("audrey", meson_config::LOCALEDIR).expect("failed to bind text domain");
|
||||
bind_textdomain_codeset("audrey", "UTF-8").expect("failed to bind textdomaincodeset");
|
||||
|
|
|
@ -176,7 +176,7 @@ mod imp {
|
|||
None => glib::ControlFlow::Break,
|
||||
Some(window) => {
|
||||
match window.imp().state.get() {
|
||||
State::Idle | State::FileLoading | State::Seeking => {},
|
||||
State::Idle | State::FileLoading | State::Seeking => {}
|
||||
State::Active => window.notify("time-pos"),
|
||||
other => unreachable!("{other:?}"),
|
||||
}
|
||||
|
@ -361,7 +361,10 @@ mod imp {
|
|||
match self.state.get() {
|
||||
State::Idle => 0.0,
|
||||
|
||||
State::FileLoading | State::FileEnded => self.song().unwrap().duration() as f64,
|
||||
State::FileLoading | State::FileEnded => self
|
||||
.song()
|
||||
.map(|song| song.duration() as f64)
|
||||
.unwrap_or(0.0),
|
||||
|
||||
State::FileLoaded | State::Active | State::Seeking => {
|
||||
self.mpv.get_property::<f64>("duration").unwrap()
|
||||
|
|
Loading…
Reference in a new issue