diff --git a/icons/16x16/tags.svg b/icons/16x16/tags.svg
new file mode 100644
index 00000000..be9a0b13
--- /dev/null
+++ b/icons/16x16/tags.svg
@@ -0,0 +1,225 @@
+
+
+
+
diff --git a/icons/24x24/mail-move.svg b/icons/24x24/mail-move.svg
index c3e2b292..9a055ea1 100644
--- a/icons/24x24/mail-move.svg
+++ b/icons/24x24/mail-move.svg
@@ -2,66 +2,202 @@
diff --git a/src/client/models/folder-list.vala b/src/client/models/folder-list.vala
index 58bceb9b..c331567a 100644
--- a/src/client/models/folder-list.vala
+++ b/src/client/models/folder-list.vala
@@ -37,7 +37,7 @@ public class FolderList : Sidebar.Tree {
public Icon? get_sidebar_icon() {
switch (folder.get_special_folder_type()) {
case Geary.SpecialFolderType.NONE:
- return IconFactory.instance.label_icon;
+ return IconFactory.instance.get_custom_icon("tag", IconFactory.ICON_SIDEBAR);
case Geary.SpecialFolderType.INBOX:
return new ThemedIcon("mail-inbox");
@@ -132,7 +132,8 @@ public class FolderList : Sidebar.Tree {
}
private void reset_user_folder_group() {
- user_folder_group = new Sidebar.Grouping("", IconFactory.instance.label_folder_icon);
+ user_folder_group = new Sidebar.Grouping("",
+ IconFactory.instance.get_custom_icon("tags", IconFactory.ICON_SIDEBAR));
user_folder_branch = new Sidebar.Branch(user_folder_group,
Sidebar.Branch.Options.STARTUP_OPEN_GROUPING, user_folder_comparator);
}
diff --git a/src/client/ui/folder-menu.vala b/src/client/ui/folder-menu.vala
index 74cfc912..f5ffbbee 100644
--- a/src/client/ui/folder-menu.vala
+++ b/src/client/ui/folder-menu.vala
@@ -12,7 +12,7 @@ public class FolderMenu {
public signal void folder_selected(Geary.Folder folder);
- public FolderMenu(Gtk.ToggleToolButton button, string? icon_name, string? label) {
+ public FolderMenu(Gtk.ToggleToolButton button, Icon? icon, string? label) {
this.button = button;
// TODO Add fancy filter option.
@@ -28,7 +28,7 @@ public class FolderMenu {
add_proxy_menu(button, label, proxy_menu);
// only use label for proxy, not the toolbar
- make_menu_dropdown_button(button, icon_name, null);
+ make_menu_dropdown_button(button, icon, null);
}
public void add_folder(Geary.Folder folder) {
diff --git a/src/client/ui/icon-factory.vala b/src/client/ui/icon-factory.vala
index 75742a23..0712e73f 100644
--- a/src/client/ui/icon-factory.vala
+++ b/src/client/ui/icon-factory.vala
@@ -6,6 +6,9 @@
// Singleton class to hold icons.
public class IconFactory {
+ public const Gtk.IconSize ICON_TOOLBAR = Gtk.IconSize.LARGE_TOOLBAR;
+ public const Gtk.IconSize ICON_SIDEBAR = Gtk.IconSize.MENU;
+
private static IconFactory? _instance = null;
public static IconFactory instance {
get {
@@ -23,19 +26,19 @@ public class IconFactory {
public const int UNREAD_ICON_SIZE = 16;
public Gdk.Pixbuf unread { get; private set; }
-
+
public const int STAR_ICON_SIZE = 16;
public Gdk.Pixbuf starred { get; private set; }
public Gdk.Pixbuf unstarred { get; private set; }
-
- public ThemedIcon label_icon { get; private set; default = new ThemedIcon("tag"); }
- public ThemedIcon label_folder_icon { get; private set; default = new ThemedIcon("tag"); }
private Gtk.IconTheme icon_theme { get; private set; }
+ private File icons_dir;
+
// Creates the icon factory.
private IconFactory() {
icon_theme = Gtk.IconTheme.get_default();
+ icons_dir = GearyApplication.instance.get_resource_directory().get_child("icons");
append_icons_search_path(null);
append_icons_search_path("128x128");
@@ -50,13 +53,27 @@ public class IconFactory {
unstarred = load("non-starred-grey", STAR_ICON_SIZE);
}
- private void append_icons_search_path(string? name) {
- File basedir = GearyApplication.instance.get_resource_directory().get_child("icons");
+ public Icon get_custom_icon(string name, Gtk.IconSize size) {
+ int pixels;
+ switch (size) {
+ case ICON_SIDEBAR:
+ pixels = 16;
+ break;
+
+ case ICON_TOOLBAR:
+ default:
+ pixels = 24;
+ break;
+ }
+ return new FileIcon(icons_dir.get_child("%dx%d".printf(pixels, pixels)).get_child("%s.svg".printf(name)));
+ }
+
+ private void append_icons_search_path(string? name) {
if (Geary.String.is_empty(name))
- icon_theme.append_search_path(basedir.get_path());
+ icon_theme.append_search_path(icons_dir.get_path());
else
- icon_theme.append_search_path(basedir.get_child(name).get_path());
+ icon_theme.append_search_path(icons_dir.get_child(name).get_path());
}
private Gdk.Pixbuf? load(string icon_name, int size, Gtk.IconLookupFlags flags = 0) {
diff --git a/src/client/ui/main-toolbar.vala b/src/client/ui/main-toolbar.vala
index 2abdcc11..0d7841a9 100644
--- a/src/client/ui/main-toolbar.vala
+++ b/src/client/ui/main-toolbar.vala
@@ -26,11 +26,13 @@ public class MainToolbar : Gtk.Box {
// Setup the folder menus (move/copy).
Gtk.ToggleToolButton copy_menu_button = set_toolbutton_action(builder,
GearyController.ACTION_COPY_MENU) as Gtk.ToggleToolButton;
- copy_folder_menu = new FolderMenu(copy_menu_button, "tag-new", _("Label as"));
+ copy_folder_menu = new FolderMenu(copy_menu_button,
+ IconFactory.instance.get_custom_icon("tag-new", IconFactory.ICON_TOOLBAR), _("Label as"));
Gtk.ToggleToolButton move_menu_button = set_toolbutton_action(builder,
GearyController.ACTION_MOVE_MENU) as Gtk.ToggleToolButton;
- move_folder_menu = new FolderMenu(move_menu_button, "mail-move", _("Move to"));
+ move_folder_menu = new FolderMenu(move_menu_button,
+ IconFactory.instance.get_custom_icon("mail-move", IconFactory.ICON_TOOLBAR), _("Move to"));
// Assemble mark menu button.
GearyApplication.instance.load_ui_file("toolbar_mark_menu.ui");
diff --git a/src/client/util/util-menu.vala b/src/client/util/util-menu.vala
index 5c1ce5b8..9c9c9ccc 100644
--- a/src/client/util/util-menu.vala
+++ b/src/client/util/util-menu.vala
@@ -25,7 +25,7 @@ public void menu_popup_relative(Gtk.Menu menu, out int x, out int y, out bool pu
}
// This method must be called AFTER the button is added to the toolbar.
-public void make_menu_dropdown_button(Gtk.ToggleToolButton toggle_tool_button, string? icon_name, string? label) {
+public void make_menu_dropdown_button(Gtk.ToggleToolButton toggle_tool_button, Icon? icon, string? label) {
Gtk.ToggleButton? toggle_button = toggle_tool_button.get_child() as Gtk.ToggleButton;
if (toggle_button == null) {
debug("Problem making dropdown button: ToggleToolButton's child is not a ToggleButton");
@@ -39,13 +39,13 @@ public void make_menu_dropdown_button(Gtk.ToggleToolButton toggle_tool_button, s
Gtk.Box box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
box.set_homogeneous(false);
- if (icon_name != null)
- box.pack_start(new Gtk.Image.from_icon_name(icon_name, Gtk.IconSize.SMALL_TOOLBAR));
+ if (icon != null)
+ box.pack_start(new Gtk.Image.from_gicon(icon, Gtk.IconSize.LARGE_TOOLBAR));
if (label != null)
box.pack_start(new Gtk.Label(label));
- box.pack_end(new Gtk.Image.from_icon_name("menu-down", Gtk.IconSize.SMALL_TOOLBAR));
+ box.pack_end(new Gtk.Image.from_icon_name("menu-down", Gtk.IconSize.LARGE_TOOLBAR));
toggle_button.add(box);
}