From cee257694447f846b0fb6fb12c21532e088031fd Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 23 Jan 2025 23:09:18 +0100 Subject: update popover example #249 --- examples/gtk3/js/popover/app.tsx | 54 ++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 13 deletions(-) (limited to 'examples/gtk3/js/popover/app.tsx') diff --git a/examples/gtk3/js/popover/app.tsx b/examples/gtk3/js/popover/app.tsx index 6b0286f..5386b66 100644 --- a/examples/gtk3/js/popover/app.tsx +++ b/examples/gtk3/js/popover/app.tsx @@ -1,12 +1,15 @@ import { App, Astal, Gtk } from "astal/gtk3" import { Variable } from "astal" -import Popup from "./Popover" +import Popover from "./Popover" +import Popover2 from "./Popover2" const { TOP, RIGHT, LEFT } = Astal.WindowAnchor +const lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quis semper risus." + App.start({ instanceName: "popup-example", css: ` - .Popup>box { + .popup { background-color: @theme_bg_color; box-shadow: 2px 3px 7px 0 rgba(0,0,0,0.4); border-radius: 12px; @@ -14,30 +17,55 @@ App.start({ } `, main() { - const visible = Variable(false); + const visible1 = Variable(false); + const visible2 = Variable(false); - visible.set(false)} - visible={visible()} + onClose={() => visible1.set(false)} + visible={visible1()} marginTop={36} marginRight={60} valign={Gtk.Align.START} halign={Gtk.Align.END} > - - + + {/* maxWidthChars is needed to make wrap work */} + + + + + const _popover2 = visible2.set(false)} + visible={visible2()} + > + + {/* maxWidthChars is needed, wrap will work as intended */} + + return ( - + + + + ) }, -- cgit v1.2.3