mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement file browser icon switch
This commit is contained in:
parent
e145e919a3
commit
2b4c9ca640
2 changed files with 12 additions and 1 deletions
|
|
@ -219,7 +219,7 @@ impl Request for Entry {
|
||||||
self.first_child().unwrap().remove_css_class("success"); // @TODO handle
|
self.first_child().unwrap().remove_css_class("success"); // @TODO handle
|
||||||
|
|
||||||
match primary_icon::from(&self.text()) {
|
match primary_icon::from(&self.text()) {
|
||||||
PrimaryIcon::Download { name, tooltip } => {
|
PrimaryIcon::Download { name, tooltip } | PrimaryIcon::File { name, tooltip } => {
|
||||||
self.set_primary_icon_activatable(false);
|
self.set_primary_icon_activatable(false);
|
||||||
self.set_primary_icon_sensitive(false);
|
self.set_primary_icon_sensitive(false);
|
||||||
self.set_primary_icon_name(Some(name));
|
self.set_primary_icon_name(Some(name));
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@ pub enum PrimaryIcon<'a> {
|
||||||
name: &'a str,
|
name: &'a str,
|
||||||
tooltip: &'a str,
|
tooltip: &'a str,
|
||||||
},
|
},
|
||||||
|
File {
|
||||||
|
name: &'a str,
|
||||||
|
tooltip: &'a str,
|
||||||
|
},
|
||||||
Gemini {
|
Gemini {
|
||||||
name: &'a str,
|
name: &'a str,
|
||||||
tooltip: (&'a str, &'a str),
|
tooltip: (&'a str, &'a str),
|
||||||
|
|
@ -31,6 +35,13 @@ pub fn from(request: &str) -> PrimaryIcon {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if prefix.starts_with("file:") {
|
||||||
|
return PrimaryIcon::File {
|
||||||
|
name: "drive-harddisk-symbolic", // `user-desktop-symbolic`
|
||||||
|
tooltip: ("Local browser"),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if prefix.starts_with("source:") {
|
if prefix.starts_with("source:") {
|
||||||
return PrimaryIcon::Source {
|
return PrimaryIcon::Source {
|
||||||
name: "applications-system-symbolic",
|
name: "applications-system-symbolic",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue