fix: padding, spacing, context menu style, and settings buttons
This commit is contained in:
parent
0a32d27c70
commit
941cbf546b
38 changed files with 694 additions and 538 deletions
|
|
@ -15,15 +15,17 @@ use cosmic::{
|
|||
menu_button, menu_control_padding, padded_control,
|
||||
token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate},
|
||||
},
|
||||
cctk::sctk::reexports::{calloop, protocols::xdg::shell::client::xdg_positioner::Anchor},
|
||||
cctk::sctk::reexports::calloop,
|
||||
cosmic_config::CosmicConfigEntry,
|
||||
cosmic_theme::Spacing,
|
||||
iced::{
|
||||
self,
|
||||
widget::{self, column, row, slider},
|
||||
window, Alignment, Length, Limits, Rectangle, Subscription,
|
||||
window, Alignment, Length, Limits, Subscription,
|
||||
},
|
||||
iced_runtime::core::alignment::Horizontal,
|
||||
iced_style::application,
|
||||
theme,
|
||||
widget::{button, divider, horizontal_space, icon, text, Column, Row},
|
||||
Element, Renderer, Theme,
|
||||
};
|
||||
|
|
@ -665,6 +667,9 @@ impl cosmic::Application for Audio {
|
|||
input.mute = value;
|
||||
}
|
||||
}
|
||||
sub_pulse::Event::DefaultSink(_) => {}
|
||||
sub_pulse::Event::DefaultSource(_) => {}
|
||||
sub_pulse::Event::CardInfo(_) => {}
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -735,16 +740,19 @@ impl cosmic::Application for Audio {
|
|||
}
|
||||
|
||||
fn view_window(&self, _id: window::Id) -> Element<Message> {
|
||||
let Spacing {
|
||||
space_xxs, space_s, ..
|
||||
} = theme::active().cosmic().spacing;
|
||||
|
||||
let audio_disabled = matches!(self.pulse_state, PulseState::Disconnected(_));
|
||||
let out_mute = self.current_output_mute();
|
||||
let in_mute = self.current_input_mute();
|
||||
|
||||
let mut audio_content = if audio_disabled {
|
||||
column![padded_control(
|
||||
text(fl!("disconnected"))
|
||||
text::title3(fl!("disconnected"))
|
||||
.width(Length::Fill)
|
||||
.horizontal_alignment(Horizontal::Center)
|
||||
.size(24)
|
||||
)]
|
||||
} else {
|
||||
column![
|
||||
|
|
@ -790,7 +798,7 @@ impl cosmic::Application for Audio {
|
|||
.spacing(12)
|
||||
.align_items(Alignment::Center)
|
||||
),
|
||||
padded_control(divider::horizontal::default()),
|
||||
padded_control(divider::horizontal::default()).padding([space_xxs, space_s]),
|
||||
revealer(
|
||||
self.is_open == IsOpen::Output,
|
||||
fl!("output"),
|
||||
|
|
@ -906,7 +914,8 @@ impl cosmic::Application for Audio {
|
|||
.into(),
|
||||
);
|
||||
|
||||
audio_content = audio_content.push(padded_control(divider::horizontal::default()));
|
||||
audio_content = audio_content
|
||||
.push(padded_control(divider::horizontal::default()).padding([space_xxs, space_s]));
|
||||
audio_content = audio_content.push(
|
||||
Row::with_children(elements)
|
||||
.align_items(Alignment::Center)
|
||||
|
|
@ -916,7 +925,7 @@ impl cosmic::Application for Audio {
|
|||
}
|
||||
let content = column![
|
||||
audio_content,
|
||||
padded_control(divider::horizontal::default()),
|
||||
padded_control(divider::horizontal::default()).padding([space_xxs, space_s]),
|
||||
padded_control(
|
||||
anim!(
|
||||
// toggler
|
||||
|
|
@ -928,9 +937,8 @@ impl cosmic::Application for Audio {
|
|||
)
|
||||
.text_size(14)
|
||||
.width(Length::Fill)
|
||||
)
|
||||
.padding([8, 24]),
|
||||
padded_control(divider::horizontal::default()),
|
||||
),
|
||||
padded_control(divider::horizontal::default()).padding([space_xxs, space_s]),
|
||||
menu_button(text::body(fl!("sound-settings"))).on_press(Message::OpenSettings)
|
||||
]
|
||||
.align_items(Alignment::Start)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue