Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/app/apps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use iced::{
Alignment, Background,
Length::Fill,
alignment::Vertical,
border::Radius,
widget::{Button, Row, Text, container, image::Viewer},
};

Expand Down Expand Up @@ -105,7 +106,7 @@ impl App {
&& let Some(icon) = &self.icons
{
tile = tile
.push(Viewer::new(icon).height(35).width(35))
.push(container(Viewer::new(icon).height(35).width(35)).padding(5))
.align_y(Alignment::Center);
}

Expand Down Expand Up @@ -149,8 +150,15 @@ impl App {
.style(|_| iced::widget::container::Style {
text_color: Some(theme.text_color(1.)),
background: Some(Background::Color(theme.bg_color())),
border: iced::Border {
color: theme.text_color(0.5),
width: 0.1,
radius: Radius::new(0),
},
..Default::default()
})
.max_height(55)
.padding(5)
.width(Fill)
.height(Fill)
}
Expand Down
6 changes: 3 additions & 3 deletions src/haptics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use objc2_core_foundation::{CFNumber, CFNumberType, CFRetained, CFString, CFType};
use once_cell::sync::OnceCell;
use std::ffi::{CStr, c_char, c_void};
use std::ffi::{c_char, c_void};

#[allow(dead_code)]
#[derive(Copy, Clone, Debug)]
Expand Down Expand Up @@ -73,7 +73,7 @@ impl MtsState {
fn open_default_or_all() -> Option<Self> {
let mut iter: io_iterator_t = 0;
unsafe {
let name = CStr::from_bytes_with_nul_unchecked(b"AppleMultitouchDevice\0");
let name = c"AppleMultitouchDevice";
let matching = IOServiceMatching(name.as_ptr());
if matching.is_null() {
return None;
Expand Down Expand Up @@ -140,7 +140,7 @@ impl MtsState {
static MTS: OnceCell<Option<MtsState>> = OnceCell::new();

fn mts_state() -> Option<&'static MtsState> {
MTS.get_or_init(|| MtsState::open_default_or_all()).as_ref()
MTS.get_or_init(MtsState::open_default_or_all).as_ref()
}

pub fn perform_haptic(pattern: HapticPattern) -> bool {
Expand Down