Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clamp views instead of halign #293

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/Plug.vala
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ public class About.Plug : Switchboard.Plug {
if (main_grid == null) {
var operating_system_view = new OperatingSystemView ();

var hardware_view = new HardwareView () {
valign = Gtk.Align.CENTER
};

var hardware_view = new HardwareView ();
var firmware_view = new FirmwareView ();

stack = new Gtk.Stack () {
Expand Down
21 changes: 15 additions & 6 deletions src/Views/HardwareView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,22 @@ public class About.HardwareView : Gtk.Box {
details_box.append (manufacturer_website_info);
}

margin_start = 16;
margin_end = 16;
spacing = 32;
halign = CENTER;
var box = new Gtk.Box (HORIZONTAL, 32) {
valign = CENTER
};
box.append (manufacturer_logo);
box.append (details_box);

var clamp = new Adw.Clamp () {
child = box,
hexpand = true
};

append (manufacturer_logo);
append (details_box);
margin_top = 12;
margin_end = 12;
margin_bottom = 12;
margin_start = 12;
append (clamp);

granite_settings.notify["prefers-color-scheme"].connect (() => {
update_manufacturer_logo ();
Expand Down
7 changes: 5 additions & 2 deletions src/Views/OperatingSystemView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ public class About.OperatingSystemView : Gtk.Box {

software_grid = new Gtk.Grid () {
column_spacing = 32,
halign = Gtk.Align.CENTER,
valign = Gtk.Align.CENTER,
vexpand = true
};
Expand All @@ -220,13 +219,17 @@ public class About.OperatingSystemView : Gtk.Box {
software_grid.attach (help_button, 2, 4);
software_grid.attach (translate_button, 3, 4);

var clamp = new Adw.Clamp () {
child = software_grid
};

margin_top = 12;
margin_end = 12;
margin_bottom = 12;
margin_start = 12;
orientation = Gtk.Orientation.VERTICAL;
spacing = 12;
append (software_grid);
append (clamp);
append (button_grid);

settings_restore_button.clicked.connect (settings_restore_clicked);
Expand Down
Loading