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.
Auch bekannt als:
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.
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.
Unlike X11, Wayland was never intended to be network transparent. As others say, solutions like waypipe and more tradionally RDP and VNC exist.
They even implemented it in Firefox: moz://a redirects to https://www.mozilla.org/en-US/about/manifesto/
Some people also swear by other measures, like changing the SSH port to something else. Most people end up using 2222 to easily remember. This is borderline useless, as you can see for yourself.
While being useless against a sophisticated attacker, there hasn’t been any bot activity in my sshd logs since changing my ssh port to a different one.
It’s called Ottifant and is related to a German comedian. https://feddit.org/post/694543
I like the elephant. Does it have a special meaning? Is there a template?
Oh, okay. iplocation.net reports it being hosted in North America.
Edit: it uses Cloudflare, that’s why.
lemm.ee seems to be hosted in the USA. I would very much prefer a european instance. lemmings.world and lemmy.cafe could be an option.
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.