Update dependencies
This commit is contained in:
parent
3f2af19d9e
commit
4eb631c9a1
3 changed files with 51 additions and 37 deletions
36
Cargo.lock
generated
36
Cargo.lock
generated
|
|
@ -1100,7 +1100,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-config"
|
name = "cosmic-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomicwrites",
|
"atomicwrites",
|
||||||
"cosmic-config-derive",
|
"cosmic-config-derive",
|
||||||
|
|
@ -1119,7 +1119,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-config-derive"
|
name = "cosmic-config-derive"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.109",
|
"syn 1.0.109",
|
||||||
|
|
@ -1158,7 +1158,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-files"
|
name = "cosmic-files"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-files.git#ddd99525c56cf37e91e966d068110a3947fe9f8f"
|
source = "git+https://github.com/pop-os/cosmic-files.git#6572faec5c7646cf7a6d87f0b86e66ec8d97630d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"dirs",
|
"dirs",
|
||||||
|
|
@ -1205,7 +1205,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-text"
|
name = "cosmic-text"
|
||||||
version = "0.11.2"
|
version = "0.11.2"
|
||||||
source = "git+https://github.com/pop-os/cosmic-text.git#cd1cd0a337d7bfd7d2586b28a4102827517bbf60"
|
source = "git+https://github.com/pop-os/cosmic-text.git#69d5aec7fc995a1748682af1cd3cc25847c05c95"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"cosmic_undo_2",
|
"cosmic_undo_2",
|
||||||
|
|
@ -1230,7 +1230,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-theme"
|
name = "cosmic-theme"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"almost",
|
"almost",
|
||||||
"cosmic-config",
|
"cosmic-config",
|
||||||
|
|
@ -2594,7 +2594,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced"
|
name = "iced"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_accessibility",
|
"iced_accessibility",
|
||||||
|
|
@ -2612,7 +2612,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_accessibility"
|
name = "iced_accessibility"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accesskit",
|
"accesskit",
|
||||||
"accesskit_winit",
|
"accesskit_winit",
|
||||||
|
|
@ -2621,7 +2621,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_core"
|
name = "iced_core"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"dnd",
|
"dnd",
|
||||||
|
|
@ -2641,7 +2641,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_futures"
|
name = "iced_futures"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -2654,7 +2654,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_graphics"
|
name = "iced_graphics"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2678,7 +2678,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_renderer"
|
name = "iced_renderer"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
"iced_tiny_skia",
|
"iced_tiny_skia",
|
||||||
|
|
@ -2690,7 +2690,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_runtime"
|
name = "iced_runtime"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -2702,7 +2702,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_style"
|
name = "iced_style"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|
@ -2712,7 +2712,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_tiny_skia"
|
name = "iced_tiny_skia"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cosmic-text",
|
"cosmic-text",
|
||||||
|
|
@ -2729,7 +2729,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_wgpu"
|
name = "iced_wgpu"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2755,7 +2755,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_widget"
|
name = "iced_widget"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_renderer",
|
"iced_renderer",
|
||||||
|
|
@ -2771,7 +2771,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_winit"
|
name = "iced_winit"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
|
|
@ -3250,7 +3250,7 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libcosmic"
|
name = "libcosmic"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#892d9003adf5e0f68791457b693ae98ea8468b81"
|
source = "git+https://github.com/pop-os/libcosmic.git#f1aad68b712650b3c697834e1043f3dcc943c9e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apply",
|
"apply",
|
||||||
"ashpd",
|
"ashpd",
|
||||||
|
|
|
||||||
20
src/main.rs
20
src/main.rs
|
|
@ -80,6 +80,16 @@ pub fn icon_cache_get(name: &'static str, size: u16) -> icon::Icon {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
#[cfg(all(unix, not(target_os = "redox")))]
|
||||||
|
match fork::daemon(true, true) {
|
||||||
|
Ok(fork::Fork::Child) => (),
|
||||||
|
Ok(fork::Fork::Parent(_child_pid)) => process::exit(0),
|
||||||
|
Err(err) => {
|
||||||
|
eprintln!("failed to daemonize: {:?}", err);
|
||||||
|
process::exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ICON_CACHE.get_or_init(|| Mutex::new(IconCache::new()));
|
ICON_CACHE.get_or_init(|| Mutex::new(IconCache::new()));
|
||||||
LINE_NUMBER_CACHE.get_or_init(|| Mutex::new(LineNumberCache::new()));
|
LINE_NUMBER_CACHE.get_or_init(|| Mutex::new(LineNumberCache::new()));
|
||||||
SWASH_CACHE.get_or_init(|| Mutex::new(SwashCache::new()));
|
SWASH_CACHE.get_or_init(|| Mutex::new(SwashCache::new()));
|
||||||
|
|
@ -121,16 +131,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
#[cfg(all(unix, not(target_os = "redox")))]
|
|
||||||
match fork::daemon(true, true) {
|
|
||||||
Ok(fork::Fork::Child) => (),
|
|
||||||
Ok(fork::Fork::Parent(_child_pid)) => process::exit(0),
|
|
||||||
Err(err) => {
|
|
||||||
eprintln!("failed to daemonize: {:?}", err);
|
|
||||||
process::exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
|
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
|
||||||
|
|
||||||
localize::localize();
|
localize::localize();
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,11 @@ where
|
||||||
let y_logical = p.y - self.padding.top;
|
let y_logical = p.y - self.padding.top;
|
||||||
let x = x_logical * scale_factor - editor_offset_x as f32;
|
let x = x_logical * scale_factor - editor_offset_x as f32;
|
||||||
let y = y_logical * scale_factor;
|
let y = y_logical * scale_factor;
|
||||||
if x >= 0.0 && x < buffer_size.0 && y >= 0.0 && y < buffer_size.1 {
|
if x >= 0.0
|
||||||
|
&& x < buffer_size.0.unwrap_or(0.0)
|
||||||
|
&& y >= 0.0
|
||||||
|
&& y < buffer_size.1.unwrap_or(0.0)
|
||||||
|
{
|
||||||
return mouse::Interaction::Text;
|
return mouse::Interaction::Text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -410,8 +414,8 @@ where
|
||||||
buffer.set_metrics_and_size(
|
buffer.set_metrics_and_size(
|
||||||
font_system.raw(),
|
font_system.raw(),
|
||||||
metrics,
|
metrics,
|
||||||
(image_w - editor_offset_x) as f32,
|
Some((image_w - editor_offset_x) as f32),
|
||||||
image_h as f32,
|
Some(image_h as f32),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -622,7 +626,9 @@ where
|
||||||
);
|
);
|
||||||
state.scrollbar_v_rect.set(rect);
|
state.scrollbar_v_rect.set(rect);
|
||||||
|
|
||||||
let (buffer_w, buffer_h) = buffer.size();
|
let (buffer_w_opt, buffer_h_opt) = buffer.size();
|
||||||
|
let buffer_w = buffer_w_opt.unwrap_or(0.0);
|
||||||
|
let buffer_h = buffer_h_opt.unwrap_or(0.0);
|
||||||
let scrollbar_h_width = image_w as f32 / scale_factor - scrollbar_w as f32;
|
let scrollbar_h_width = image_w as f32 / scale_factor - scrollbar_w as f32;
|
||||||
if buffer_w < max_line_width {
|
if buffer_w < max_line_width {
|
||||||
let rect = Rectangle::new(
|
let rect = Rectangle::new(
|
||||||
|
|
@ -1014,7 +1020,11 @@ where
|
||||||
if matches!(state.dragging, Some(Dragging::ScrollbarH { .. })) {
|
if matches!(state.dragging, Some(Dragging::ScrollbarH { .. })) {
|
||||||
// The horizontal scrollbar is on top of the buffer,
|
// The horizontal scrollbar is on top of the buffer,
|
||||||
// so we need to ignore clicks when it is being dragged
|
// so we need to ignore clicks when it is being dragged
|
||||||
} else if x >= 0.0 && x < buffer_size.0 && y >= 0.0 && y < buffer_size.1 {
|
} else if x >= 0.0
|
||||||
|
&& x < buffer_size.0.unwrap_or(0.0)
|
||||||
|
&& y >= 0.0
|
||||||
|
&& y < buffer_size.1.unwrap_or(0.0)
|
||||||
|
{
|
||||||
x += buffer_scroll.horizontal;
|
x += buffer_scroll.horizontal;
|
||||||
let click_kind =
|
let click_kind =
|
||||||
if let Some((click_kind, click_time)) = state.click.take() {
|
if let Some((click_kind, click_time)) = state.click.take() {
|
||||||
|
|
@ -1056,8 +1066,10 @@ where
|
||||||
{
|
{
|
||||||
editor.with_buffer_mut(|buffer| {
|
editor.with_buffer_mut(|buffer| {
|
||||||
let mut scroll = buffer.scroll();
|
let mut scroll = buffer.scroll();
|
||||||
let scroll_line =
|
//TODO: if buffer height is undefined, what should this do?
|
||||||
((y / buffer.size().1) * buffer.lines.len() as f32) as i32;
|
let scroll_line = ((y / buffer.size().1.unwrap_or(1.0))
|
||||||
|
* buffer.lines.len() as f32)
|
||||||
|
as i32;
|
||||||
scroll.line = scroll_line.try_into().unwrap_or_default();
|
scroll.line = scroll_line.try_into().unwrap_or_default();
|
||||||
buffer.set_scroll(scroll);
|
buffer.set_scroll(scroll);
|
||||||
state.dragging = Some(Dragging::ScrollbarV {
|
state.dragging = Some(Dragging::ScrollbarV {
|
||||||
|
|
@ -1108,7 +1120,9 @@ where
|
||||||
} => {
|
} => {
|
||||||
editor.with_buffer_mut(|buffer| {
|
editor.with_buffer_mut(|buffer| {
|
||||||
let mut scroll = buffer.scroll();
|
let mut scroll = buffer.scroll();
|
||||||
let scroll_offset = (((y - start_y) / buffer.size().1)
|
//TODO: if buffer size is undefined, what should this do?
|
||||||
|
let scroll_offset = (((y - start_y)
|
||||||
|
/ buffer.size().1.unwrap_or(1.0))
|
||||||
* buffer.lines.len() as f32)
|
* buffer.lines.len() as f32)
|
||||||
as i32;
|
as i32;
|
||||||
scroll.line = (start_scroll.line as i32 + scroll_offset)
|
scroll.line = (start_scroll.line as i32 + scroll_offset)
|
||||||
|
|
@ -1127,7 +1141,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let buffer_w = buffer.size().0;
|
let buffer_w = buffer.size().0.unwrap_or(0.0);
|
||||||
let mut scroll = buffer.scroll();
|
let mut scroll = buffer.scroll();
|
||||||
scroll.horizontal = (((x - start_x) / buffer_w)
|
scroll.horizontal = (((x - start_x) / buffer_w)
|
||||||
* max_line_width)
|
* max_line_width)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue