167 lines
5.0 KiB
Rust

pub fn install_css(window: &gtk::ApplicationWindow) {
let provider = gtk::CssProvider::new();
provider.load_from_data(
r"
window.lesavka {
background: #101319;
color: #eef2f7;
}
box.launcher-root {
background: linear-gradient(180deg, #11161f 0%, #161d28 100%);
}
box.panel {
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 18px;
padding: 10px;
}
box.subgroup {
background: rgba(255, 255, 255, 0.025);
border: 1px solid rgba(255, 255, 255, 0.06);
border-radius: 14px;
padding: 8px;
}
label.panel-title {
font-weight: 700;
font-size: 1.05rem;
margin-bottom: 4px;
}
label.subgroup-title {
font-weight: 700;
opacity: 0.92;
}
label.version-tag {
font-size: 0.76rem;
opacity: 0.72;
}
image.app-logo {
opacity: 0.96;
}
box.status-chip {
background: rgba(91, 179, 162, 0.12);
border: 1px solid rgba(91, 179, 162, 0.25);
border-radius: 999px;
padding: 6px 9px;
}
box.status-light {
min-width: 10px;
min-height: 10px;
border-radius: 999px;
background: rgba(214, 81, 81, 0.92);
}
box.status-light-live {
background: rgba(96, 214, 126, 0.95);
}
box.status-light-connected {
background: rgba(76, 154, 255, 0.95);
}
box.status-light-idle {
background: rgba(214, 81, 81, 0.92);
}
box.status-light-warning {
background: rgba(242, 143, 54, 0.95);
}
box.status-light-caution {
background: rgba(227, 201, 73, 0.95);
}
label.status-chip-label {
font-size: 0.78rem;
opacity: 0.72;
}
label.status-chip-value {
font-size: 0.93rem;
font-weight: 700;
}
box.display-card {
background: rgba(255, 255, 255, 0.045);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 22px;
padding: 16px;
}
box.display-placeholder {
background: rgba(255, 255, 255, 0.03);
border: 1px dashed rgba(255, 255, 255, 0.18);
border-radius: 16px;
padding: 12px;
}
picture.display-placeholder-art {
opacity: 0.78;
}
picture.camera-preview-frame {
background: rgba(0, 0, 0, 0.28);
border: 1px solid rgba(255, 255, 255, 0.10);
border-radius: 14px;
}
label.status-line {
opacity: 0.9;
}
label.eye-inline-status {
font-size: 0.86rem;
font-weight: 600;
background: rgba(91, 179, 162, 0.10);
border: 1px solid rgba(91, 179, 162, 0.22);
border-radius: 999px;
padding: 5px 8px;
opacity: 0.9;
}
textview.status-log,
label.status-log {
font-family: monospace;
background: rgba(0, 0, 0, 0.22);
border-radius: 14px;
padding: 10px;
}
progressbar.audio-check-meter trough {
min-width: 14px;
min-height: 10px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.08);
}
progressbar.audio-check-meter.vertical trough {
min-height: 96px;
}
progressbar.audio-check-meter progress {
border-radius: 999px;
background: rgba(91, 179, 162, 0.88);
}
entry.server-entry {
min-height: 38px;
}
combobox.compact-combo {
min-width: 0;
}
combobox.compact-combo button {
min-width: 0;
padding-left: 8px;
padding-right: 8px;
}
button.pill-toggle {
min-height: 36px;
padding: 0 14px;
}
button.pill-toggle-active {
background: rgba(91, 179, 162, 0.2);
border-color: rgba(91, 179, 162, 0.45);
font-weight: 700;
}
",
);
if let Some(display) = gtk::gdk::Display::default() {
gtk::style_context_add_provider_for_display(
&display,
&provider,
gtk::STYLE_PROVIDER_PRIORITY_APPLICATION,
);
}
window.add_css_class("lesavka");
}
pub fn install_window_icon(window: &impl IsA<gtk::Window>) {
if let Some(display) = gtk::gdk::Display::default() {
let theme = gtk::IconTheme::for_display(&display);
theme.add_search_path(LESAVKA_ICON_SEARCH_PATH);
}
gtk::Window::set_default_icon_name(LESAVKA_ICON_NAME);
window.as_ref().set_icon_name(Some(LESAVKA_ICON_NAME));
}