fix: opacity
This commit is contained in:
parent
4599e1bb68
commit
e40b955f33
3 changed files with 31 additions and 20 deletions
34
Cargo.lock
generated
34
Cargo.lock
generated
|
|
@ -1409,7 +1409,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#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomicwrites",
|
"atomicwrites",
|
||||||
"cosmic-config-derive",
|
"cosmic-config-derive",
|
||||||
|
|
@ -1430,7 +1430,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#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.106",
|
"syn 2.0.106",
|
||||||
|
|
@ -1518,7 +1518,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-settings-daemon"
|
name = "cosmic-settings-daemon"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/dbus-settings-bindings#3b86984332be2c930a3536ab714b843c851fa8ca"
|
source = "git+https://github.com/pop-os/dbus-settings-bindings#37cbe4e8c165428178be23a14bd37f19a19d3757"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"zbus 5.11.0",
|
"zbus 5.11.0",
|
||||||
]
|
]
|
||||||
|
|
@ -1553,7 +1553,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-text"
|
name = "cosmic-text"
|
||||||
version = "0.14.2"
|
version = "0.14.2"
|
||||||
source = "git+https://github.com/pop-os/cosmic-text.git#1140ce89b09433a10835d1219ea4f714329d1557"
|
source = "git+https://github.com/pop-os/cosmic-text.git#6514323fbe764998415068e3ae40cf476753d425"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.9.4",
|
"bitflags 2.9.4",
|
||||||
"fontdb 0.23.0",
|
"fontdb 0.23.0",
|
||||||
|
|
@ -1576,7 +1576,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#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"almost",
|
"almost",
|
||||||
"cosmic-config",
|
"cosmic-config",
|
||||||
|
|
@ -2978,7 +2978,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced"
|
name = "iced"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_accessibility",
|
"iced_accessibility",
|
||||||
|
|
@ -2996,7 +2996,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#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accesskit",
|
"accesskit",
|
||||||
"accesskit_winit",
|
"accesskit_winit",
|
||||||
|
|
@ -3005,7 +3005,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_core"
|
name = "iced_core"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.9.4",
|
"bitflags 2.9.4",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|
@ -3029,7 +3029,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_futures"
|
name = "iced_futures"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -3055,7 +3055,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_graphics"
|
name = "iced_graphics"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.9.4",
|
"bitflags 2.9.4",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -3077,7 +3077,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_renderer"
|
name = "iced_renderer"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
"iced_tiny_skia",
|
"iced_tiny_skia",
|
||||||
|
|
@ -3089,7 +3089,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_runtime"
|
name = "iced_runtime"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"cosmic-client-toolkit",
|
"cosmic-client-toolkit",
|
||||||
|
|
@ -3104,7 +3104,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_tiny_skia"
|
name = "iced_tiny_skia"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cosmic-text",
|
"cosmic-text",
|
||||||
|
|
@ -3120,7 +3120,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_wgpu"
|
name = "iced_wgpu"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as-raw-xcb-connection",
|
"as-raw-xcb-connection",
|
||||||
"bitflags 2.9.4",
|
"bitflags 2.9.4",
|
||||||
|
|
@ -3151,7 +3151,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_widget"
|
name = "iced_widget"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-client-toolkit",
|
"cosmic-client-toolkit",
|
||||||
"dnd",
|
"dnd",
|
||||||
|
|
@ -3170,7 +3170,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_winit"
|
name = "iced_winit"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-client-toolkit",
|
"cosmic-client-toolkit",
|
||||||
"dnd",
|
"dnd",
|
||||||
|
|
@ -4220,7 +4220,7 @@ checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libcosmic"
|
name = "libcosmic"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic.git#34f55d6720b8623050b7ac6153d07cabae253bf8"
|
source = "git+https://github.com/pop-os/libcosmic.git#4c4eddb50c79ace202c76b0f6972596930537e1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apply",
|
"apply",
|
||||||
"ashpd 0.12.0",
|
"ashpd 0.12.0",
|
||||||
|
|
|
||||||
|
|
@ -2749,6 +2749,7 @@ impl Application for App {
|
||||||
.on_window_unfocused(|| Message::WindowUnfocused)
|
.on_window_unfocused(|| Message::WindowUnfocused)
|
||||||
.opacity(self.config.opacity_ratio())
|
.opacity(self.config.opacity_ratio())
|
||||||
.padding(space_xxs)
|
.padding(space_xxs)
|
||||||
|
.sharp_corners(self.core.window.sharp_corners)
|
||||||
.show_headerbar(self.config.show_headerbar);
|
.show_headerbar(self.config.show_headerbar);
|
||||||
|
|
||||||
if self.config.focus_follow_mouse {
|
if self.config.focus_follow_mouse {
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ pub struct TerminalBox<'a, Message> {
|
||||||
on_window_focused: Option<Box<dyn Fn() -> Message + 'a>>,
|
on_window_focused: Option<Box<dyn Fn() -> Message + 'a>>,
|
||||||
on_window_unfocused: Option<Box<dyn Fn() -> Message + 'a>>,
|
on_window_unfocused: Option<Box<dyn Fn() -> Message + 'a>>,
|
||||||
key_binds: HashMap<KeyBind, Action>,
|
key_binds: HashMap<KeyBind, Action>,
|
||||||
|
sharp_corners: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Message> TerminalBox<'a, Message>
|
impl<'a, Message> TerminalBox<'a, Message>
|
||||||
|
|
@ -89,6 +90,7 @@ where
|
||||||
on_open_hyperlink: None,
|
on_open_hyperlink: None,
|
||||||
on_window_focused: None,
|
on_window_focused: None,
|
||||||
on_window_unfocused: None,
|
on_window_unfocused: None,
|
||||||
|
sharp_corners: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,6 +147,11 @@ where
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn sharp_corners(mut self, sharp_corners: bool) -> Self {
|
||||||
|
self.sharp_corners = sharp_corners;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn on_open_hyperlink(
|
pub fn on_open_hyperlink(
|
||||||
mut self,
|
mut self,
|
||||||
on_open_hyperlink: Option<Box<dyn Fn(String) -> Message + 'a>>,
|
on_open_hyperlink: Option<Box<dyn Fn(String) -> Message + 'a>>,
|
||||||
|
|
@ -294,9 +301,12 @@ where
|
||||||
|
|
||||||
let cosmic_theme = theme.cosmic();
|
let cosmic_theme = theme.cosmic();
|
||||||
// matches the corners to the window border
|
// matches the corners to the window border
|
||||||
let corner_radius = cosmic_theme
|
let corner_radius = if self.sharp_corners {
|
||||||
.radius_s()
|
cosmic_theme.radius_0()
|
||||||
.map(|x| if x < 4.0 { x - 1.0 } else { x + 3.0 });
|
} else {
|
||||||
|
cosmic_theme.radius_s()
|
||||||
|
}
|
||||||
|
.map(|x| if x < 4.0 { x - 1.0 } else { x + 3.0 });
|
||||||
let scrollbar_w = f32::from(cosmic_theme.spacing.space_xxs);
|
let scrollbar_w = f32::from(cosmic_theme.spacing.space_xxs);
|
||||||
|
|
||||||
let view_position = layout.position() + [self.padding.left, self.padding.top].into();
|
let view_position = layout.position() + [self.padding.left, self.padding.top].into();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue