I think you understood their comment wrong. In your code (e.g. label.add_css_class("green");
) you don’t use a dot, but in the CSS stylesheet. It works the same as with HTML/JS/CSS.
Auch bekannt als:
I think you understood their comment wrong. In your code (e.g. label.add_css_class("green");
) you don’t use a dot, but in the CSS stylesheet. It works the same as with HTML/JS/CSS.
Well, that’s CSS :D
Note that if you create a custom Widget class, you can set a CSS name, wich isn’t a CSS class and doesn’t use a leading dot.
Just use label.add_css_class()
, label.remove_css_class()
or label.set_css_classes()
and make sure to properly load your CSS style sheets, this is usually done by including them as a resource alongside .ui files and icons. If you are using libadwaita, you can also use its predefined style classes.
#!/usr/bin/env -S cargo +nightly -Zscript
---
[dependencies]
gtk = { package = "gtk4", version = "0.9.3", features = ["v4_12"] }
---
use gtk::{glib, prelude::*};
const STYLESHEET: &str = r#"
.green {
color: green;
}
.red {
color: red;
}
"#;
fn main() -> glib::ExitCode {
let app = gtk::Application::builder()
.application_id("org.example.HelloWorld")
.build();
app.connect_activate(|app| {
let window = gtk::ApplicationWindow::builder()
.application(app)
.title("Hello, World!")
.build();
// Stylesheets are usually bundled with application resources
// and automatically loaded
let css_provider = gtk::CssProvider::new();
css_provider.load_from_string(STYLESHEET);
gtk::style_context_add_provider_for_display(
&RootExt::display(&window),
&css_provider,
0
);
let box_ = gtk::Box::new(gtk::Orientation::Vertical, 6);
let label = gtk::Label::builder()
.label("Hello, World")
.css_classes(["green"].as_slice())
.build();
box_.append(&label);
let button = gtk::Button::builder()
.label("Toggle Color")
.build();
box_.append(&button);
button.connect_clicked(glib::clone!(#[weak] label, move |_| {
if label.has_css_class("red") {
label.add_css_class("green");
label.remove_css_class("red");
} else {
label.add_css_class("red");
label.remove_css_class("green");
}
}));
window.set_child(Some(&box_));
window.present();
});
app.run()
}
phyphox has an Audio Amplitude feature.
By providing a modified bitmap to the X.Org Server, a heap-based buffer overflow privilege escalation can occur.
Maybe we should stop writing security critical software in memory unsafe languages. I now this vulnerability was introduced a long time ago, but given that major Wayland compositors are still written in C, something like this isn’t too unlikely to happen again.
This is extremely sad. I use Syncthing a lot to sync documents between my phone an my computer.
The main benefit over client/server-based solutions are that it always works.
No network connection? No problem, the files are all stored locally.
I broke my home server again? No problem, the devices can talk directly to each other.
The site (incorrectly) returns 200, so they can’t know.
basic flyers & ads, restaurant menus
For this sort of things, LibreOffice Draw can be really good. I even used it in the past to create memes.
I love FairEmail’s simplified mail viewer that doesn’t render HTML mails completely and they look more like an enhanced plain text mail instead.
Unlike X11, Wayland was never intended to be network transparent. As others say, solutions like waypipe and more tradionally RDP and VNC exist.
SPRIND GmbH is also known as „Bundesagentur für Sprunginnovationen“ and owned by the Federal Republic of Germany. See https://de.wikipedia.org/wiki/Bundesagentur_für_Sprunginnovationen and https://www.sprind.org
It supports any ONVIF compatible IP camera as well as USB cameras and the raspberry pi camera module
MotionEye used to be the go-to solution.
I am not sure about the current state of the project (the python 2/3 transition took a long while, there are only pre-releases using a modern python version).
And it’s just some Discourse instance…
They even implemented it in Firefox: moz://a redirects to https://www.mozilla.org/en-US/about/manifesto/
It think this comment explains it really well: https://sh.itjust.works/comment/13239406
I don’t like it. He is just perpetuating the endless stereotypes that plague linux and harm linux adoption.
If you are using a somewhat stable distro and don’t have weird hardware, you don’t need to “write your own driver” etc. A lot more people “punch themselves in the face” by using a buggy, ad infested, data harvesting operating system even though they just need a web browser.
I think Germany’s done it twice now.
It was Munich and they switched back to Windows after M$ moved their German headquarters to Munich.
You may be interested in lazy-regex
.
The error message is very detailed and there is nothing to add to it.
If you want to install an application/CLI tool, use
pipx
or your system package manager. If you want to install a library, use a virtual environment (e.g. by usingpython -m venv
) or your system package manager.