···1313use crate::ui::theme::Theme;
1414use gpui::prelude::FluentBuilder;
1515use gpui::{
1616- div, img, px, App, Context, FontWeight, InteractiveElement, IntoElement,
1717- ObjectFit, ParentElement, Render, ScrollWheelEvent, StatefulInteractiveElement, Styled,
1818- StyledImage, Window,
1616+ div, img, px, App, Context, FontWeight, InteractiveElement, IntoElement, ObjectFit,
1717+ ParentElement, Render, ScrollWheelEvent, StatefulInteractiveElement, Styled, StyledImage,
1818+ Window,
1919};
20202121pub struct MiniPlayer;
···474474 theme.volume_slider_fill,
475475 px(4.0),
476476 )
477477- .on_seek(move |fraction, _window, cx| {
478478- let range = (VOLUME_MAX_DB - VOLUME_MIN_DB) as f32;
479479- let new_vol = (VOLUME_MIN_DB as f32
480480- + fraction * range)
481481- .round() as i32;
482482- let steps = {
483483- let current = state_ref.read(cx).volume;
484484- new_vol - current
485485- };
486486- if steps != 0 {
487487- state_ref.update(cx, |s, cx| {
488488- s.volume = new_vol;
489489- cx.notify();
490490- });
491491- rt.spawn(adjust_volume(steps));
492492- }
493493- })
477477+ .on_seek(
478478+ move |fraction, _window, cx| {
479479+ let range = (VOLUME_MAX_DB - VOLUME_MIN_DB) as f32;
480480+ let new_vol = (VOLUME_MIN_DB as f32
481481+ + fraction * range)
482482+ .round()
483483+ as i32;
484484+ let steps = {
485485+ let current = state_ref.read(cx).volume;
486486+ new_vol - current
487487+ };
488488+ if steps != 0 {
489489+ state_ref.update(cx, |s, cx| {
490490+ s.volume = new_vol;
491491+ cx.notify();
492492+ });
493493+ rt.spawn(adjust_volume(steps));
494494+ }
495495+ },
496496+ )
494497 }),
495498 )
496499 .child(
+1-1
gpui/src/ui/components/mod.rs
···66pub mod navbar;
77pub mod pages;
88pub mod search_input;
99-pub mod text_input;
109pub mod seek_bar;
1010+pub mod text_input;
1111pub mod titlebar;
12121313#[derive(Clone, Copy, PartialEq)]