android changes taken from ibaryshnikov

This commit is contained in:
Your Name 2025-05-14 23:27:12 +02:00
parent 50cc94d944
commit a6f4b5ac0a
7 changed files with 130 additions and 31 deletions

View file

@ -88,6 +88,10 @@ pub enum Action {
/// The amount of lines to scroll.
lines: i32,
},
/// Editor gained focus
Focus,
/// Editor lost focus
Blur,
}
impl Action {

View file

@ -164,25 +164,6 @@ impl Theme {
impl Default for Theme {
fn default() -> Self {
#[cfg(feature = "auto-detect-theme")]
{
use std::sync::LazyLock;
static DEFAULT: LazyLock<Theme> = LazyLock::new(|| {
match dark_light::detect()
.unwrap_or(dark_light::Mode::Unspecified)
{
dark_light::Mode::Dark => Theme::Dark,
dark_light::Mode::Light | dark_light::Mode::Unspecified => {
Theme::Light
}
}
});
DEFAULT.clone()
}
#[cfg(not(feature = "auto-detect-theme"))]
Theme::Light
}
}