Skip to content

Commit 18cf482

Browse files
library: Add Overlay entry (#251)
1 parent 587fb7d commit 18cf482

5 files changed

Lines changed: 84 additions & 0 deletions

File tree

1.39 MB
Loading

src/Library/demos/Overlay/main.blp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using Gtk 4.0;
2+
using Adw 1;
3+
4+
Adw.StatusPage {
5+
title: "Overlay";
6+
description: "Overlay widgets on top of a each other";
7+
8+
Adw.Clamp{
9+
Overlay {
10+
Picture picture {
11+
}
12+
13+
[overlay]
14+
Box toolbar{
15+
margin-start: 24;
16+
margin-end: 24;
17+
margin-bottom:18;
18+
valign: end;
19+
20+
Button {
21+
icon-name: "skip-backwards-10-symbolic";
22+
}
23+
24+
Button {
25+
icon-name: "play-large-symbolic";
26+
}
27+
28+
Button {
29+
icon-name: "skip-forward-10-symbolic";
30+
}
31+
32+
Scale {
33+
hexpand: true;
34+
orientation: horizontal;
35+
show-fill-level: true;
36+
adjustment:
37+
Adjustment {
38+
lower: 0;
39+
upper: 100;
40+
value:50;
41+
};
42+
}
43+
44+
Button {
45+
icon-name: "audio-volume-muted-symbolic";
46+
}
47+
48+
styles [
49+
"toolbar",
50+
"osd",
51+
"darken",
52+
]
53+
}
54+
}
55+
}
56+
}

src/Library/demos/Overlay/main.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.darken {
2+
transition: background-color 0.3s ease-in-out;
3+
}
4+
5+
.darken:hover {
6+
background-color: black;
7+
}

src/Library/demos/Overlay/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Gtk from "gi://Gtk";
2+
import Gio from "gi://Gio";
3+
import GLib from "gi://GLib";
4+
5+
const file = Gio.File.new_for_path(pkg.pkgdatadir).resolve_relative_path(
6+
"Library/demos/Overlay/image.png",
7+
);
8+
9+
const picture = workbench.builder.get_object("picture");
10+
picture.file = file;
11+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "Overlay",
3+
"category": "user_interface",
4+
"description": "Overlay widgets on top of each other",
5+
"panels": [
6+
"ui",
7+
"preview"
8+
],
9+
"autorun": true
10+
}

0 commit comments

Comments
 (0)