Skip to content

Commit

Permalink
Clamp views instead of halign (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Jan 27, 2024
1 parent cd06493 commit f8580de
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
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

0 comments on commit f8580de

Please sign in to comment.