[epiphany] notebook: Allow to hide the tabs in narrow mode
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] notebook: Allow to hide the tabs in narrow mode
- Date: Fri, 25 Jan 2019 16:45:32 +0000 (UTC)
commit ded202f83d9cbb9de20acb8234145be1cc3117c4
Author: Adrien Plazas <kekun plazas laposte net>
Date: Tue Nov 13 13:48:46 2018 +0100
notebook: Allow to hide the tabs in narrow mode
This will avoid to have two tabs lists in narrow mode.
src/ephy-notebook.c | 13 +++++++++++++
src/ephy-notebook.h | 4 ++++
2 files changed, 17 insertions(+)
---
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 798ed8346..c27ac21e8 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -48,6 +48,8 @@
struct _EphyNotebook {
GtkNotebook parent_instance;
+ EphyAdaptiveMode adaptive_mode;
+
GList *focused_pages;
guint tabs_vis_notifier_id;
@@ -360,6 +362,7 @@ update_tabs_visibility (EphyNotebook *nb,
EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY);
if (mode != EPHY_EMBED_SHELL_MODE_APPLICATION &&
+ nb->adaptive_mode != EPHY_ADAPTIVE_MODE_NARROW &&
((policy == EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_MORE_THAN_ONE && num > 1) ||
policy == EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_ALWAYS))
show_tabs = TRUE;
@@ -1048,3 +1051,13 @@ ephy_notebook_get_pages_menu (EphyNotebook *notebook)
return notebook->tab_menu;
}
+
+void
+ephy_notebook_set_adaptive_mode (EphyNotebook *notebook,
+ EphyAdaptiveMode adaptive_mode)
+{
+ g_assert (EPHY_IS_NOTEBOOK (notebook));
+
+ notebook->adaptive_mode = adaptive_mode;
+ update_tabs_visibility (notebook, FALSE);
+}
diff --git a/src/ephy-notebook.h b/src/ephy-notebook.h
index cdd586d52..39fe6a72d 100644
--- a/src/ephy-notebook.h
+++ b/src/ephy-notebook.h
@@ -25,6 +25,7 @@
#include <glib.h>
#include <gtk/gtk.h>
+#include "ephy-adaptive-mode.h"
#include "ephy-embed.h"
G_BEGIN_DECLS
@@ -47,4 +48,7 @@ void ephy_notebook_prev_page (EphyNotebook *notebook);
GMenu *ephy_notebook_get_pages_menu (EphyNotebook *notebook);
+void ephy_notebook_set_adaptive_mode (EphyNotebook *notebook,
+ EphyAdaptiveMode adaptive_mode);
+
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]