Mark Key, StyleColor, StyleVar as non-exhaustive

Likely to have new things added - rest are all either fairly closed sets of things (up/down/left/right) or likely to require some intentional change from user (e.g DrawCmd)

Closes #695
This commit is contained in:
dbr 2023-01-13 14:06:44 +10:30
parent 2dd7a82c48
commit f44f8fe942
2 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ use crate::Ui;
#[repr(u32)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[allow(missing_docs)] // Self-describing
#[non_exhaustive]
pub enum Key {
Tab = sys::ImGuiKey_Tab,
LeftArrow = sys::ImGuiKey_LeftArrow,

View File

@ -212,6 +212,7 @@ impl IndexMut<StyleColor> for Style {
/// [`crate::Ui::show_demo_window`] until you spot it
#[repr(u32)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[non_exhaustive]
pub enum StyleColor {
/// Default color of text througout application
Text = sys::ImGuiCol_Text,
@ -500,6 +501,7 @@ impl std::error::Error for InvalidStyleColorValue {}
/// A temporary change in user interface style
#[derive(Copy, Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StyleVar {
/// Global alpha applies to everything
Alpha(f32),