Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed May 16, 2024
2 parents f4a88b8 + a510b0c commit 0a0d0bd
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 47 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ on:
- synchronize

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
version: [stable, unstable, development-target]
container:
image: ghcr.io/elementary/docker:${{ matrix.version }}

steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
apt update
apt install -y libchamplain-0.12-dev libchamplain-gtk-0.12-dev libclutter-1.0-dev libclutter-gtk-1.0-dev libecal2.0-dev libedataserver1.2-dev libgeoclue-2-dev libgeocode-glib-dev libgdata-dev libgranite-dev libgtk-3-dev libhandy-1-dev libical-dev libportal-dev libportal-gtk3-dev meson valac
- name: Build and Test
env:
DESTDIR: out
run: |
meson setup build
ninja -C build install
ninja -C build test
flatpak:
name: Flatpak
runs-on: ubuntu-latest
Expand Down
30 changes: 16 additions & 14 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class Tasks.MainWindow : Gtk.ApplicationWindow {
hscrollbar_policy = Gtk.PolicyType.NEVER
};

add_tasklist_buttonbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 6); // TODO: check spacing
add_tasklist_buttonbox = new Gtk.Box (VERTICAL, 3);

var online_accounts_button = new Widgets.PopoverButton ();
online_accounts_button.append (new Gtk.Label (_("Online Accounts Settings…")));
Expand All @@ -89,29 +89,33 @@ public class Tasks.MainWindow : Gtk.ApplicationWindow {
};
add_tasklist_popover.add_css_class (Granite.STYLE_CLASS_MENU);

var add_tasklist_button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
add_tasklist_button_box.append (new Gtk.Image.from_icon_name ("list-add-symbolic"));
add_tasklist_button_box.append (new Gtk.Label (_("Add Task List…")));
var add_list_label = new Gtk.Label (_("Add Task List…"));

var add_list_button_box = new Gtk.Box (HORIZONTAL, 0);
add_list_button_box.append (new Gtk.Image.from_icon_name ("list-add-symbolic"));
add_list_button_box.append (add_list_label);

var add_tasklist_button = new Gtk.MenuButton () {
popover = add_tasklist_popover,
direction = Gtk.ArrowType.UP,
child = add_tasklist_button_box
direction = UP,
child = add_list_button_box
};

add_list_label.mnemonic_widget = add_tasklist_button;

var actionbar = new Gtk.ActionBar ();
actionbar.add_css_class (Granite.STYLE_CLASS_FLAT);
actionbar.pack_start (add_tasklist_button);

var sidebar = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
var sidebar = new Gtk.Box (VERTICAL, 0);
sidebar.add_css_class (Granite.STYLE_CLASS_SIDEBAR);
sidebar.append (sidebar_header);
sidebar.append (scrolledwindow);
sidebar.append (actionbar);

task_list_grid_stack = new Gtk.Stack ();

var main_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
var main_box = new Gtk.Box (VERTICAL, 0);
main_box.add_css_class (Granite.STYLE_CLASS_BACKGROUND);
main_box.append (main_header);
main_box.append (task_list_grid_stack);
Expand Down Expand Up @@ -291,9 +295,7 @@ public class Tasks.MainWindow : Gtk.ApplicationWindow {
};
error_dialog.show_error_details (error_message);
error_dialog.present ();
error_dialog.response.connect (() => {
error_dialog.destroy ();
});
error_dialog.response.connect (error_dialog.destroy);

return GLib.Source.REMOVE;
});
Expand All @@ -317,9 +319,7 @@ public class Tasks.MainWindow : Gtk.ApplicationWindow {
unowned var trash_button = message_dialog.add_button (_("Delete Anyway"), Gtk.ResponseType.YES);
trash_button.add_css_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION);

message_dialog.present ();
message_dialog.response.connect ((response_id) => {
var response = (Gtk.ResponseType) response_id;
message_dialog.response.connect ((response) => {
if (response == Gtk.ResponseType.YES) {
Tasks.Application.model.remove_task_list.begin (source, (obj, res) => {
try {
Expand All @@ -337,6 +337,8 @@ public class Tasks.MainWindow : Gtk.ApplicationWindow {

message_dialog.destroy ();
});

message_dialog.present ();
} else {
Gdk.Display.get_default ().beep ();
}
Expand Down
64 changes: 31 additions & 33 deletions src/Widgets/TaskRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public class Tasks.Widgets.TaskRow : Gtk.ListBoxRow {
}

due_datetime_popover_revealer = new Gtk.Revealer () {
child = due_datetime_popover,
margin_end = 6,
reveal_child = false,
transition_type = Gtk.RevealerTransitionType.SLIDE_RIGHT,
child = due_datetime_popover
transition_type = SLIDE_RIGHT
};

due_datetime_popover.value_format.connect ((value) => {
Expand Down Expand Up @@ -140,10 +140,10 @@ public class Tasks.Widgets.TaskRow : Gtk.ListBoxRow {
location_popover = new Tasks.Widgets.EntryPopover.Location ();

location_popover_revealer = new Gtk.Revealer () {
child = location_popover,
margin_end = 6,
reveal_child = false,
transition_type = Gtk.RevealerTransitionType.SLIDE_RIGHT,
child = location_popover
transition_type = SLIDE_RIGHT
};

location_popover.value_format.connect ((value) => {
Expand Down Expand Up @@ -182,23 +182,26 @@ public class Tasks.Widgets.TaskRow : Gtk.ListBoxRow {

// Should not use a transition that varies the width else label aligning and ellipsizing is incorrect.
description_label_revealer = new Gtk.Revealer () {
transition_type = Gtk.RevealerTransitionType.CROSSFADE,
reveal_child = false,
child = description_label
child = description_label,
transition_type = CROSSFADE,
reveal_child = false
};

var task_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 3);
var task_box = new Gtk.Box (HORIZONTAL, 0);
task_box.append (due_datetime_popover_revealer);
task_box.append (location_popover_revealer);
task_box.append (description_label_revealer);

task_detail_revealer = new Gtk.Revealer () {
transition_type = Gtk.RevealerTransitionType.SLIDE_UP,
child = task_box
child = task_box,
transition_type = SLIDE_UP
};

var description_textview = new Granite.HyperTextView () {
// border_width = 12,
top_margin = 12,
right_margin = 12,
bottom_margin = 12,
left_margin = 12,
height_request = 140,
accepts_tab = false
};
Expand All @@ -208,43 +211,39 @@ public class Tasks.Widgets.TaskRow : Gtk.ListBoxRow {
description_textview.set_buffer (description_textbuffer);

var description_frame = new Gtk.Frame (null) {
hexpand = true,
child = description_textview
child = description_textview,
hexpand = true
};

var buttons_size_group = new Gtk.SizeGroup (Gtk.SizeGroupMode.HORIZONTAL);

var cancel_button = new Gtk.Button.with_label (_("Cancel"));
buttons_size_group.add_widget (cancel_button);

var save_button = new Gtk.Button.with_label (created ? _("Save Changes") : _("Add Task"));
save_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION);
buttons_size_group.add_widget (save_button);

var right_buttons_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6) {
halign = Gtk.Align.END,
var right_buttons_box = new Gtk.Box (HORIZONTAL, 6) {
hexpand = true,
halign = END,
homogeneous = true
};
right_buttons_box.append (cancel_button);
right_buttons_box.append (save_button);

var button_grid = new Gtk.Grid () {
margin_top = 12,
column_homogeneous = true
var button_box = new Gtk.Box (HORIZONTAL, 6) {
margin_top = 12
};
button_grid.add_css_class ("button-box");
button_grid.attach (right_buttons_box, 1, 0);
button_box.add_css_class ("button-box");
button_box.append (right_buttons_box);

var form_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 12) {
var form_box = new Gtk.Box (VERTICAL, 12) {
margin_top = 6,
margin_bottom = 6
};
form_box.append (description_frame);
form_box.append (button_grid);
form_box.append (button_box);

task_form_revealer = new Gtk.Revealer () {
transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN,
child = form_box
child = form_box,
transition_type = SLIDE_DOWN
};

var grid = new Gtk.Grid () {
Expand All @@ -261,9 +260,9 @@ public class Tasks.Widgets.TaskRow : Gtk.ListBoxRow {
grid.attach (task_form_revealer, 1, 2);

revealer = new Gtk.Revealer () {
child = grid,
reveal_child = true,
transition_type = Gtk.RevealerTransitionType.SLIDE_UP,
child = grid
transition_type = SLIDE_UP
};

child = revealer;
Expand All @@ -278,12 +277,11 @@ public class Tasks.Widgets.TaskRow : Gtk.ListBoxRow {
state_stack.visible_child = check;

var delete_button = new Gtk.Button.with_label (_("Delete Task")) {
halign = Gtk.Align.START
halign = START
};
delete_button.add_css_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION);
buttons_size_group.add_widget (delete_button);

button_grid.attach (delete_button, 0, 0);
button_box.prepend (delete_button);

delete_button.clicked.connect (() => {
end_editing ();
Expand Down

0 comments on commit 0a0d0bd

Please sign in to comment.