From e77eccf7dbda29b22eec6286bc3a46162cb0fcc6 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Tue, 17 Dec 2019 12:23:10 +0000 Subject: [PATCH] action: Rename Level to View --- src/action.rs | 12 ++++++------ src/data.rs | 4 ++-- src/layout.rs | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/action.rs b/src/action.rs index 61660653..97e32dc7 100644 --- a/src/action.rs +++ b/src/action.rs @@ -6,8 +6,8 @@ use std::ffi::CString; #[derive(Debug, Clone, PartialEq)] pub struct KeySym(pub String); -/// Use to switch layouts -type Level = String; +/// Use to switch views +type View = String; /// Use to send modified keypresses #[derive(Debug, Clone, PartialEq)] @@ -20,12 +20,12 @@ pub enum Modifier { #[derive(Debug, Clone, PartialEq)] pub enum Action { /// Switch to this view - SetLevel(Level), + SetView(View), /// Switch to a view and latch - LockLevel { - lock: Level, + LockView { + lock: View, /// When unlocked by pressing it or emitting a key - unlock: Level, + unlock: View, }, /// Set this modifier TODO: release? SetModifier(Modifier), diff --git a/src/data.rs b/src/data.rs index c515abe1..0fa30751 100644 --- a/src/data.rs +++ b/src/data.rs @@ -522,7 +522,7 @@ fn create_action( match submission { SubmitData::Action( Action::SetView(view_name) - ) => ::action::Action::SetLevel( + ) => ::action::Action::SetView( filter_view_name( name, view_name.clone(), &view_names, warning_handler, @@ -530,7 +530,7 @@ fn create_action( ), SubmitData::Action(Action::Locking { lock_view, unlock_view - }) => ::action::Action::LockLevel { + }) => ::action::Action::LockView { lock: filter_view_name( name, lock_view.clone(), diff --git a/src/layout.rs b/src/layout.rs index 87a4f217..d9a255dc 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -698,10 +698,10 @@ impl Layout { // if used like key.borrow() :( let action = RefCell::borrow(key).action.clone(); let view_name = match action { - Action::SetLevel(name) => { + Action::SetView(name) => { Some(name.clone()) }, - Action::LockLevel { lock, unlock } => { + Action::LockView { lock, unlock } => { let locked = { let mut key = key.borrow_mut(); key.locked ^= true; @@ -900,7 +900,7 @@ mod test { pressed: PressType::Released, locked: false, keycodes: Vec::new(), - action: Action::SetLevel("default".into()), + action: Action::SetView("default".into()), })) }