[epiphany] Revert "Make margins around the title widget adaptive"
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Revert "Make margins around the title widget adaptive"
- Date: Tue, 11 Dec 2018 03:24:33 +0000 (UTC)
commit ebe3986f48e12fd93da45b249c8ae07b182ca90e
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Mon Dec 10 21:08:11 2018 -0600
Revert "Make margins around the title widget adaptive"
This reverts commit 4c2af237fc666cb7bcbb6c656507719ed36d8f8d.
lib/widgets/ephy-location-entry.c | 13 +++++++++++++
lib/widgets/ephy-title-box.c | 13 +++++++++++++
src/ephy-header-bar.c | 13 +++----------
3 files changed, 29 insertions(+), 10 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 1b1672a33..5e16653b6 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -319,6 +319,18 @@ ephy_location_entry_finalize (GObject *object)
G_OBJECT_CLASS (ephy_location_entry_parent_class)->finalize (object);
}
+static void
+ephy_location_entry_get_preferred_width (GtkWidget *widget,
+ gint *minimum_width,
+ gint *natural_width)
+{
+ if (minimum_width)
+ *minimum_width = -1;
+
+ if (natural_width)
+ *natural_width = 848;
+}
+
static void
ephy_location_entry_get_preferred_height (GtkWidget *widget,
gint *minimum_height,
@@ -413,6 +425,7 @@ ephy_location_entry_class_init (EphyLocationEntryClass *klass)
object_class->finalize = ephy_location_entry_finalize;
object_class->dispose = ephy_location_entry_dispose;
+ widget_class->get_preferred_width = ephy_location_entry_get_preferred_width;
widget_class->get_preferred_height = ephy_location_entry_get_preferred_height;
g_object_class_override_property (object_class, PROP_ADDRESS, "address");
diff --git a/lib/widgets/ephy-title-box.c b/lib/widgets/ephy-title-box.c
index 3ceca1f44..a47159088 100644
--- a/lib/widgets/ephy-title-box.c
+++ b/lib/widgets/ephy-title-box.c
@@ -117,6 +117,18 @@ ephy_title_box_constructed (GObject *object)
gtk_widget_show_all (GTK_WIDGET (title_box));
}
+static void
+ephy_title_box_get_preferred_width (GtkWidget *widget,
+ gint *minimum_width,
+ gint *natural_width)
+{
+ if (minimum_width)
+ *minimum_width = -1;
+
+ if (natural_width)
+ *natural_width = 860;
+}
+
static const char *
ephy_title_box_title_widget_get_address (EphyTitleWidget *widget)
{
@@ -228,6 +240,7 @@ ephy_title_box_class_init (EphyTitleBoxClass *klass)
object_class->get_property = ephy_title_box_get_property;
object_class->set_property = ephy_title_box_set_property;
widget_class->button_press_event = ephy_title_box_button_press_event;
+ widget_class->get_preferred_width = ephy_title_box_get_preferred_width;
g_object_class_override_property (object_class, PROP_ADDRESS, "address");
g_object_class_override_property (object_class, PROP_SECURITY_LEVEL, "security-level");
diff --git a/src/ephy-header-bar.c b/src/ephy-header-bar.c
index 109a2f3e7..d216655a6 100644
--- a/src/ephy-header-bar.c
+++ b/src/ephy-header-bar.c
@@ -33,8 +33,6 @@
#include "ephy-type-builtins.h"
#include <glib/gi18n.h>
-#define HANDY_USE_UNSTABLE_API
-#include <handy.h>
enum {
PROP_0,
@@ -146,7 +144,6 @@ ephy_header_bar_constructed (GObject *object)
GtkWidget *page_menu_popover;
GtkBuilder *builder;
EphyEmbedShell *embed_shell;
- HdyColumn *column;
G_OBJECT_CLASS (ephy_header_bar_parent_class)->constructed (object);
@@ -164,6 +161,7 @@ ephy_header_bar_constructed (GObject *object)
G_CALLBACK (update_revealer_visibility), NULL);
gtk_revealer_set_transition_type (GTK_REVEALER (header_bar->start_revealer),
GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT);
gtk_container_add (GTK_CONTAINER (header_bar->start_revealer), GTK_WIDGET (header_bar->action_bar_start));
+ gtk_widget_set_margin_end (GTK_WIDGET (header_bar->action_bar_start), 54);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar),
GTK_WIDGET (header_bar->start_revealer));
@@ -175,13 +173,7 @@ ephy_header_bar_constructed (GObject *object)
header_bar->title_widget = EPHY_TITLE_WIDGET (ephy_title_box_new ());
else
header_bar->title_widget = EPHY_TITLE_WIDGET (ephy_location_entry_new ());
- column = hdy_column_new ();
- gtk_widget_set_hexpand (GTK_WIDGET (column), TRUE);
- gtk_widget_show (GTK_WIDGET (column));
- hdy_column_set_maximum_width (column, 860);
- hdy_column_set_linear_growth_width (column, 560);
- gtk_container_add (GTK_CONTAINER (column), GTK_WIDGET (header_bar->title_widget));
- gtk_header_bar_set_custom_title (GTK_HEADER_BAR (header_bar), GTK_WIDGET (column));
+ gtk_header_bar_set_custom_title (GTK_HEADER_BAR (header_bar), GTK_WIDGET (header_bar->title_widget));
gtk_widget_show (GTK_WIDGET (header_bar->title_widget));
if (EPHY_IS_LOCATION_ENTRY (header_bar->title_widget)) {
@@ -238,6 +230,7 @@ ephy_header_bar_constructed (GObject *object)
G_CALLBACK (update_revealer_visibility), NULL);
gtk_revealer_set_transition_type (GTK_REVEALER (header_bar->end_revealer),
GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT);
gtk_container_add (GTK_CONTAINER (header_bar->end_revealer), GTK_WIDGET (header_bar->action_bar_end));
+ gtk_widget_set_margin_start (GTK_WIDGET (header_bar->action_bar_end), 54);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar),
GTK_WIDGET (header_bar->end_revealer));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]