Skip to content

Commit 51598b5

Browse files
authored
Merge pull request #1657 from alainm23/feat/task-note-position
Improve layout alignment for note-type tasks
2 parents a82fd06 + 5580c37 commit 51598b5

File tree

5 files changed

+93
-68
lines changed

5 files changed

+93
-68
lines changed

core/Widgets/Markdown/MarkdownEditView.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ public class Widgets.Markdown.EditView : Adw.Bin {
200200
}
201201

202202
private void handle_focus_in () {
203-
print ("Se desactiva todoooooo\n");
204203
Services.EventBus.get_default ().disconnect_typing_accel ();
205204
enter ();
206205
}

src/Layouts/ItemBoard.vala

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
2424
private Gtk.Revealer motion_top_revealer;
2525

2626
private Gtk.CheckButton checked_button;
27+
private Gtk.Revealer checked_button_revealer;
2728
private Gtk.Label content_label;
29+
private Gtk.Box content_box;
2830

2931
private Widgets.LoadingButton hide_loading_button;
3032
private Gtk.Revealer hide_loading_revealer;
@@ -46,6 +48,7 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
4648

4749
public Gtk.Box handle_grid;
4850
public Adw.Bin card_widget;
51+
public Gtk.Box footer_box;
4952
private Gtk.Popover menu_handle_popover = null;
5053
private Widgets.ContextMenu.MenuItem no_date_item;
5154
private Widgets.ContextMenu.MenuItem pinboard_item;
@@ -108,6 +111,12 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
108111
css_classes = { "priority-color" }
109112
};
110113

114+
checked_button_revealer = new Gtk.Revealer () {
115+
child = checked_button,
116+
transition_type = SLIDE_RIGHT,
117+
reveal_child = true
118+
};
119+
111120
content_label = new Gtk.Label (item.content) {
112121
wrap = true,
113122
hexpand = true,
@@ -121,7 +130,7 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
121130
halign = Gtk.Align.CENTER,
122131
margin_top = 7,
123132
margin_end = 7,
124-
tooltip_text = _("Unpin"),
133+
tooltip_text = _ ("Unpin"),
125134
css_classes = { "min-height-0", "view-button" }
126135
};
127136

@@ -144,13 +153,14 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
144153
child = select_checkbutton
145154
};
146155

147-
var content_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6) {
156+
content_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6) {
148157
margin_top = 6,
149158
margin_start = 6,
150159
margin_end = 6
151160
};
152161

153-
content_box.append (checked_button);
162+
content_box.add_css_class ("transition");
163+
content_box.append (checked_button_revealer);
154164
content_box.append (content_label);
155165
content_box.append (select_revealer);
156166

@@ -160,9 +170,9 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
160170
ellipsize = Pango.EllipsizeMode.END,
161171
margin_start = 30,
162172
margin_end = 6,
163-
css_classes = { "dim-label", "caption" }
173+
css_classes = { "dim-label", "caption", "transition" }
164174
};
165-
175+
166176
description_revealer = new Gtk.Revealer () {
167177
transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN,
168178
child = description_label
@@ -243,7 +253,7 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
243253
child = subtaks_container
244254
};
245255

246-
var footer_box = new Gtk.Box (HORIZONTAL, 0) {
256+
footer_box = new Gtk.Box (HORIZONTAL, 0) {
247257
hexpand = true,
248258
margin_start = 30,
249259
margin_top = 6,
@@ -529,7 +539,7 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
529539
checked_button.active = false;
530540
complete_timeout = 0;
531541

532-
var title = _("Completed. Next occurrence: %s".printf (Utils.Datetime.get_default_date_format_from_date (next_recurrency)));
542+
var title = _ ("Completed. Next occurrence: %s".printf (Utils.Datetime.get_default_date_format_from_date (next_recurrency)));
533543
var toast = Util.get_default ().create_toast (title, 3);
534544

535545
Services.EventBus.get_default ().send_toast (toast);
@@ -546,11 +556,15 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
546556

547557
// ItemType
548558
if (item.item_type == ItemType.TASK) {
549-
checked_button.sensitive = true;
550-
checked_button.opacity = 1;
559+
checked_button_revealer.reveal_child = true;
560+
description_label.margin_start = 30;
561+
footer_box.margin_start = 30;
562+
content_box.margin_start = 6;
551563
} else {
552-
checked_button.sensitive = false;
553-
checked_button.opacity = 0;
564+
checked_button_revealer.reveal_child = false;
565+
description_label.margin_start = 9;
566+
footer_box.margin_start = 9;
567+
content_box.margin_start = 3;
554568
}
555569

556570
description_label.label = Util.get_default ().line_break_to_space (item.description);
@@ -631,31 +645,31 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
631645
no_date_item.visible = false;
632646
}
633647

634-
pinboard_item.title = item.pinned ? _("Unpin") : _("Pin");
648+
pinboard_item.title = item.pinned ? _ ("Unpin") : _ ("Pin");
635649

636650
menu_handle_popover.pointing_to = { (int) x, (int) y, 1, 1 };
637651
menu_handle_popover.popup ();
638652
return;
639653
}
640654

641-
var today_item = new Widgets.ContextMenu.MenuItem (_("Today"), "star-outline-thick-symbolic");
655+
var today_item = new Widgets.ContextMenu.MenuItem (_ ("Today"), "star-outline-thick-symbolic");
642656
today_item.secondary_text = new GLib.DateTime.now_local ().format ("%a");
643657

644-
var tomorrow_item = new Widgets.ContextMenu.MenuItem (_("Tomorrow"), "today-calendar-symbolic");
658+
var tomorrow_item = new Widgets.ContextMenu.MenuItem (_ ("Tomorrow"), "today-calendar-symbolic");
645659
tomorrow_item.secondary_text = new GLib.DateTime.now_local ().add_days (1).format ("%a");
646660

647-
pinboard_item = new Widgets.ContextMenu.MenuItem (item.pinned ? _("Unpin") : _("Pin"), "pin-symbolic");
661+
pinboard_item = new Widgets.ContextMenu.MenuItem (item.pinned ? _ ("Unpin") : _ ("Pin"), "pin-symbolic");
648662

649-
no_date_item = new Widgets.ContextMenu.MenuItem (_("No Date"), "cross-large-circle-filled-symbolic");
663+
no_date_item = new Widgets.ContextMenu.MenuItem (_ ("No Date"), "cross-large-circle-filled-symbolic");
650664
no_date_item.visible = item.has_due;
651-
var move_item = new Widgets.ContextMenu.MenuItem (_("Move"), "arrow3-right-symbolic");
665+
var move_item = new Widgets.ContextMenu.MenuItem (_ ("Move"), "arrow3-right-symbolic");
652666

653-
var add_item = new Widgets.ContextMenu.MenuItem (_("Add Subtask"), "plus-large-symbolic");
654-
var complete_item = new Widgets.ContextMenu.MenuItem (_("Complete"), "check-round-outline-symbolic");
655-
var edit_item = new Widgets.ContextMenu.MenuItem (_("Edit"), "edit-symbolic");
656-
var duplicate_item = new Widgets.ContextMenu.MenuItem (_("Duplicate"), "tabs-stack-symbolic");
667+
var add_item = new Widgets.ContextMenu.MenuItem (_ ("Add Subtask"), "plus-large-symbolic");
668+
var complete_item = new Widgets.ContextMenu.MenuItem (_ ("Complete"), "check-round-outline-symbolic");
669+
var edit_item = new Widgets.ContextMenu.MenuItem (_ ("Edit"), "edit-symbolic");
670+
var duplicate_item = new Widgets.ContextMenu.MenuItem (_ ("Duplicate"), "tabs-stack-symbolic");
657671

658-
var delete_item = new Widgets.ContextMenu.MenuItem (_("Delete Task"), "user-trash-symbolic");
672+
var delete_item = new Widgets.ContextMenu.MenuItem (_ ("Delete Task"), "user-trash-symbolic");
659673
delete_item.add_css_class ("menu-item-danger");
660674

661675
var menu_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
@@ -940,7 +954,7 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
940954
if (item.project.sort_order != 0) {
941955
item.project.sort_order = 0;
942956
Services.EventBus.get_default ().send_toast (
943-
Util.get_default ().create_toast (_("Order changed to 'Custom sort order'"))
957+
Util.get_default ().create_toast (_ ("Order changed to 'Custom sort order'"))
944958
);
945959
item.project.update_local ();
946960
}
@@ -1039,8 +1053,8 @@ public class Layouts.ItemBoard : Layouts.ItemBase {
10391053
}
10401054

10411055
private void delete_undo () {
1042-
var toast = new Adw.Toast (_("%s was deleted".printf (Util.get_default ().get_short_name (item.content))));
1043-
toast.button_label = _("Undo");
1056+
var toast = new Adw.Toast (_ ("%s was deleted".printf (Util.get_default ().get_short_name (item.content))));
1057+
toast.button_label = _ ("Undo");
10441058
toast.priority = Adw.ToastPriority.HIGH;
10451059
toast.timeout = 3;
10461060

0 commit comments

Comments
 (0)