Make ContentRectChanged event a non_exhaustive struct

Just to keep open the ability to add state to the event in the future
without needing an API break.
This commit is contained in:
Robert Bragg
2022-08-14 06:49:10 +01:00
parent a654f72f62
commit 206c8e2c84
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -241,7 +241,7 @@ impl AndroidAppInner {
MainEvent::RedrawNeeded {}
}
ffi::NativeAppGlueAppCmd_APP_CMD_CONTENT_RECT_CHANGED => {
MainEvent::ContentRectChanged
MainEvent::ContentRectChanged {}
}
ffi::NativeAppGlueAppCmd_APP_CMD_GAINED_FOCUS => {
MainEvent::GainedFocus
+2 -1
View File
@@ -137,7 +137,8 @@ pub enum MainEvent<'a> {
/// Command from main thread: the content area of the window has changed,
/// such as from the soft input window being shown or hidden. You can
/// get the new content rect by calling [`AndroidApp::content_rect()`]
ContentRectChanged,
#[non_exhaustive]
ContentRectChanged {},
/// Command from main thread: the app's activity window has gained
/// input focus.
+1 -1
View File
@@ -245,7 +245,7 @@ impl AndroidAppInner {
Some(MainEvent::RedrawNeeded {})
}
ffi::APP_CMD_CONTENT_RECT_CHANGED => {
Some(MainEvent::ContentRectChanged)
Some(MainEvent::ContentRectChanged {})
}
ffi::APP_CMD_GAINED_FOCUS => Some(MainEvent::GainedFocus),
ffi::APP_CMD_LOST_FOCUS => Some(MainEvent::LostFocus),