Skip to content

Commit 36e58ca

Browse files
committed
remove scrollbar from scrollables
1 parent bbc593c commit 36e58ca

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

src/apps/mod.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::collections::HashMap;
2+
use std::ops::Mul;
23
use std::path::Path;
34
use std::path::PathBuf;
45
use std::sync::LazyLock;
@@ -212,7 +213,8 @@ impl AppModule {
212213
score += 2;
213214
}
214215
if let Some(raw_freq) = self.app_frequencies.get(&app.name) {
215-
score += (*raw_freq as f32).ln().max(0.0).floor() as i32;
216+
// Preview: https://www.desmos.com/calculator/vyac5ua1as
217+
score += (*raw_freq as f32).ln().mul(0.75).max(0.0).floor() as i32;
216218
}
217219

218220
-score
@@ -328,6 +330,22 @@ impl Module for AppModule {
328330
)
329331
.width(iced::Fill),
330332
)
333+
.style(|theme, status| {
334+
let mut base_widget = widget::scrollable::default(theme, status);
335+
base_widget.vertical_rail = widget::scrollable::Rail {
336+
background: None,
337+
border: iced::Border {
338+
color: iced::Color::TRANSPARENT,
339+
width: 0.0,
340+
..Default::default()
341+
},
342+
scroller: widget::scrollable::Scroller {
343+
color: iced::Color::TRANSPARENT,
344+
border: base_widget.horizontal_rail.border,
345+
},
346+
};
347+
base_widget
348+
})
331349
.into()
332350
}
333351

src/websearch/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,22 @@ impl Module for Web {
170170
.collect();
171171

172172
widget::scrollable(widget::column(elements))
173+
.style(|theme, status| {
174+
let mut base_widget = widget::scrollable::default(theme, status);
175+
base_widget.vertical_rail = widget::scrollable::Rail {
176+
background: None,
177+
border: iced::Border {
178+
color: iced::Color::TRANSPARENT,
179+
width: 0.0,
180+
..Default::default()
181+
},
182+
scroller: widget::scrollable::Scroller {
183+
color: iced::Color::TRANSPARENT,
184+
border: base_widget.horizontal_rail.border,
185+
},
186+
};
187+
base_widget
188+
})
173189
.width(iced::Fill)
174190
.into()
175191
}

0 commit comments

Comments
 (0)