diff --git a/data/icons/categories.gresource.xml b/data/icons/categories.gresource.xml index 456c70a98..351e4f457 100644 --- a/data/icons/categories.gresource.xml +++ b/data/icons/categories.gresource.xml @@ -11,13 +11,8 @@ finance-symbolic.svg currency-dollar-symbolic.svg - online-account-facebook.svg internet-mail-symbolic.svg web-browser-symbolic.svg - online-account-reddit.svg - online-account-tumblr.svg - online-account-twitter.svg - online-account-telegram.svg text-x-copying-symbolic.svg oars/old-runtime.svg diff --git a/data/icons/online-account-facebook.svg b/data/icons/online-account-facebook.svg deleted file mode 100644 index 5111f9e78..000000000 --- a/data/icons/online-account-facebook.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - image/svg+xml - - elementary Icon Template - - - - elementary Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/icons/online-account-reddit.svg b/data/icons/online-account-reddit.svg deleted file mode 100644 index 6529b43ef..000000000 --- a/data/icons/online-account-reddit.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - image/svg+xml - - elementary Icon Template - - - - elementary Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/icons/online-account-telegram.svg b/data/icons/online-account-telegram.svg deleted file mode 100644 index d01c41dd3..000000000 --- a/data/icons/online-account-telegram.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - image/svg+xml - - elementary Icon Template - - - - elementary Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/icons/online-account-tumblr.svg b/data/icons/online-account-tumblr.svg deleted file mode 100644 index a955286d2..000000000 --- a/data/icons/online-account-tumblr.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - image/svg+xml - - elementary Icon Template - - - - elementary Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/icons/online-account-twitter.svg b/data/icons/online-account-twitter.svg deleted file mode 100644 index c53da7b71..000000000 --- a/data/icons/online-account-twitter.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - image/svg+xml - - elementary Icon Template - - - - elementary Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/po/POTFILES b/po/POTFILES index c34d18dcf..a5954fa75 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -32,7 +32,6 @@ src/Widgets/HumbleButton.vala src/Widgets/PackageRow.vala src/Widgets/ProgressButton.vala src/Widgets/ReleaseRow.vala -src/Widgets/SharePopover.vala src/Widgets/SizeLabel.vala src/Widgets/AppContainers/AbstractPackageRowGrid.vala src/Widgets/AppContainers/InstalledPackageRowGrid.vala diff --git a/src/Views/AppInfoView.vala b/src/Views/AppInfoView.vala index b4af2b57c..f04ba61bb 100644 --- a/src/Views/AppInfoView.vala +++ b/src/Views/AppInfoView.vala @@ -746,15 +746,8 @@ public class AppCenter.Views.AppInfoView : Adw.NavigationPage { vexpand = true }; - var toast = new Granite.Toast (_("Link copied to clipboard")); - - var overlay = new Gtk.Overlay () { - child = scrolled - }; - overlay.add_overlay (toast); - var toolbar_view = new Adw.ToolbarView () { - content = overlay, + content = scrolled, top_bar_style = RAISED }; toolbar_view.add_top_bar (headerbar); @@ -763,36 +756,6 @@ public class AppCenter.Views.AppInfoView : Adw.NavigationPage { title = package.get_name (); tag = package.hash; - if (package.is_shareable) { - var body = _("Check out %s on AppCenter:").printf (package.get_name ()); - var uri = "https://appcenter.elementary.io/%s".printf (package.component.get_id ()); - var share_popover = new SharePopover (body, uri); - - var share_icon = new Gtk.Image.from_icon_name ("send-to-symbolic") { - valign = Gtk.Align.CENTER - }; - - var share_label = new Gtk.Label (_("Share")); - - var share_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); - share_box.append (share_icon); - share_box.append (share_label); - - var share_button = new Gtk.MenuButton () { - child = share_box, - has_frame = false, - direction = Gtk.ArrowType.UP, - popover = share_popover - }; - share_button.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); - - share_popover.link_copied.connect (() => { - toast.send_notification (); - }); - - links_flowbox.append (share_button); - } - package.notify["state"].connect (on_package_state_changed); on_package_state_changed (); diff --git a/src/Widgets/SharePopover.vala b/src/Widgets/SharePopover.vala deleted file mode 100644 index 6c04c83d2..000000000 --- a/src/Widgets/SharePopover.vala +++ /dev/null @@ -1,139 +0,0 @@ -/*- - * Copyright 2017-2022 elementary, Inc. (https://elementary.io) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Authored by: Danielle Foré - */ - -public class SharePopover : Gtk.Popover { - public signal void link_copied (); - - public string body { get; set; } - public string uri { get; set; } - - public SharePopover (string body, string uri) { - Object ( - body: body, - uri: uri - ); - } - - construct { - var facebook_button = new Gtk.Button.from_icon_name ("online-account-facebook") { - tooltip_text = _("Facebook") - }; - - var twitter_button = new Gtk.Button.from_icon_name ("online-account-twitter") { - tooltip_text = _("Twitter") - }; - - var reddit_button = new Gtk.Button.from_icon_name ("online-account-reddit") { - tooltip_text = _("Reddit") - }; - - var tumblr_button = new Gtk.Button.from_icon_name ("online-account-tumblr") { - tooltip_text = _("Tumblr") - }; - - var telegram_button = new Gtk.Button.from_icon_name ("online-account-telegram") { - tooltip_text = _("Telegram") - }; - - var copy_link_button = new Gtk.Button.from_icon_name ("edit-copy-symbolic") { - tooltip_text = _("Copy link") - }; - ((Gtk.Image) copy_link_button.child).pixel_size = 24; - - var size_group = new Gtk.SizeGroup (Gtk.SizeGroupMode.BOTH); - size_group.add_widget (facebook_button); - size_group.add_widget (copy_link_button); - - var service_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0) { - margin_top = 6, - margin_end = 6, - margin_bottom = 6, - margin_start = 6 - }; - service_box.add_css_class (Granite.STYLE_CLASS_LARGE_ICONS); - - var mail_appinfo = AppInfo.get_default_for_uri_scheme ("mailto"); - if (mail_appinfo != null) { - var email_button = new Gtk.Button () { - child = new Gtk.Image.from_gicon (mail_appinfo.get_icon ()), - tooltip_text = mail_appinfo.get_display_name () - }; - email_button.add_css_class ("image-button"); - - service_box.append (email_button); - - email_button.clicked.connect (() => { - show_uri ("mailto:?subject=%s&body=%s".printf (body, uri)); - }); - } - - service_box.append (facebook_button); - service_box.append (twitter_button); - service_box.append (reddit_button); - service_box.append (tumblr_button); - service_box.append (telegram_button); - - var system_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0) { - margin_top = 6, - margin_end = 6, - margin_bottom = 6, - margin_start = 6 - }; - system_box.append (copy_link_button); - - var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); - box.append (service_box); - box.append (new Gtk.Separator (Gtk.Orientation.HORIZONTAL)); - box.append (system_box); - - child = box; - - copy_link_button.clicked.connect (() => { - Gdk.Display.get_default ().get_clipboard ().set_text (uri); - link_copied (); - popdown (); - }); - - facebook_button.clicked.connect (() => { - show_uri ("https://www.facebook.com/sharer/sharer.php?u=%s".printf (uri)); - }); - - twitter_button.clicked.connect (() => { - show_uri ("https://twitter.com/intent/tweet?text=%s&url=%s".printf (body, uri)); - }); - - reddit_button.clicked.connect (() => { - show_uri ("http://www.reddit.com/submit?title=%s&url=%s".printf (body, uri)); - }); - - tumblr_button.clicked.connect (() => { - show_uri ("https://www.tumblr.com/share/link?url=%s".printf (uri)); - }); - - telegram_button.clicked.connect (() => { - show_uri ("https://t.me/share/url?url=%s".printf (uri)); - }); - } - - private void show_uri (string uri) { - var main_window = ((Gtk.Application) Application.get_default ()).active_window; - new Gtk.UriLauncher (uri).launch.begin (main_window, null); - popdown (); - } -} diff --git a/src/meson.build b/src/meson.build index 28d93cdce..ba1a92086 100644 --- a/src/meson.build +++ b/src/meson.build @@ -38,7 +38,6 @@ appcenter_files = files( 'Widgets/PackageRow.vala', 'Widgets/ProgressButton.vala', 'Widgets/ReleaseRow.vala', - 'Widgets/SharePopover.vala', 'Widgets/SizeLabel.vala', 'Widgets/AppContainers/AbstractPackageRowGrid.vala', 'Widgets/AppContainers/InstalledPackageRowGrid.vala',