Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,35 @@ add_project_arguments(['--vapidir', join_paths(meson.current_source_dir(), 'vapi

glib_dep = dependency('glib-2.0')
gobject_dep = dependency('gobject-2.0')
granite_dep = dependency('granite', version: '>= 6.0.0')
granite_dep = dependency('granite-7', version: '>= 7.1.0')
gtk_dep = dependency('gtk4')
gee_dep = dependency('gee-0.8')
handy_dep = dependency('libhandy-1', version: '>=1.1.90')
adw_dep = dependency('libadwaita-1', version: '>=1.0.0')
camel_dep = dependency('camel-1.2', version: '>= 3.28')
libedataserver_dep = dependency('libedataserver-1.2', version: '>= 3.28')
libedataserverui_dep = dependency('libedataserverui-1.2', version: '>=3.45.1')
webkit2_dep = dependency('webkit2gtk-4.1')
webkit2_web_extension_dep = dependency('webkit2gtk-web-extension-4.1')
libedataserver_dep = dependency('libedataserver-1.2', version: '>=3.45.1')
libedataserverui_dep = dependency('libedataserverui4-1.0', version: '>= 3.46.4')
webkit_dep = dependency('webkitgtk-6.0')
webkit_web_extension_dep = dependency('webkitgtk-web-process-extension-6.0')
libportal_dep = dependency('libportal')
libportal_gtk_dep = dependency('libportal-gtk3')
libportal_gtk_dep = dependency('libportal-gtk4')
folks_dep = dependency('folks')
m_dep = meson.get_compiler('c').find_library('m')

webkit2_extension_path = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name(), 'webkit2')
webkit_extension_path = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name(), 'webkit2')

dependencies = [
glib_dep,
gobject_dep,
granite_dep,
gtk_dep,
gee_dep,
handy_dep,
adw_dep,
camel_dep,
libedataserver_dep,
libedataserverui_dep,
libportal_dep,
libportal_gtk_dep,
webkit2_dep,
webkit_dep,
folks_dep,
m_dep
]
Expand All @@ -53,12 +55,11 @@ extension_dependencies = [
glib_dep,
gobject_dep,
gee_dep,
webkit2_web_extension_dep
webkit_web_extension_dep
]

add_global_arguments([
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
'-DHANDY_USE_UNSTABLE_API'
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name())
],
language:'c'
)
Expand Down
2 changes: 0 additions & 2 deletions po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ src/MessageList/FolderPopover/FolderPopover.vala
src/SourceList/CellRendererBadge.vala
src/SourceList/CellRendererExpander.vala
src/SourceList/SourceList.vala
src/VirtualizingListBox/VirtualizingListBoxRow.vala
src/VirtualizingListBox/VirtualizingListBox.vala
2 changes: 1 addition & 1 deletion src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class Mail.Application : Gtk.Application {
protected override void startup () {
base.startup ();

Hdy.init ();
Adw.init ();

var granite_settings = Granite.Settings.get_default ();
gtk_settings = Gtk.Settings.get_default ();
Expand Down
8 changes: 4 additions & 4 deletions src/Composer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Authored by: David Hewitt <davidmhewitt@gmail.com>
*/

public class Mail.Composer : Hdy.ApplicationWindow {
public class Mail.Composer : Adw.ApplicationWindow {
public signal void finished ();

private const string ACTION_GROUP_PREFIX = "win";
Expand All @@ -32,7 +32,7 @@ public class Mail.Composer : Hdy.ApplicationWindow {
private Gtk.Revealer cc_revealer;
private Gtk.Revealer bcc_revealer;
private Gtk.ToggleButton cc_button;
private Granite.Widgets.OverlayBar message_url_overlay;
private Granite.OverlayBar message_url_overlay;
private Gtk.ComboBoxText from_combo;
private Gtk.Entry subject_val;

Expand Down Expand Up @@ -78,7 +78,7 @@ public class Mail.Composer : Hdy.ApplicationWindow {
}
}

var headerbar = new Hdy.HeaderBar () {
var headerbar = new Adw.HeaderBar () {
has_subtitle = false,
show_close_button = true
};
Expand Down Expand Up @@ -270,7 +270,7 @@ public class Mail.Composer : Hdy.ApplicationWindow {

var view_overlay = new Gtk.Overlay ();
view_overlay.add (web_view);
message_url_overlay = new Granite.Widgets.OverlayBar (view_overlay);
message_url_overlay = new Granite.OverlayBar (view_overlay);
message_url_overlay.no_show_all = true;

var main_box = new Gtk.Box (VERTICAL, 0);
Expand Down
101 changes: 58 additions & 43 deletions src/ConversationList/ConversationList.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,55 +28,53 @@ public class Mail.ConversationList : Gtk.Box {
public Gee.Map<Backend.Account, Camel.FolderInfo?> folder_info_per_account { get; private set; }
public Gee.HashMap<string, Camel.Folder> folders { get; private set; }
public Gee.HashMap<string, Camel.FolderInfoFlags> folder_info_flags { get; private set; }
public Hdy.HeaderBar search_header { get; private set; }
public Adw.HeaderBar search_header { get; private set; }

private GLib.Cancellable? cancellable = null;
private Gee.HashMap<string, Camel.FolderThread> threads;
private Gee.HashMap<string, ConversationItemModel> conversations;
private ConversationListStore list_store;
private VirtualizingListBox list_box;
private Gtk.SearchEntry search_entry;
private Granite.SwitchModelButton hide_read_switch;
private Granite.SwitchModelButton hide_unstarred_switch;
private Gtk.MenuButton filter_button;
private Gtk.Stack refresh_stack;
private Gtk.SingleSelection selection_model;
private Gtk.ListView list_view;

private uint mark_read_timeout_id = 0;

construct {
orientation = VERTICAL;
get_style_context ().add_class (Gtk.STYLE_CLASS_VIEW);
add_css_class (Gtk.STYLE_CLASS_VIEW);

conversations = new Gee.HashMap<string, ConversationItemModel> ();
folders = new Gee.HashMap<string, Camel.Folder> ();
folder_info_flags = new Gee.HashMap<string, Camel.FolderInfoFlags> ();
threads = new Gee.HashMap<string, Camel.FolderThread> ();
list_store = new ConversationListStore ();
list_store.set_sort_func (thread_sort_function);
list_store.set_filter_func (filter_function);

list_box = new VirtualizingListBox () {
activate_on_single_click = true,
model = list_store,
selection_mode = SINGLE
};
list_box.factory_func = (item, old_widget) => {
ConversationListItem? row = null;
if (old_widget != null) {
row = old_widget as ConversationListItem;
} else {
row = new ConversationListItem ();
row.select.connect (() => {
if (list_box.selected_row_widget != row) {
list_box.select_row (row);
}
});
}

row.assign ((ConversationItemModel)item);
row.show_all ();
return row;
};
// list_box = new VirtualizingListBox () {
// activate_on_single_click = true,
// model = list_store,
// selection_mode = SINGLE
// };
// list_box.factory_func = (item, old_widget) => {
// ConversationListItem? row = null;
// if (old_widget != null) {
// row = old_widget as ConversationListItem;
// } else {
// row = new ConversationListItem ();
// row.select.connect (() => {
// if (list_box.selected_row_widget != row) {
// list_box.select_row (row);
// }
// });
// }

// row.assign ((ConversationItemModel)item);
// row.show_all ();
// return row;
// };

var application_instance = (Gtk.Application) GLib.Application.get_default ();

Expand All @@ -93,35 +91,52 @@ public class Mail.ConversationList : Gtk.Box {
margin_bottom = 3,
margin_top = 3
};
filter_menu_popover_box.add (hide_read_switch);
filter_menu_popover_box.add (hide_unstarred_switch);
filter_menu_popover_box.show_all ();
filter_menu_popover_box.append (hide_read_switch);
filter_menu_popover_box.append (hide_unstarred_switch);

var filter_popover = new Gtk.Popover (null) {
var filter_popover = new Gtk.Popover () {
child = filter_menu_popover_box
};

filter_button = new Gtk.MenuButton () {
image = new Gtk.Image.from_icon_name ("mail-filter-symbolic", Gtk.IconSize.SMALL_TOOLBAR),
icon_name = "mail-filter-symbolic",
popover = filter_popover,
tooltip_text = _("Filter Conversations"),
valign = Gtk.Align.CENTER
};

search_header = new Hdy.HeaderBar () {
search_header = new Adw.HeaderBar () {
custom_title = search_entry
};
search_header.pack_end (filter_button);
search_header.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
search_header.add_css_class (Gtk.STYLE_CLASS_FLAT);

list_store = new ConversationListStore ();
list_store.set_sort_func (thread_sort_function);
list_store.set_filter_func (filter_function);

var scrolled_window = new Gtk.ScrolledWindow (null, null) {
var deleted_filter = new Gtk.CustomFilter (deleted_filter_func);

var filter_model = new Gtk.FilterListModel (list_store, deleted_filter);

selection_model = new Gtk.SingleSelection (filter_model) {
autoselect = false
};

var factory = new Gtk.SignalListItemFactory ();

list_view = new Gtk.ListView (selection_model, factory) {
show_separators = false
};

var scrolled_window = new Gtk.ScrolledWindow () {
hscrollbar_policy = Gtk.PolicyType.NEVER,
width_request = 158,
expand = true,
child = list_box
child = list_view
};

var refresh_button = new Gtk.Button.from_icon_name ("view-refresh-symbolic", Gtk.IconSize.SMALL_TOOLBAR) {
var refresh_button = new Gtk.Button.from_icon_name ("view-refresh-symbolic") {
action_name = MainWindow.ACTION_PREFIX + MainWindow.ACTION_REFRESH
};

Expand All @@ -131,7 +146,7 @@ public class Mail.ConversationList : Gtk.Box {
);

var refresh_spinner = new Gtk.Spinner () {
active = true,
spinning = true,
halign = Gtk.Align.CENTER,
valign = Gtk.Align.CENTER,
tooltip_text = _("Fetching new messages…")
Expand All @@ -155,11 +170,11 @@ public class Mail.ConversationList : Gtk.Box {
var conversation_action_bar = new Gtk.ActionBar ();
conversation_action_bar.pack_start (refresh_stack);
conversation_action_bar.pack_end (move_spinner);
conversation_action_bar.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
conversation_action_bar.add_css_class (Granite.STYLE_CLASS_FLAT);

add (search_header);
add (scrolled_window);
add (conversation_action_bar);
append (search_header);
append (scrolled_window);
append (conversation_action_bar);

search_entry.search_changed.connect (() => load_folder.begin (folder_info_per_account));

Expand Down
10 changes: 5 additions & 5 deletions src/ConversationList/ConversationListItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Authored by: Corentin Noël <corentin@elementary.io>
*/

public class Mail.ConversationListItem : VirtualizingListBoxRow {
public class Mail.ConversationListItem : Granite.Bin {
public signal void select ();

private Gtk.Image status_icon;
Expand All @@ -30,8 +30,8 @@ public class Mail.ConversationListItem : VirtualizingListBoxRow {
private Gtk.Revealer flagged_icon_revealer;
private Gtk.Revealer status_revealer;
private Gtk.Grid grid;
private Hdy.Carousel carousel;
private Gtk.GestureMultiPress gesture_controller;
private Adw.Carousel carousel;
private Gtk.GestureClick gesture_controller;
private Gtk.EventControllerKey key_controller;

construct {
Expand Down Expand Up @@ -100,7 +100,7 @@ public class Mail.ConversationListItem : VirtualizingListBoxRow {
);
trash_affordance.get_style_context ().add_class ("trash");

carousel = new Hdy.Carousel () {
carousel = new Adw.Carousel () {
allow_scroll_wheel = false
};
carousel.add (archive_affordance);
Expand All @@ -113,7 +113,7 @@ public class Mail.ConversationListItem : VirtualizingListBoxRow {

show_all ();

gesture_controller = new Gtk.GestureMultiPress (this) {
gesture_controller = new Gtk.GestureClick (this) {
button = Gdk.BUTTON_SECONDARY,
propagation_phase = BUBBLE
};
Expand Down
4 changes: 2 additions & 2 deletions src/Dialogs/AliasDialog/AliasDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Mail.AliasDialog : Granite.Dialog {

private HashTable<string, string?> aliases;
private Gtk.ListBox list;
private Granite.Widgets.Toast toast;
private Granite.Toast toast;
private string primary_name;

public AliasDialog (string account_uid) {
Expand Down Expand Up @@ -92,7 +92,7 @@ public class Mail.AliasDialog : Granite.Dialog {
child = content_box
};

toast = new Granite.Widgets.Toast ("");
toast = new Granite.Toast ("");
toast.set_default_action (_("Undo"));

var overlay = new Gtk.Overlay () {
Expand Down
12 changes: 6 additions & 6 deletions src/Dialogs/SignatureDialog/SignatureDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Authored by: Leonhard Kargl <leo.kargl@proton.me>
*/

public class Mail.SignatureDialog : Hdy.ApplicationWindow {
public class Mail.SignatureDialog : Adw.ApplicationWindow {
private const string ACTION_GROUP_PREFIX = "win";
private const string ACTION_PREFIX = ACTION_GROUP_PREFIX + ".";

Expand All @@ -26,11 +26,11 @@ public class Mail.SignatureDialog : Hdy.ApplicationWindow {
private Mail.WebView web_view;
private Signature? current_signature;
private Signature? last_deleted_signature;
private Granite.Widgets.Toast toast;
private Granite.Toast toast;
private bool selection_change_ongoing = false;

construct {
var start_header = new Hdy.HeaderBar () {
var start_header = new Adw.HeaderBar () {
show_close_button = true
};
start_header.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
Expand Down Expand Up @@ -87,7 +87,7 @@ public class Mail.SignatureDialog : Hdy.ApplicationWindow {
margin_start = 9
};

var end_header = new Hdy.HeaderBar () {
var end_header = new Adw.HeaderBar () {
show_close_button = true
};
end_header.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
Expand Down Expand Up @@ -166,15 +166,15 @@ public class Mail.SignatureDialog : Hdy.ApplicationWindow {
paned.pack1 (start_box, false, false);
paned.pack2 (end_box, true, false);

toast = new Granite.Widgets.Toast ("");
toast = new Granite.Toast ("");
toast.set_default_action (_("Undo"));

var overlay = new Gtk.Overlay () {
child = paned
};
overlay.add_overlay (toast);

var header_group = new Hdy.HeaderGroup ();
var header_group = new Adw.HeaderGroup ();
header_group.add_header_bar (start_header);
header_group.add_header_bar (end_header);

Expand Down
Loading
Loading