Skip to content

Commit d4ed20c

Browse files
library: add CenterBox entry (#492)
* add main.json * add main.blp * update main.json * add api reference and update .blp * Apply suggestions from code review Co-authored-by: Andy Holmes <1265208+andyholmes@users.noreply.github.com> --------- Co-authored-by: Andy Holmes <1265208+andyholmes@users.noreply.github.com>
1 parent 06933cc commit d4ed20c

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using Gtk 4.0;
2+
using Adw 1;
3+
4+
Adw.StatusPage {
5+
title: _("Center Box");
6+
description: _("Displays three child widgets, while keeping the middle centered");
7+
8+
child: Box {
9+
spacing: 24;
10+
orientation: vertical;
11+
12+
Adw.Clamp {
13+
maximum-size: bind width_adjustment.value;
14+
child: CenterBox {
15+
shrink-center-last: true;
16+
17+
[start]
18+
Switch {
19+
valign: center;
20+
}
21+
22+
[center]
23+
Entry {}
24+
25+
[end]
26+
CheckButton {}
27+
};
28+
}
29+
30+
Scale width_scale {
31+
orientation: horizontal;
32+
halign: center;
33+
width-request: 120;
34+
adjustment: Adjustment width_adjustment {
35+
lower: 200;
36+
upper: 500;
37+
value: 325;
38+
};
39+
}
40+
41+
LinkButton {
42+
label: "API Reference";
43+
uri: "https://docs.gtk.org/gtk4/class.CenterBox.html";
44+
}
45+
};
46+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"category": "layout",
3+
"description": "Displays three child widgets, while keeping the middle centered",
4+
"panels": ["ui", "preview"],
5+
"autorun": true
6+
}

0 commit comments

Comments
 (0)