mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 23:01:04 +02:00
Add truncate_popup_{artist,album,title}
to music
This commit is contained in:
parent
4fad5a4d18
commit
69ae4c2ac6
3 changed files with 61 additions and 22 deletions
|
@ -157,6 +157,21 @@ pub struct MusicModule {
|
|||
/// **Default**: `null`
|
||||
pub(crate) truncate: Option<TruncateMode>,
|
||||
|
||||
/// See [truncate options](module-level-options#truncate-mode).
|
||||
///
|
||||
/// **Default**: `null`
|
||||
pub(crate) truncate_popup_artist: Option<TruncateMode>,
|
||||
|
||||
/// See [truncate options](module-level-options#truncate-mode).
|
||||
///
|
||||
/// **Default**: `null`
|
||||
pub(crate) truncate_popup_album: Option<TruncateMode>,
|
||||
|
||||
/// See [truncate options](module-level-options#truncate-mode).
|
||||
///
|
||||
/// **Default**: `null`
|
||||
pub(crate) truncate_popup_title: Option<TruncateMode>,
|
||||
|
||||
/// See [layout options](module-level-options#layout)
|
||||
#[serde(default, flatten)]
|
||||
pub(crate) layout: LayoutConfig,
|
||||
|
|
|
@ -280,9 +280,21 @@ impl Module<Button> for MusicModule {
|
|||
let icons = self.icons;
|
||||
|
||||
let info_box = gtk::Box::new(Orientation::Vertical, 10);
|
||||
|
||||
let title_label = IconPrefixedLabel::new(&icons.track, None, &image_provider);
|
||||
if let Some(truncate) = self.truncate_popup_title {
|
||||
title_label.label.truncate(truncate);
|
||||
}
|
||||
|
||||
let album_label = IconPrefixedLabel::new(&icons.album, None, &image_provider);
|
||||
if let Some(truncate) = self.truncate_popup_album {
|
||||
album_label.label.truncate(truncate);
|
||||
}
|
||||
|
||||
let artist_label = IconPrefixedLabel::new(&icons.artist, None, &image_provider);
|
||||
if let Some(truncate) = self.truncate_popup_artist {
|
||||
artist_label.label.truncate(truncate);
|
||||
}
|
||||
|
||||
title_label.container.add_class("title");
|
||||
album_label.container.add_class("album");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue