logiguard fork v2: patched GPUI on verified 8c74db0 tree
Rebuilt from the exact zed-industries/zed @ 8c74db00c4053d6c0a9037863d7bd048658da4ca tree (previous orphan was based on a stale/wrong fetch). Same 3-file patch: - serial.rs: add SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; add latest_serial_of() - window.rs: activate() uses keyboard-enter serial (Mutter focus gate) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
/// Click the button — the `.active()` background gets stuck on every other click.
|
||||
use gpui::*;
|
||||
use gpui_platform::application;
|
||||
|
||||
struct Example;
|
||||
|
||||
impl Render for Example {
|
||||
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||
// Colors from Zed's default dark theme
|
||||
let bg = hsla(215. / 360., 0.12, 0.15, 1.);
|
||||
let text = hsla(221. / 360., 0.11, 0.86, 1.);
|
||||
let hover = hsla(225. / 360., 0.118, 0.267, 1.);
|
||||
let active = hsla(220. / 360., 0.118, 0.20, 1.);
|
||||
|
||||
div().bg(bg).size_full().p_1().child(
|
||||
div()
|
||||
.id("button")
|
||||
.px_2()
|
||||
.py_0p5()
|
||||
.rounded_md()
|
||||
.text_sm()
|
||||
.text_color(text)
|
||||
.hover(|s| s.bg(hover))
|
||||
.active(|s| s.bg(active))
|
||||
.on_click(|_, _, _| {})
|
||||
.child("Click me"),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
application().run(|cx: &mut App| {
|
||||
cx.open_window(
|
||||
WindowOptions {
|
||||
window_bounds: Some(WindowBounds::Windowed(Bounds::centered(
|
||||
None,
|
||||
size(px(200.), px(60.)),
|
||||
cx,
|
||||
))),
|
||||
..Default::default()
|
||||
},
|
||||
|_, cx| cx.new(|_| Example),
|
||||
)
|
||||
.unwrap();
|
||||
cx.activate(true);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user