diff --git a/icons/16x16/tag-new.svg b/icons/16x16/tag-new.svg new file mode 100644 index 00000000..f8adec63 --- /dev/null +++ b/icons/16x16/tag-new.svg @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/icons/16x16/tag.svg b/icons/16x16/tag.svg new file mode 100644 index 00000000..b845b319 --- /dev/null +++ b/icons/16x16/tag.svg @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/icons/24x24/mail-move.svg b/icons/24x24/mail-move.svg new file mode 100644 index 00000000..c3e2b292 --- /dev/null +++ b/icons/24x24/mail-move.svg @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/24x24/tag-new.svg b/icons/24x24/tag-new.svg new file mode 100644 index 00000000..d43c2d37 --- /dev/null +++ b/icons/24x24/tag-new.svg @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/24x24/tag.svg b/icons/24x24/tag.svg new file mode 100644 index 00000000..76326711 --- /dev/null +++ b/icons/24x24/tag.svg @@ -0,0 +1,338 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index 90a7d2f5..70bed5d4 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -7,14 +7,28 @@ set(ICON_FILES mail-inbox.png mail-sent.png menu-down.svg - multiple-tags.png non-starred-grey.png - one-tag.png remove-formatting.png starred.png ) +set(ICON_FILES_16 + 16x16/tag.svg + 16x16/tag-new.svg +) + +set(ICON_FILES_24 + 24x24/mail-move.svg + 24x24/tag.svg + 24x24/tag-new.svg +) + install(FILES ${ICON_FILES} DESTINATION ${ICONS_DEST}) + +install(FILES ${ICON_FILES_16} DESTINATION ${ICONS_DEST}/16x16) +install(FILES ${ICON_FILES_24} DESTINATION ${ICONS_DEST}/24x24) + +# Application icon goes in theme directory install(FILES "48x48/geary.svg" DESTINATION share/icons/hicolor/48x48/apps) install(FILES "128x128/geary.svg" DESTINATION share/icons/hicolor/128x128/apps) diff --git a/icons/multiple-tags.png b/icons/multiple-tags.png deleted file mode 100644 index 5c09cf2e..00000000 Binary files a/icons/multiple-tags.png and /dev/null differ diff --git a/icons/one-tag.png b/icons/one-tag.png deleted file mode 100644 index fb456c7d..00000000 Binary files a/icons/one-tag.png and /dev/null differ diff --git a/src/client/ui/folder-menu.vala b/src/client/ui/folder-menu.vala index c268183b..74cfc912 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 label) { + public FolderMenu(Gtk.ToggleToolButton button, string? icon_name, string? label) { this.button = button; // TODO Add fancy filter option. @@ -27,7 +27,8 @@ public class FolderMenu { proxy_menu = new Gtk.Menu(); add_proxy_menu(button, label, proxy_menu); - make_menu_dropdown_button(button, label); + // only use label for proxy, not the toolbar + make_menu_dropdown_button(button, icon_name, 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 1d120185..75742a23 100644 --- a/src/client/ui/icon-factory.vala +++ b/src/client/ui/icon-factory.vala @@ -28,8 +28,8 @@ public class IconFactory { public Gdk.Pixbuf starred { get; private set; } public Gdk.Pixbuf unstarred { get; private set; } - public ThemedIcon label_icon { get; private set; default = new ThemedIcon("one-tag"); } - public ThemedIcon label_folder_icon { get; private set; default = new ThemedIcon("multiple-tags"); } + 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; } @@ -40,6 +40,8 @@ public class IconFactory { append_icons_search_path(null); append_icons_search_path("128x128"); append_icons_search_path("48x48"); + append_icons_search_path("24x24"); + append_icons_search_path("16x16"); // Load icons here. application_icon = load("geary", APPLICATION_ICON_SIZE); @@ -58,18 +60,24 @@ public class IconFactory { } private Gdk.Pixbuf? load(string icon_name, int size, Gtk.IconLookupFlags flags = 0) { - // First try the requested image. - try { - return icon_theme.load_icon(icon_name, size, flags); - } catch (Error e) { - warning("Couldn't load icon. Error: " + e.message); + // Try looking up IconInfo (to report path in case of error) then load image + Gtk.IconInfo? icon_info = icon_theme.lookup_icon(icon_name, size, flags); + if (icon_info != null) { + try { + return icon_info.load_icon(); + } catch (Error err) { + warning("Couldn't load icon %s at %s, falling back to image-missing: %s", icon_name, + icon_info.get_filename(), err.message); + } + } else { + debug("Unable to lookup icon %s, falling back to image-missing...", icon_name); } - + // If that fails, try the missing image icon instead. try { return icon_theme.load_icon("image-missing", size, flags); - } catch (Error e) { - warning("Couldn't load image-missing icon. Error: " + e.message); + } catch (Error err) { + warning("Couldn't load image-missing icon: %s", err.message); } // If that fails... well they're out of luck. diff --git a/src/client/ui/main-toolbar.vala b/src/client/ui/main-toolbar.vala index 1a69d8d8..2abdcc11 100644 --- a/src/client/ui/main-toolbar.vala +++ b/src/client/ui/main-toolbar.vala @@ -26,11 +26,11 @@ 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, _("Label as")); + copy_folder_menu = new FolderMenu(copy_menu_button, "tag-new", _("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, _("Move to")); + move_folder_menu = new FolderMenu(move_menu_button, "mail-move", _("Move to")); // Assemble mark menu button. GearyApplication.instance.load_ui_file("toolbar_mark_menu.ui"); @@ -40,7 +40,7 @@ public class MainToolbar : Gtk.Box { GearyController.ACTION_MARK_AS_MENU) as Gtk.ToggleToolButton; attach_menu(mark_menu, mark_menu_button); string mark_menu_label = _("Mark"); - make_menu_dropdown_button(mark_menu_button, mark_menu_label); + make_menu_dropdown_button(mark_menu_button, null, mark_menu_label); Gtk.Menu mark_proxy_menu = (Gtk.Menu) GearyApplication.instance.ui_manager .get_widget("/ui/ToolbarMarkMenuProxy"); add_proxy_menu(mark_menu_button, mark_menu_label, mark_proxy_menu); diff --git a/src/client/util/util-menu.vala b/src/client/util/util-menu.vala index 939d6c01..5c1ce5b8 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 label) { +public void make_menu_dropdown_button(Gtk.ToggleToolButton toggle_tool_button, string? icon_name, 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"); @@ -37,10 +37,17 @@ public void make_menu_dropdown_button(Gtk.ToggleToolButton toggle_tool_button, s toggle_button.remove(child); Gtk.Box box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); - toggle_button.add(box); box.set_homogeneous(false); - box.pack_start(new Gtk.Label(label)); - box.pack_start(new Gtk.Image.from_icon_name("menu-down", Gtk.IconSize.SMALL_TOOLBAR)); + + if (icon_name != null) + box.pack_start(new Gtk.Image.from_icon_name(icon_name, Gtk.IconSize.SMALL_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)); + + toggle_button.add(box); } public void add_proxy_menu(Gtk.ToolItem tool_item, string label, Gtk.Menu proxy_menu) { diff --git a/ui/toolbar.glade b/ui/toolbar.glade index eb0d1d47..39b9adca 100644 --- a/ui/toolbar.glade +++ b/ui/toolbar.glade @@ -102,7 +102,7 @@ Move the selected conversation False False - folder + mail-move False @@ -117,7 +117,7 @@ Label the selected conversation False False - multiple-tags + tag-new False