Skip to content

Commit 9302468

Browse files
authored
Replace width_chars with clamp (#798)
1 parent 7e8caad commit 9302468

File tree

10 files changed

+6
-23
lines changed

10 files changed

+6
-23
lines changed

src/Views/AbstractInstallerView.vala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ public abstract class AbstractInstallerView : Adw.NavigationPage {
2525

2626
content_area = new Gtk.Box (VERTICAL, 24);
2727

28+
var content_clamp = new Adw.Clamp () {
29+
child = content_area
30+
};
31+
2832
var box = new Gtk.Box (HORIZONTAL, 12) {
2933
homogeneous = true,
3034
hexpand = true,
3135
vexpand = true,
3236
};
3337
box.append (title_area);
34-
box.append (content_area);
38+
box.append (content_clamp);
3539

3640
action_box_end = new Gtk.Box (HORIZONTAL, 6) {
3741
halign = END,

src/Views/CheckView.vala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,12 @@ public class Installer.CheckView : AbstractInstallerView {
182182
};
183183

184184
var title_label = new Gtk.Label (title) {
185-
hexpand = true,
186-
max_width_chars = 1,
187185
wrap = true,
188186
xalign = 0
189187
};
190188
title_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);
191189

192190
var description_label = new Gtk.Label (description) {
193-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
194191
use_markup = true,
195192
wrap = true,
196193
xalign = 0

src/Views/DiskView.vala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public class Installer.DiskView : AbstractInstallerView {
5050
var install_desc_label = new Gtk.Label (
5151
_("This will erase all data on the selected drive. If you have not backed your data up, you can cancel the installation and use Demo Mode.")
5252
) {
53-
max_width_chars = 45,
5453
wrap = true,
5554
xalign = 0
5655
};
@@ -70,7 +69,6 @@ public class Installer.DiskView : AbstractInstallerView {
7069
load_spinner.start ();
7170

7271
var load_label = new Gtk.Label (_("Getting the current configuration…")) {
73-
max_width_chars = 45,
7472
wrap = true
7573
};
7674
load_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);

src/Views/DriversView.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
var title_label = new Gtk.Label (title);
2929

3030
var description_label = new Gtk.Label (_("Broadcom® Wi-Fi adapters, NVIDIA® graphics, and some virtual machines may not function properly without additional drivers. Most devices do not require additional drivers.")) {
31-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
3231
wrap = true,
3332
xalign = 0
3433
};

src/Views/EncryptView.vala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ public class EncryptView : AbstractInstallerView {
5252
var title_label = new Gtk.Label (title);
5353

5454
var details_label = new Gtk.Label (_("Encrypt this device's drive if required for added protection, but be sure you understand:")) {
55-
hexpand = true,
56-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
5755
wrap = true,
5856
xalign = 0
5957
};
@@ -88,9 +86,7 @@ public class EncryptView : AbstractInstallerView {
8886
var description = new Gtk.Label (
8987
_("If you forget the encryption password, <b>you will not be able to recover data.</b> This is a unique password for this device, not the password for your user account.")
9088
) {
91-
hexpand = true,
9289
margin_bottom = 12,
93-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
9490
use_markup = true,
9591
wrap = true,
9692
xalign = 0
@@ -278,9 +274,8 @@ public class EncryptView : AbstractInstallerView {
278274

279275
construct {
280276
label_widget = new Gtk.Label (label) {
281-
halign = END,
277+
hexpand = true,
282278
justify = RIGHT,
283-
max_width_chars = 55,
284279
use_markup = true,
285280
wrap = true,
286281
xalign = 1

src/Views/ErrorView.vala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public class ErrorView : AbstractInstallerView {
3434

3535
var description_label = new Gtk.Label (_("Installing %s failed, possibly due to a hardware error. The device may not restart properly. You can try the following:").printf (Utils.get_pretty_name ())) {
3636
margin_bottom = 12,
37-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
3837
wrap = true,
3938
xalign = 0
4039
};
@@ -45,7 +44,6 @@ public class ErrorView : AbstractInstallerView {
4544

4645
var try_label = new Gtk.Label (_("Try the installation again")) {
4746
hexpand = true,
48-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
4947
wrap = true,
5048
xalign = 0
5149
};
@@ -55,7 +53,6 @@ public class ErrorView : AbstractInstallerView {
5553
};
5654

5755
var launch_label = new Gtk.Label (_("Use Demo Mode and try to manually recover")) {
58-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
5956
wrap = true,
6057
xalign = 0
6158
};
@@ -65,7 +62,6 @@ public class ErrorView : AbstractInstallerView {
6562
};
6663

6764
var restart_label = new Gtk.Label (_("Restart the device and boot from another drive")) {
68-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
6965
wrap = true,
7066
xalign = 0
7167
};

src/Views/SuccessView.vala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ public class SuccessView : AbstractInstallerView {
3030
var title_label = new Gtk.Label (title);
3131

3232
var primary_label = new Gtk.Label (_("%s has been installed").printf (Utils.get_pretty_name ())) {
33-
hexpand = true,
34-
max_width_chars = 1,
3533
wrap = true,
3634
xalign = 0
3735
};
3836
primary_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);
3937

4038
secondary_label = new Gtk.Label (null) {
41-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
4239
use_markup = true,
4340
wrap = true,
4441
xalign = 0

src/Widgets/DecryptMenu.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public class Installer.DecryptMenu: Gtk.Popover {
6969

7070
var secondary_label = new Gtk.Label (_("Enter the partition's encryption password and set a device name for the decrypted partition."));
7171
secondary_label.halign = Gtk.Align.START;
72-
secondary_label.max_width_chars = 50;
7372
secondary_label.selectable = true;
7473
secondary_label.wrap = true;
7574
secondary_label.xalign = 0;

src/Widgets/DescriptionRow.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class DescriptionRow : Gtk.Box {
2626

2727
var description_label = new Gtk.Label (description) {
2828
hexpand = true,
29-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
3029
use_markup = true,
3130
wrap = true,
3231
xalign = 0

src/Widgets/InstallTypeGrid.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public class Installer.InstallTypeButton : Gtk.CheckButton {
4444
title_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);
4545

4646
var subtitle_label = new Gtk.Label (subtitle) {
47-
max_width_chars = 1, // Make Gtk wrap, but not expand the window
4847
wrap = true,
4948
xalign = 0
5049
};

0 commit comments

Comments
 (0)