2021-02-08 18:37:25 +11:00
|
|
|
use cacao::layout::{Layout, LayoutConstraint};
|
2022-07-16 00:14:02 +10:00
|
|
|
use cacao::text::{Label, TextAlign};
|
2021-02-08 18:37:25 +11:00
|
|
|
use cacao::view::{View, ViewDelegate};
|
|
|
|
|
|
|
|
/// A blank advanced preferences view.
|
|
|
|
#[derive(Debug, Default)]
|
|
|
|
pub struct AdvancedPreferencesContentView {
|
2022-08-18 09:11:45 +10:00
|
|
|
label: Label,
|
2021-02-08 18:37:25 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
impl ViewDelegate for AdvancedPreferencesContentView {
|
|
|
|
const NAME: &'static str = "AdvancedPreferencesContentView";
|
2022-07-11 01:15:29 +10:00
|
|
|
|
2021-02-08 18:37:25 +11:00
|
|
|
fn did_load(&mut self, view: View) {
|
2022-07-16 00:14:02 +10:00
|
|
|
self.label
|
|
|
|
.set_text("And this is where advanced preferences would be... if we had any.");
|
2021-02-08 18:37:25 +11:00
|
|
|
self.label.set_text_alignment(TextAlign::Center);
|
|
|
|
view.add_subview(&self.label);
|
|
|
|
|
|
|
|
LayoutConstraint::activate(&[
|
|
|
|
self.label.top.constraint_equal_to(&view.top).offset(100.),
|
|
|
|
self.label.leading.constraint_equal_to(&view.leading).offset(16.),
|
|
|
|
self.label.trailing.constraint_equal_to(&view.trailing).offset(-16.),
|
2022-08-18 09:11:45 +10:00
|
|
|
self.label.bottom.constraint_equal_to(&view.bottom).offset(-100.),
|
2021-02-08 18:37:25 +11:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|