Glass designs as settings: solid, frosted, liquid on every surface
appearance.surface.design picks the look (chips in the config window); each design's opacity, rim and light are settings. surface::shell now draws the island, idle pill, workspace and tray pills, tray menu, control centre and popup, so a design applies everywhere. On see-through glass faces fade with .opacity(). Shell text settings can list their allowed words (chips).
This commit is contained in:
+8
-13
@@ -11,7 +11,7 @@ use std::time::{Duration, Instant};
|
||||
|
||||
use amane::{
|
||||
Animation, Audio, Blend, Bluetooth, Brightness, Button, Canvas, Cap, Center, Color, Column, Easing, End, Full,
|
||||
Horizontal, InputArea, Layer, LayerWindow, Line, Monitor, Padding, Parent, Pointer, Rectangle, Row, Service, Shadow,
|
||||
Horizontal, InputArea, Layer, LayerWindow, Line, Monitor, Padding, Parent, Pointer, Rectangle, Row, Service,
|
||||
Shape, SpaceBetween, Stack, Start, Text, Vertical, Weight, Widget, Zone, children, shapes,
|
||||
};
|
||||
|
||||
@@ -20,14 +20,14 @@ use crate::config::control as c;
|
||||
use crate::config::island::{animation as island_animation, pill as island_pill};
|
||||
use crate::edge::{self, Edge};
|
||||
use crate::glyph::{Glyph, icon};
|
||||
use crate::island::{self, CLEAR, backdrop, faded, mix, phases, veiled};
|
||||
use crate::island::{self, CLEAR, faded, mix, phases, veiled};
|
||||
use crate::map::{self, Centre, Link, Node};
|
||||
use crate::parse;
|
||||
use crate::prompt;
|
||||
use crate::settings;
|
||||
use crate::sound::Sound;
|
||||
use crate::system::{self, Charge, Gpu, Links, Power, VpnState};
|
||||
use crate::theme;
|
||||
use crate::{surface, theme};
|
||||
|
||||
// every size and timing is a setting (config.rs: control.*); these follow from them
|
||||
fn menu_w() -> f32 {
|
||||
@@ -452,14 +452,10 @@ pub fn view(monitor: &Monitor) -> LayerWindow {
|
||||
let tapped = monitor.name.clone();
|
||||
let hovered = monitor.name.clone();
|
||||
|
||||
let shape = Rectangle::new()
|
||||
.width(width)
|
||||
.height(height)
|
||||
.radius(radius)
|
||||
.fill(backdrop(&colors, 255))
|
||||
.border(1.0, Color::blend(theme::now().outline, faded(theme::now().accent, 110), lift))
|
||||
.shadow(Shadow::drop(theme::now().accent).opacity(mix(0.3, 0.7, lift)).blur(22.0))
|
||||
.align_child(Center, Start)
|
||||
let face = Rectangle::new().width(width).height(height).align_child(Center, Start).child(face);
|
||||
|
||||
// the surface is surface.rs's, like the island's
|
||||
let shape = surface::shell(width, height, radius, &colors, lift, face)
|
||||
.on_click(move |_| tap(&tapped))
|
||||
.on_hover(move |inside| {
|
||||
{
|
||||
@@ -481,8 +477,7 @@ pub fn view(monitor: &Monitor) -> LayerWindow {
|
||||
if !inside && panel_here {
|
||||
collapse_soon();
|
||||
}
|
||||
})
|
||||
.child(face);
|
||||
});
|
||||
|
||||
let shape = if control.expanded && opened_here { shape } else { shape.cursor(Pointer) };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user