Skip to content

Commit

Permalink
feat: make virtual keyboard transparent
Browse files Browse the repository at this point in the history
  • Loading branch information
sundaram123krishnan committed Oct 12, 2024
1 parent 0ebf46a commit 06dba54
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions iced_examples/iced_virtualkeyboard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use iced_layershell::actions::{LayershellCustomActions, LayershellCustomActionsW
use iced_layershell::reexport::wl_keyboard::KeymapFormat;
use iced_layershell::reexport::{Anchor, KeyboardInteractivity};
use iced_layershell::settings::{LayerShellSettings, Settings, VirtualKeyboardSettings};
use iced_layershell::Application;
use iced_layershell::{Appearance, Application};
use std::collections::HashMap;
use std::ffi::CString;
use std::fs::File;
Expand Down Expand Up @@ -117,6 +117,13 @@ impl Application for KeyboardView {
}
}

fn style(&self, theme: &Self::Theme) -> Appearance {
use iced_layershell::Appearance;
Appearance {
background_color: Color::TRANSPARENT,
text_color: theme.palette().text,
}
}
fn view(&self) -> Element<'_, Self::Message, Self::Theme, Renderer> {
canvas(self).height(Length::Fill).width(Length::Fill).into()
}
Expand Down Expand Up @@ -225,7 +232,7 @@ impl canvas::Program<Message> for KeyboardView {
height: keyboard_height,
},
);
frame.fill(&keyboard, Color::from_rgb8(0xFF, 0xFF, 0xFF));
frame.fill(&keyboard, Color::TRANSPARENT);

let mut key_y: f32 = keyboard_top_pad + 5.0;

Expand Down

0 comments on commit 06dba54

Please sign in to comment.