[epiphany/wip/exalm/sep: 2/5] pages-view: Remove adaptive mode
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/exalm/sep: 2/5] pages-view: Remove adaptive mode
- Date: Sat, 6 Jun 2020 08:48:53 +0000 (UTC)
commit f5fdd037f3a28fb13965708c05ae44abf35d7d92
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sat Jun 6 13:41:33 2020 +0500
pages-view: Remove adaptive mode
Similarly to the popover, it's only ever used in one mode.
src/ephy-pages-view.c | 39 +++------------------------------------
src/ephy-pages-view.h | 3 ---
2 files changed, 3 insertions(+), 39 deletions(-)
---
diff --git a/src/ephy-pages-view.c b/src/ephy-pages-view.c
index f74159685..6a4aaee82 100644
--- a/src/ephy-pages-view.c
+++ b/src/ephy-pages-view.c
@@ -139,7 +139,7 @@ items_changed_cb (EphyPagesView *self,
for (int i = 0; i < added; i++) {
items[i] = ephy_page_row_new (self->notebook, position + i);
ephy_page_row_set_adaptive_mode (EPHY_PAGE_ROW (items[i]),
- self->adaptive_mode);
+ EPHY_ADAPTIVE_MODE_NARROW);
g_signal_connect_swapped (items[i], "closed", G_CALLBACK (row_closed_cb), self);
}
@@ -204,9 +204,10 @@ ephy_pages_view_init (EphyPagesView *self)
list_init (self);
+ gtk_list_box_set_header_func (self->list_box, hdy_list_box_separator_header, NULL, NULL);
+
self->list_store = g_list_store_new (EPHY_TYPE_PAGE_ROW);
- ephy_pages_view_set_adaptive_mode (self, EPHY_ADAPTIVE_MODE_NARROW);
gtk_list_box_bind_model (self->list_box,
G_LIST_MODEL (self->list_store),
create_row,
@@ -256,37 +257,3 @@ ephy_pages_view_set_notebook (EphyPagesView *self,
self,
G_CONNECT_SWAPPED);
}
-
-void
-ephy_pages_view_set_adaptive_mode (EphyPagesView *self,
- EphyAdaptiveMode adaptive_mode)
-{
- GListModel *list_model;
-
- g_assert (EPHY_IS_PAGES_VIEW (self));
-
- self->adaptive_mode = adaptive_mode;
-
- list_model = G_LIST_MODEL (self->list_store);
- for (guint i = 0; i < g_list_model_get_n_items (list_model); i++) {
- EphyPageRow *row = EPHY_PAGE_ROW (g_list_model_get_item (list_model, i));
-
- ephy_page_row_set_adaptive_mode (row, self->adaptive_mode);
- }
-
- switch (adaptive_mode) {
- case EPHY_ADAPTIVE_MODE_NORMAL:
- gtk_widget_set_vexpand (GTK_WIDGET (self), FALSE);
- /* This should be enough height in normal mode to fit in 900px hight screen. */
- gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (self), 700);
- gtk_list_box_set_header_func (self->list_box, NULL, NULL, NULL);
-
- break;
- case EPHY_ADAPTIVE_MODE_NARROW:
- gtk_widget_set_vexpand (GTK_WIDGET (self), TRUE);
- gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (self), 0);
- gtk_list_box_set_header_func (self->list_box, hdy_list_box_separator_header, NULL, NULL);
-
- break;
- }
-}
diff --git a/src/ephy-pages-view.h b/src/ephy-pages-view.h
index 6ccb720a0..fe8cd91ce 100644
--- a/src/ephy-pages-view.h
+++ b/src/ephy-pages-view.h
@@ -37,7 +37,4 @@ EphyNotebook *ephy_pages_view_get_notebook (EphyPagesView *view);
void ephy_pages_view_set_notebook (EphyPagesView *view,
EphyNotebook *notebook);
-void ephy_pages_view_set_adaptive_mode (EphyPagesView *self,
- EphyAdaptiveMode adaptive_mode);
-
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]