diff --git a/data/ui/med-dialog.blp b/data/ui/med-dialog.blp index 3953b2d..bd3de4a 100644 --- a/data/ui/med-dialog.blp +++ b/data/ui/med-dialog.blp @@ -32,10 +32,10 @@ Adw.Dialog medDialog { } content: ScrolledWindow { - Adw.Clamp { + Adw.Clamp medDialogClamp { maximum-size: 412; - Box medDialogBox { + Box { orientation: vertical; margin-start: 10; margin-end: 10; diff --git a/src/historyFactory.js b/src/historyFactory.js index b025102..969da11 100644 --- a/src/historyFactory.js +++ b/src/historyFactory.js @@ -19,6 +19,7 @@ export let removedItem; historyHeaderFactory.connect('setup', (factory, listHeaderItem) => { const dateLabel = new Gtk.Label({ halign: Gtk.Align.START, + ellipsize: Pango.EllipsizeMode.END, margin_bottom: 1, }); listHeaderItem.set_child(dateLabel); @@ -63,6 +64,7 @@ historyItemFactory.connect('setup', (factory, listItem) => { box.append(labelsBox); const name = new Gtk.Label({ halign: Gtk.Align.START, + ellipsize: Pango.EllipsizeMode.END, margin_bottom: 1, }); labelsBox.append(name); diff --git a/src/medDialog.js b/src/medDialog.js index 8f6267c..2ee0ef1 100644 --- a/src/medDialog.js +++ b/src/medDialog.js @@ -239,11 +239,13 @@ export default function openMedicationDialog(DosageWindow, list, position, mode) const btnNew = new Gtk.Button({ css_classes: ['flat'], + can_shrink: true, label: _('New'), }); btnNew.remove_css_class('text-button'); btnNew.get_first_child().set_halign(Gtk.Align.START); + btnNew.get_first_child().set_max_width_chars(50); oneTimeEntries.append(btnNew); btnNew.connect('clicked', () => { @@ -268,8 +270,10 @@ export default function openMedicationDialog(DosageWindow, list, position, mode) const item = it.obj; const btn = new Gtk.Button({ css_classes: ['flat', 'one-time-name'], + can_shrink: true, label: item.name, }); + btn.get_first_child().set_max_width_chars(50); btn.remove_css_class('text-button'); btn.get_first_child().set_halign(Gtk.Align.START); @@ -413,9 +417,9 @@ export default function openMedicationDialog(DosageWindow, list, position, mode) } }; - const medDialogBox = builder.get_object('medDialogBox'); - const [medDialogBoxHeight] = medDialogBox.measure(Gtk.Orientation.VERTICAL, -1); - medDialog.content_height = medDialogBoxHeight + 48; + const medDialogClamp = builder.get_object('medDialogClamp'); + const [medDialogClampHeight] = medDialogClamp.measure(Gtk.Orientation.VERTICAL, -1); + medDialog.content_height = medDialogClampHeight + 48; setSpecificDaysButtonOrder(); diff --git a/src/todayFactory.js b/src/todayFactory.js index 11f84d5..ccb35d4 100644 --- a/src/todayFactory.js +++ b/src/todayFactory.js @@ -83,6 +83,7 @@ todayItemFactory.connect('setup', (factory, listItem) => { box.append(labelsBox); const name = new Gtk.Label({ halign: Gtk.Align.START, + ellipsize: Pango.EllipsizeMode.END, margin_bottom: 1, }); labelsBox.append(name); diff --git a/src/treatmentsFactory.js b/src/treatmentsFactory.js index eb31b31..e3e6213 100644 --- a/src/treatmentsFactory.js +++ b/src/treatmentsFactory.js @@ -32,6 +32,7 @@ treatmentsFactory.connect('setup', (factory, listItem) => { box.append(labelsBox); const name = new Gtk.Label({ halign: Gtk.Align.START, + ellipsize: Pango.EllipsizeMode.END, margin_bottom: 1, }); labelsBox.append(name);