GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit 9766e060 authored by Jan-Michael Brummer's avatar Jan-Michael Brummer Committed by Michael Catanzaro

Use elementary-style headerbar icons in Pantheon

Fixes: #67
parent 6874d776
Pipeline #76953 passed with stage
in 4 minutes and 26 seconds
......@@ -20,7 +20,7 @@
*/
#include "ephy-action-bar-end.h"
#include "ephy-desktop-utils.h"
#include "ephy-downloads-popover.h"
#include "ephy-downloads-progress-icon.h"
#include "ephy-shell.h"
......@@ -256,6 +256,12 @@ ephy_action_bar_end_init (EphyActionBarEnd *action_bar_end)
gtk_menu_button_set_popover (GTK_MENU_BUTTON (action_bar_end->downloads_button), action_bar_end->downloads_popover);
}
if (is_desktop_pantheon ()) {
gtk_button_set_image (GTK_BUTTON (action_bar_end->bookmarks_button),
gtk_image_new_from_icon_name ("user-bookmarks",
GTK_ICON_SIZE_LARGE_TOOLBAR));
}
g_signal_connect_object (downloads_manager, "download-added",
G_CALLBACK (download_added_cb),
object, 0);
......
......@@ -21,6 +21,7 @@
#include "ephy-action-bar-start.h"
#include "ephy-desktop-utils.h"
#include "ephy-embed.h"
#include "ephy-embed-container.h"
#include "ephy-embed-prefs.h"
......@@ -467,6 +468,15 @@ ephy_action_bar_start_dispose (GObject *object)
G_OBJECT_CLASS (ephy_action_bar_start_parent_class)->dispose (object);
}
static GtkIconSize
get_icon_size (void)
{
if (is_desktop_pantheon ())
return GTK_ICON_SIZE_LARGE_TOOLBAR;
return GTK_ICON_SIZE_BUTTON;
}
static void
ephy_action_bar_start_constructed (GObject *object)
{
......@@ -514,6 +524,18 @@ ephy_action_bar_start_constructed (GObject *object)
g_signal_connect (action_bar_start->new_tab_button, "button-release-event",
G_CALLBACK (new_tab_button_release_event_cb), action_bar_start);
if (is_desktop_pantheon ()) {
gtk_button_set_image (GTK_BUTTON (action_bar_start->navigation_back),
gtk_image_new_from_icon_name ("go-previous-symbolic",
get_icon_size ()));
gtk_button_set_image (GTK_BUTTON (action_bar_start->navigation_forward),
gtk_image_new_from_icon_name ("go-next-symbolic",
get_icon_size ()));
gtk_button_set_image (GTK_BUTTON (action_bar_start->homepage_button),
gtk_image_new_from_icon_name ("go-home-symbolic",
get_icon_size ()));
}
}
static void
......@@ -574,16 +596,16 @@ ephy_action_bar_start_change_combined_stop_reload_state (EphyActionBarStart *act
gboolean loading)
{
if (loading) {
gtk_image_set_from_icon_name (GTK_IMAGE (action_bar_start->combined_stop_reload_image),
gtk_image_set_from_icon_name (GTK_IMAGE (action_bar_start->combined_stop_reload_image),
"process-stop-symbolic",
GTK_ICON_SIZE_BUTTON);
get_icon_size());
/* Translators: tooltip for the stop button */
gtk_widget_set_tooltip_text (action_bar_start->combined_stop_reload_button,
_("Stop loading the current page"));
} else {
gtk_image_set_from_icon_name (GTK_IMAGE (action_bar_start->combined_stop_reload_image),
"view-refresh-symbolic",
GTK_ICON_SIZE_BUTTON);
gtk_image_set_from_icon_name (GTK_IMAGE (action_bar_start->combined_stop_reload_image),
"view-refresh-symbolic",
get_icon_size());
gtk_widget_set_tooltip_text (action_bar_start->combined_stop_reload_button,
_(REFRESH_BUTTON_TOOLTIP));
}
......
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Copyright © 2019 Jan-Michael Brummer <jan.brummer@tabos.org>
*
* This file is part of Epiphany.
*
* Epiphany 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.
*
* Epiphany 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 Epiphany. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "ephy-desktop-utils.h"
gboolean
is_desktop_pantheon (void)
{
const gchar *xdg_current_desktop = g_environ_getenv (g_get_environ (), "XDG_CURRENT_DESKTOP");
if (!xdg_current_desktop)
return FALSE;
return strstr (xdg_current_desktop, "Pantheon") != NULL;
}
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Copyright © 2019 Jan-Michael Brummer <jan.brummer@tabos.org>
*
* This file is part of Epiphany.
*
* Epiphany 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.
*
* Epiphany 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 Epiphany. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <glib.h>
G_BEGIN_DECLS
gboolean is_desktop_pantheon (void);
G_END_DECLS
......@@ -24,6 +24,7 @@
#include "ephy-header-bar.h"
#include "ephy-add-bookmark-popover.h"
#include "ephy-desktop-utils.h"
#include "ephy-embed-utils.h"
#include "ephy-flatpak-utils.h"
#include "ephy-location-entry.h"
......@@ -135,17 +136,6 @@ update_revealer_visibility (GtkRevealer *revealer)
gtk_revealer_get_child_revealed (revealer));
}
static gboolean
is_desktop_pantheon (void)
{
const gchar *xdg_current_desktop = g_environ_getenv (g_get_environ (), "XDG_CURRENT_DESKTOP");
if (!xdg_current_desktop)
return FALSE;
return strstr (xdg_current_desktop, "Pantheon") != NULL;
}
static void
ephy_header_bar_constructed (GObject *object)
{
......@@ -237,9 +227,15 @@ ephy_header_bar_constructed (GObject *object)
gtk_widget_destroy (GTK_WIDGET (gtk_builder_get_object (builder, "help-button")));
}
if (is_desktop_pantheon ())
if (is_desktop_pantheon ()) {
gtk_widget_destroy (GTK_WIDGET (gtk_builder_get_object (builder, "about-button")));
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name ("open-menu",
GTK_ICON_SIZE_LARGE_TOOLBAR));
}
gtk_menu_button_set_popover (GTK_MENU_BUTTON (button), page_menu_popover);
g_object_unref (builder);
......
......@@ -1209,3 +1209,4 @@ ephy_shell_open_uris (EphyShell *shell,
shell->open_uris_idle_ids = g_slist_prepend (shell->open_uris_idle_ids, GUINT_TO_POINTER (id));
}
......@@ -25,6 +25,7 @@ libephymain_sources = [
'ephy-action-bar-end.c',
'ephy-action-bar-start.c',
'ephy-action-helper.c',
'ephy-desktop-utils.c',
'ephy-encoding-dialog.c',
'ephy-encoding-row.c',
'ephy-header-bar.c',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment