fix: allow activating workspaces which are already active & improve styling
This commit is contained in:
parent
ef6e865963
commit
580df62e46
2 changed files with 7 additions and 8 deletions
|
|
@ -60,7 +60,7 @@ button.inactive:hover {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
background-color: darker(@view_bg_color);
|
background-color: darker(@view_bg_color);
|
||||||
background-image: none;
|
background-image: none;
|
||||||
color: @view_bg_color;
|
color: @view_fg_color;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
outline-color: transparent;
|
outline-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,20 +31,19 @@ impl WorkspaceButton {
|
||||||
let is_active = obj.active() == 0;
|
let is_active = obj.active() == 0;
|
||||||
let id = obj.id();
|
let id = obj.id();
|
||||||
let new_button = ToggleButton::with_label(&id);
|
let new_button = ToggleButton::with_label(&id);
|
||||||
new_button.set_sensitive(!is_active);
|
|
||||||
if obj.active() == 0 {
|
if obj.active() == 1 {
|
||||||
new_button.add_css_class("active");
|
|
||||||
} else if obj.active() == 1 {
|
|
||||||
new_button.add_css_class("alert");
|
new_button.add_css_class("alert");
|
||||||
|
} else if obj.active() == 0 {
|
||||||
|
new_button.add_css_class("active");
|
||||||
} else {
|
} else {
|
||||||
new_button.add_css_class("inactive");
|
new_button.add_css_class("inactive");
|
||||||
}
|
}
|
||||||
|
|
||||||
self.append(&new_button);
|
self.append(&new_button);
|
||||||
new_button.connect_clicked(move |_| {
|
new_button.connect_clicked(move |_| {
|
||||||
let id_clone = id.clone();
|
let id_clone = id.clone();
|
||||||
if !is_active {
|
let _ = TX.get().unwrap().send(WorkspaceEvent::Activate(id_clone));
|
||||||
let _ = TX.get().unwrap().send(WorkspaceEvent::Activate(id_clone));
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
imp.button.replace(new_button);
|
imp.button.replace(new_button);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue