Skip to content

Commit

Permalink
fix #1428
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 committed Sep 16, 2024
1 parent a374e5d commit 1febec3
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
6 changes: 6 additions & 0 deletions data/io.github.alainm23.planify.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
<file alias="funnel-outline-symbolic.svg">resources/icons/funnel-outline-symbolic.svg</file>
<file alias="external-link-symbolic.svg">resources/icons/external-link-symbolic.svg</file>
<file alias="delay-symbolic.svg">resources/icons/delay-symbolic.svg</file>
<file alias="go-up-symbolic.svg">resources/icons/go-up-symbolic.svg</file>
<file alias="go-next-symbolic.svg">resources/icons/go-next-symbolic.svg</file>
</gresource>

<gresource prefix="/io/github/alainm23/planify/Devel/icons/scalable/actions">
Expand Down Expand Up @@ -166,6 +168,8 @@
<file alias="funnel-outline-symbolic.svg">resources/icons/funnel-outline-symbolic.svg</file>
<file alias="external-link-symbolic.svg">resources/icons/external-link-symbolic.svg</file>
<file alias="delay-symbolic.svg">resources/icons/delay-symbolic.svg</file>
<file alias="go-up-symbolic.svg">resources/icons/go-up-symbolic.svg</file>
<file alias="go-next-symbolic.svg">resources/icons/go-next-symbolic.svg</file>
</gresource>

<gresource prefix="/io/github/alainm23/planify/quick-add/icons/scalable/actions">
Expand Down Expand Up @@ -236,5 +240,7 @@
<file alias="funnel-outline-symbolic.svg">resources/icons/funnel-outline-symbolic.svg</file>
<file alias="external-link-symbolic.svg">resources/icons/external-link-symbolic.svg</file>
<file alias="delay-symbolic.svg">resources/icons/delay-symbolic.svg</file>
<file alias="go-up-symbolic.svg">resources/icons/go-up-symbolic.svg</file>
<file alias="go-next-symbolic.svg">resources/icons/go-next-symbolic.svg</file>
</gresource>
</gresources>
4 changes: 4 additions & 0 deletions data/resources/icons/go-next-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/resources/icons/go-up-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Dialogs/ProjectPicker/ProjectPickerRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class Dialogs.ProjectPicker.ProjectPickerRow : Gtk.ListBoxRow {
name_label.ellipsize = Pango.EllipsizeMode.END;

var selected_icon = new Gtk.Image () {
gicon = new ThemedIcon ("emblem-ok-symbolic"),
gicon = new ThemedIcon ("checkmark-small-symbolic"),
pixel_size = 16,
hexpand = true,
valign = Gtk.Align.CENTER,
Expand Down
37 changes: 37 additions & 0 deletions src/Layouts/ItemRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ public class Layouts.ItemRow : Layouts.ItemBase {
private Widgets.Attachments attachments;
private Gtk.Label attachments_count;
private Gtk.Box action_box;
private Gtk.Label show_subtasks_label;
private Gtk.Revealer show_subtasks_revealer;

private Widgets.SubItems subitems;
private Gtk.MenuButton menu_button;
private Gtk.Button hide_subtask_button;
private Gtk.Button show_subtasks_button;
private Gtk.Revealer hide_subtask_revealer;
private Widgets.ContextMenu.MenuItem no_date_item;
private Widgets.ContextMenu.MenuItem pinboard_item;
Expand Down Expand Up @@ -112,6 +115,7 @@ public class Layouts.ItemRow : Layouts.ItemBase {
hide_subtask_revealer.reveal_child = false;
hide_loading_button.remove_css_class ("no-padding");
hide_loading_revealer.reveal_child = true;
show_subtasks_revealer.reveal_child = subitems.has_children && edit;

// Due labels
due_box_revealer.reveal_child = false;
Expand Down Expand Up @@ -144,6 +148,7 @@ public class Layouts.ItemRow : Layouts.ItemBase {
hide_subtask_revealer.reveal_child = subitems.has_children;
hide_loading_button.add_css_class ("no-padding");
hide_loading_revealer.reveal_child = false;
show_subtasks_revealer.reveal_child = false;

check_due ();
check_description ();
Expand Down Expand Up @@ -539,8 +544,30 @@ public class Layouts.ItemRow : Layouts.ItemBase {
subitems.present_item (item);
subitems.reveal_child = item.collapsed;

show_subtasks_label = new Gtk.Label (null);

var show_subtasks_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
show_subtasks_box.append (new Gtk.Image.from_icon_name ("go-next-symbolic") {
pixel_size = 12
});
show_subtasks_box.append (show_subtasks_label);

show_subtasks_button = new Gtk.Button () {
css_classes = { "flat", "small-button", "hidden-button" },
child = show_subtasks_box,
margin_start = 16,
margin_bottom = 3,
halign = START
};

show_subtasks_revealer = new Gtk.Revealer () {
child = show_subtasks_button,
reveal_child = subitems.has_children && edit
};

var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
box.append (itemrow_box);
box.append (show_subtasks_revealer);
box.append (subitems);

hide_subtask_button = new Gtk.Button () {
Expand All @@ -554,6 +581,7 @@ public class Layouts.ItemRow : Layouts.ItemBase {

if (item.collapsed) {
hide_subtask_button.add_css_class ("opened");
show_subtasks_button.add_css_class ("opened");
}

hide_subtask_revealer = new Gtk.Revealer () {
Expand Down Expand Up @@ -759,6 +787,11 @@ public class Layouts.ItemRow : Layouts.ItemBase {
item.update_local ();
})] = hide_subtask_button;

signals_map[show_subtasks_button.clicked.connect (() => {
item.collapsed = !item.collapsed;
item.update_local ();
})] = show_subtasks_button;

signals_map[subitems.children_changes.connect (() => {
check_hide_subtask_button ();
})] = subitems;
Expand All @@ -768,8 +801,10 @@ public class Layouts.ItemRow : Layouts.ItemBase {

if (item.collapsed) {
hide_subtask_button.add_css_class ("opened");
show_subtasks_button.add_css_class ("opened");
} else {
hide_subtask_button.remove_css_class ("opened");
show_subtasks_button.remove_css_class ("opened");
}
})] = item;

Expand Down Expand Up @@ -916,6 +951,8 @@ public class Layouts.ItemRow : Layouts.ItemBase {
pin_button.update_from_item (item);
reminder_button.set_reminders (item.reminders);

show_subtasks_label.label = item.collapsed ? _("Hide Sub-tasks") : _("Show Sub-tasks");

check_due ();
check_description ();
check_pinboard ();
Expand Down

0 comments on commit 1febec3

Please sign in to comment.