improv(display): replace flipped orientations with rotates

This commit is contained in:
Michael Aaron Murphy 2024-02-29 01:20:02 +01:00
parent d02a9f2f67
commit 1b4bfb619b
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
9 changed files with 19 additions and 77 deletions

View file

@ -204,8 +204,8 @@ impl page::Page<crate::pages::Message> for Page {
text::DISPLAY_REFRESH_RATE.as_str().into(),
text::DISPLAY_SCALE.as_str().into(),
text::ORIENTATION.as_str().into(),
text::ORIENTATION_LANDSCAPE.as_str().into(),
text::ORIENTATION_PORTRAIT.as_str().into(),
text::ORIENTATION_STANDARD.as_str().into(),
text::ORIENTATION_ROTATE_90.as_str().into(),
])
.view::<Page>(|_binder, page, _section| page.display_view()),
),
@ -364,10 +364,10 @@ impl Page {
}
self.cache.orientations = [
text::ORIENTATION_LANDSCAPE.as_str(),
text::ORIENTATION_PORTRAIT.as_str(),
text::ORIENTATION_LANDSCAPE_FLIPPED.as_str(),
text::ORIENTATION_PORTRAIT_FLIPPED.as_str(),
text::ORIENTATION_STANDARD.as_str(),
text::ORIENTATION_ROTATE_90.as_str(),
text::ORIENTATION_ROTATE_180.as_str(),
text::ORIENTATION_ROTATE_270.as_str(),
];
}
}
@ -449,8 +449,8 @@ impl Page {
Message::Orientation(match id {
0 => Transform::Normal,
1 => Transform::Rotate90,
2 => Transform::Flipped,
_ => Transform::Flipped90,
2 => Transform::Rotate180,
_ => Transform::Rotate270,
})
},
),
@ -544,8 +544,8 @@ impl Page {
self.cache.orientation_selected = match output.transform {
Some(Transform::Normal) => Some(0),
Some(Transform::Rotate90) => Some(1),
Some(Transform::Flipped) => Some(2),
Some(Transform::Flipped90) => Some(3),
Some(Transform::Rotate180) => Some(2),
Some(Transform::Rotate270) => Some(3),
_ => None,
};
self.cache.resolution_selected = None;
@ -605,7 +605,7 @@ impl Page {
self.cache.orientation_selected = match transform {
Transform::Normal => Some(0),
Transform::Rotate90 => Some(1),
Transform::Flipped => Some(2),
Transform::Rotate180 => Some(2),
_ => Some(3),
};

View file

@ -3,95 +3,63 @@
crate::cache_dynamic_lazy! {
pub static COLOR: String = fl!("color");
pub static COLOR_DEPTH: String = fl!("color", "depth");
pub static COLOR_PROFILE: String = fl!("color", "profile");
pub static COLOR_PROFILES: String = fl!("color", "sidebar");
pub static COLOR_TEMPERATURE: String = fl!("color", "temperature");
pub static DISPLAY: String = fl!("display");
pub static DISPLAY_ARRANGEMENT: String = fl!("display", "arrangement");
pub static DISPLAY_ARRANGEMENT_DESC: String = fl!("display", "arrangement-desc");
pub static DISPLAY_ENABLE: String = fl!("display", "enable");
pub static DISPLAY_EXTERNAL: String = fl!("display", "external");
pub static DISPLAY_LAPTOP: String = fl!("display", "laptop");
pub static DISPLAY_OPTIONS: String = fl!("display", "options");
pub static DISPLAY_REFRESH_RATE: String = fl!("display", "refresh-rate");
pub static DISPLAY_RESOLUTION: String = fl!("display", "resolution");
pub static DISPLAY_SCALE: String = fl!("display", "scale");
pub static GRAPHICS_MODE: String = fl!("graphics-mode");
pub static GRAPHICS_MODE_COMPUTE: String =
fl!("graphics-mode", "mode", mode = super::graphics::COMPUTE);
pub static GRAPHICS_MODE_COMPUTE_ENABLE: String =
fl!("graphics-mode", "enable", mode = super::graphics::COMPUTE);
pub static GRAPHICS_MODE_COMPUTE_DESC: String =
fl!("graphics-mode", "desc", mode = super::graphics::COMPUTE);
pub static GRAPHICS_MODE_HYBRID: String =
fl!("graphics-mode", "mode", mode = super::graphics::HYBRID);
pub static GRAPHICS_MODE_HYBRID_ENABLE: String =
fl!("graphics-mode", "enable", mode = super::graphics::HYBRID);
pub static GRAPHICS_MODE_HYBRID_DESC: String =
fl!("graphics-mode", "desc", mode = super::graphics::HYBRID);
pub static GRAPHICS_MODE_INTEGRATED: String =
fl!("graphics-mode", "mode", mode = super::graphics::INTEGRATED);
pub static GRAPHICS_MODE_INTEGRATED_ENABLE: String = fl!(
"graphics-mode",
"enable",
mode = super::graphics::INTEGRATED
);
pub static GRAPHICS_MODE_INTEGRATED_DESC: String =
fl!("graphics-mode", "desc", mode = super::graphics::INTEGRATED);
pub static GRAPHICS_MODE_NVIDIA: String =
fl!("graphics-mode", "mode", mode = super::graphics::NVIDIA);
pub static GRAPHICS_MODE_NVIDIA_ENABLE: String =
fl!("graphics-mode", "enable", mode = super::graphics::NVIDIA);
pub static GRAPHICS_MODE_NVIDIA_DESC: String =
fl!("graphics-mode", "desc", mode = super::graphics::NVIDIA);
pub static MIRRORING: String = fl!("mirroring");
pub static NIGHT_LIGHT: String = fl!("night-light");
pub static NIGHT_LIGHT_AUTO: String = fl!("night-light", "auto");
pub static NIGHT_LIGHT_DESCRIPTION: String = fl!("night-light", "desc");
pub static ORIENTATION: String = fl!("orientation");
pub static ORIENTATION_LANDSCAPE: String = fl!("orientation", "landscape");
pub static ORIENTATION_LANDSCAPE_FLIPPED: String = fl!("orientation", "landscape-flipped");
pub static ORIENTATION_PORTRAIT: String = fl!("orientation", "portrait");
pub static ORIENTATION_PORTRAIT_FLIPPED: String = fl!("orientation", "portrait-flipped");
pub static ORIENTATION_STANDARD: String = fl!("orientation", "standard");
pub static ORIENTATION_ROTATE_90: String = fl!("orientation", "rotate-90");
pub static ORIENTATION_ROTATE_180: String = fl!("orientation", "rotate-180");
pub static ORIENTATION_ROTATE_270: String = fl!("orientation", "rotate-270");
pub static SCHEDULING: String = fl!("scheduling");
pub static SCHEDULING_MANUAL: String = fl!("scheduling", "manual");
}