Better icons: device/app icon chains, volume icons, app icon (#2)
This commit was merged in pull request #2.
This commit is contained in:
1 parent
f08f241edb
commit
02b08cb471
21 files changed
+658
-70
No files matched your search
+7
-15
@@ -60,7 +60,9 @@ pub(all) struct Row {
|
||||
id : Int32
|
||||
title : String
|
||||
subtitle : String
|
||||
icon_name : String
|
||||
/// Icon-theme names to try in order (see icons.mbt).
|
||||
icons : Array[String]
|
||||
volume_icon : String // speaker icon matching volume + mute
|
||||
volumes : Array[Double]
|
||||
percent : Double // linked slider value (cubic %)
|
||||
volume_text : String // "75% (-7.50 dB)"
|
||||
@@ -125,11 +127,12 @@ pub fn rows(state : State, tab : Tab) -> Array[Row] {
|
||||
id: n.id,
|
||||
title: display_title(n),
|
||||
subtitle,
|
||||
icon_name: if n.icon_name != "" {
|
||||
n.icon_name
|
||||
icons: if is_stream {
|
||||
stream_icon_chain(n)
|
||||
} else {
|
||||
default_icon(kind)
|
||||
device_icon_chain(n)
|
||||
},
|
||||
volume_icon: volume_icon(linked_percent(n.volumes), n.mute),
|
||||
volumes: n.volumes,
|
||||
percent: linked_percent(n.volumes),
|
||||
volume_text: if n.volumes.length() > 0 {
|
||||
@@ -150,17 +153,6 @@ pub fn rows(state : State, tab : Tab) -> Array[Row] {
|
||||
})
|
||||
}
|
||||
|
||||
///|
|
||||
fn default_icon(kind : NodeKind) -> String {
|
||||
match kind {
|
||||
Sink => "audio-speakers-symbolic"
|
||||
Source => "audio-input-microphone-symbolic"
|
||||
PlaybackStream => "audio-x-generic-symbolic"
|
||||
RecordStream => "audio-input-microphone-symbolic"
|
||||
Other => "audio-x-generic-symbolic"
|
||||
}
|
||||
}
|
||||
|
||||
///|
|
||||
/// Result of reconciling the rows shown on screen against new rows: which
|
||||
/// row ids to remove, which to add (with their index) and which to update.
|
||||
|
||||
Reference in new issue
Block a user