control-center: add color management pane
This commit is contained in:
parent
ba044793dc
commit
6f103eac88
4 changed files with 54 additions and 3 deletions
36
src/control_center/cc_color_management.rs
Normal file
36
src/control_center/cc_color_management.rs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
use {
|
||||
crate::{
|
||||
control_center::{ControlCenterInner, bool, grid, read_only_bool},
|
||||
state::State,
|
||||
},
|
||||
egui::Ui,
|
||||
std::rc::Rc,
|
||||
};
|
||||
|
||||
pub struct ColorManagementPane {
|
||||
state: Rc<State>,
|
||||
}
|
||||
|
||||
impl ControlCenterInner {
|
||||
pub fn create_color_management_pane(self: &Rc<Self>) -> ColorManagementPane {
|
||||
ColorManagementPane {
|
||||
state: self.state.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ColorManagementPane {
|
||||
pub fn title(&self, res: &mut String) {
|
||||
res.push_str("Color Management");
|
||||
}
|
||||
|
||||
pub fn show(&mut self, ui: &mut Ui) {
|
||||
let s = &self.state;
|
||||
grid(ui, "settings", |ui| {
|
||||
bool(ui, "Enabled", s.color_management_enabled.get(), |b| {
|
||||
s.set_color_management_enabled(b);
|
||||
});
|
||||
read_only_bool(ui, "Available", s.color_management_available());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ use {
|
|||
enum PaneName {
|
||||
Compositor,
|
||||
Idle,
|
||||
ColorManagement,
|
||||
}
|
||||
|
||||
impl PaneName {
|
||||
|
|
@ -17,6 +18,7 @@ impl PaneName {
|
|||
match self {
|
||||
PaneName::Compositor => "Compositor",
|
||||
PaneName::Idle => "Idle",
|
||||
PaneName::ColorManagement => "Color Management",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -45,6 +47,9 @@ impl ControlCenterInner {
|
|||
PaneType::Compositor(self.create_compositor_pane())
|
||||
}
|
||||
PaneName::Idle => PaneType::Idle(self.create_idle_pane()),
|
||||
PaneName::ColorManagement => {
|
||||
PaneType::ColorManagement(self.create_color_management_pane())
|
||||
}
|
||||
};
|
||||
self.open(tree, ty);
|
||||
ui.ctx().request_repaint();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue