Commit 9f74f119 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko Committed by Marge Bot
Browse files

Clean up [hv]align and [hv]expand use

A lot of places where we used these properties wasn't necessary. In some
cases it worked but would mess up labels in GTK4.

Part-of: <!1038>
parent f763e800
......@@ -135,13 +135,13 @@ ephy_notification_init (EphyNotification *self)
self->head = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (self->head), TRUE);
gtk_widget_set_halign (self->head, GTK_ALIGN_CENTER);
gtk_label_set_xalign (GTK_LABEL (self->head), 0);
gtk_widget_set_hexpand (self->head, TRUE);
gtk_grid_attach (GTK_GRID (self->grid), self->head, 0, 0, 1, 1);
self->body = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (self->body), TRUE);
gtk_widget_set_halign (self->body, GTK_ALIGN_CENTER);
gtk_label_set_xalign (GTK_LABEL (self->body), 0);
gtk_widget_set_hexpand (self->body, TRUE);
gtk_grid_attach (GTK_GRID (self->grid), self->body, 0, 1, 1, 1);
......
......@@ -291,8 +291,6 @@ ephy_certificate_dialog_init (EphyCertificateDialog *dialog)
gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
dialog->icon = gtk_image_new ();
gtk_widget_set_halign (dialog->icon, GTK_ALIGN_CENTER);
gtk_widget_set_valign (dialog->icon, GTK_ALIGN_START);
gtk_grid_attach (GTK_GRID (grid), dialog->icon,
0, 0, 1, 2);
gtk_widget_show (dialog->icon);
......@@ -301,8 +299,6 @@ ephy_certificate_dialog_init (EphyCertificateDialog *dialog)
gtk_label_set_use_markup (GTK_LABEL (dialog->title), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (dialog->title), TRUE);
gtk_label_set_selectable (GTK_LABEL (dialog->title), TRUE);
gtk_widget_set_halign (dialog->title, GTK_ALIGN_START);
gtk_widget_set_valign (dialog->title, GTK_ALIGN_CENTER);
gtk_label_set_xalign (GTK_LABEL (dialog->title), 0.0);
gtk_grid_attach_next_to (GTK_GRID (grid), dialog->title,
dialog->icon, GTK_POS_RIGHT,
......@@ -312,8 +308,6 @@ ephy_certificate_dialog_init (EphyCertificateDialog *dialog)
dialog->text = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (dialog->text), TRUE);
gtk_label_set_selectable (GTK_LABEL (dialog->text), TRUE);
gtk_widget_set_halign (dialog->text, GTK_ALIGN_START);
gtk_widget_set_valign (dialog->text, GTK_ALIGN_START);
gtk_label_set_xalign (GTK_LABEL (dialog->text), 0.0);
gtk_label_set_yalign (GTK_LABEL (dialog->text), 0.0);
gtk_grid_attach_next_to (GTK_GRID (grid), dialog->text,
......
......@@ -387,14 +387,12 @@ ephy_download_widget_constructed (GObject *object)
widget->icon = gtk_image_new ();
gtk_widget_set_margin_end (widget->icon, 4);
gtk_widget_set_halign (widget->icon, GTK_ALIGN_START);
update_download_icon (widget);
gtk_grid_attach (GTK_GRID (grid), widget->icon, 0, 0, 1, 1);
gtk_widget_show (widget->icon);
widget->filename = gtk_label_new (NULL);
gtk_widget_set_hexpand (widget->filename, true);
gtk_widget_set_valign (widget->filename, GTK_ALIGN_CENTER);
gtk_label_set_xalign (GTK_LABEL (widget->filename), 0);
gtk_label_set_max_width_chars (GTK_LABEL (widget->filename), 30);
gtk_label_set_ellipsize (GTK_LABEL (widget->filename), PANGO_ELLIPSIZE_END);
......@@ -403,7 +401,6 @@ ephy_download_widget_constructed (GObject *object)
gtk_widget_show (widget->filename);
widget->progress = gtk_progress_bar_new ();
gtk_widget_set_valign (widget->progress, GTK_ALIGN_CENTER);
gtk_widget_set_margin_top (widget->progress, 6);
gtk_widget_set_margin_bottom (widget->progress, 6);
gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (widget->progress), 0.05);
......@@ -412,7 +409,6 @@ ephy_download_widget_constructed (GObject *object)
gtk_widget_show (widget->progress);
widget->status = gtk_label_new (NULL);
gtk_widget_set_valign (widget->status, GTK_ALIGN_CENTER);
gtk_label_set_xalign (GTK_LABEL (widget->status), 0);
g_object_set (widget->status, "width-request", 260, NULL);
gtk_label_set_max_width_chars (GTK_LABEL (widget->status), 30);
......
......@@ -84,8 +84,6 @@ static void
ephy_downloads_progress_icon_init (EphyDownloadsProgressIcon *icon)
{
g_object_set (icon, "width-request", 16, "height-request", 16, NULL);
gtk_widget_set_valign (GTK_WIDGET (icon), GTK_ALIGN_CENTER);
gtk_widget_set_halign (GTK_WIDGET (icon), GTK_ALIGN_CENTER);
}
GtkWidget *
......
......@@ -1120,7 +1120,6 @@ ephy_location_entry_construct_contents (EphyLocationEntry *entry)
entry->reader_mode_button = gtk_button_new_from_icon_name (NULL, GTK_ICON_SIZE_MENU);
gtk_widget_set_tooltip_text (entry->reader_mode_button, _("Toggle reader mode"));
entry->reader_mode_icon = gtk_button_get_image (GTK_BUTTON (entry->reader_mode_button));
gtk_widget_set_valign (entry->reader_mode_icon, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (box), entry->reader_mode_button, FALSE, TRUE, 0);
context = gtk_widget_get_style_context (entry->reader_mode_icon);
......@@ -1134,7 +1133,6 @@ ephy_location_entry_construct_contents (EphyLocationEntry *entry)
entry->bookmark_button = gtk_button_new_from_icon_name ("non-starred-symbolic", GTK_ICON_SIZE_MENU);
gtk_widget_set_tooltip_text (entry->bookmark_button, _("Bookmark this page"));
entry->bookmark_icon = gtk_button_get_image (GTK_BUTTON (entry->bookmark_button));
gtk_widget_set_valign (entry->bookmark_icon, GTK_ALIGN_CENTER);
g_signal_connect (G_OBJECT (entry->bookmark_button), "clicked", G_CALLBACK (bookmark_icon_button_clicked_cb), entry);
gtk_box_pack_start (GTK_BOX (box), entry->bookmark_button, FALSE, TRUE, 0);
......
......@@ -247,7 +247,6 @@ ephy_security_popover_constructed (GObject *object)
certificate_button = gtk_button_new_with_mnemonic (_("_View Certificate…"));
gtk_widget_set_halign (certificate_button, GTK_ALIGN_END);
gtk_widget_set_valign (certificate_button, GTK_ALIGN_END);
gtk_widget_set_margin_top (certificate_button, 5);
gtk_widget_set_receives_default (certificate_button, FALSE);
gtk_widget_show (certificate_button);
......@@ -539,7 +538,6 @@ ephy_security_popover_init (EphySecurityPopover *popover)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_halign (box, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand (box, TRUE);
popover->lock_image = gtk_image_new ();
gtk_box_pack_start (GTK_BOX (box), popover->lock_image, FALSE, TRUE, 0);
......
......@@ -82,6 +82,7 @@ ephy_title_box_constructed (GObject *object)
G_OBJECT_CLASS (ephy_title_box_parent_class)->constructed (object);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (title_box), vbox);
title_box->title = gtk_label_new (NULL);
......@@ -248,7 +249,5 @@ ephy_title_box_init (EphyTitleBox *title_box)
EphyTitleBox *
ephy_title_box_new (void)
{
return g_object_new (EPHY_TYPE_TITLE_BOX,
"valign", GTK_ALIGN_CENTER,
NULL);
return g_object_new (EPHY_TYPE_TITLE_BOX, NULL);
}
......@@ -235,7 +235,6 @@ create_tag_row (const char *tag)
g_object_set (G_OBJECT (row), "height-request", 40, NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_halign (box, GTK_ALIGN_START);
if (g_strcmp0 (tag, EPHY_BOOKMARKS_FAVORITES_TAG) == 0) {
image = gtk_image_new_from_icon_name ("emblem-favorite-symbolic", GTK_ICON_SIZE_MENU);
......
......@@ -278,7 +278,6 @@ ephy_header_bar_constructed (GObject *object)
/* Fullscreen restore button */
header_bar->restore_button = gtk_button_new_from_icon_name ("view-restore-symbolic",
GTK_ICON_SIZE_BUTTON);
gtk_widget_set_valign (header_bar->restore_button, GTK_ALIGN_CENTER);
g_signal_connect_object (header_bar->restore_button, "clicked",
G_CALLBACK (restore_button_clicked_cb),
header_bar, 0);
......@@ -290,7 +289,6 @@ ephy_header_bar_constructed (GObject *object)
header_bar->page_menu_button = button;
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name ("open-menu-symbolic", GTK_ICON_SIZE_BUTTON));
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
g_type_ensure (G_TYPE_THEMED_ICON);
builder = gtk_builder_new_from_resource ("/org/gnome/epiphany/gtk/page-menu-popover.ui");
header_bar->page_menu_popover = GTK_WIDGET (gtk_builder_get_object (builder, "page-menu-popover"));
......
......@@ -5,8 +5,6 @@
<child>
<object class="GtkButtonBox" id="browser_action_box">
<property name="visible">True</property>
<property name="valign">center</property>
<property name="halign">end</property>
<property name="homogeneous">False</property>
<property name="layout-style">expand</property>
</object>
......@@ -21,7 +19,6 @@
<property name="tooltip_text" translatable="yes">View downloads</property>
<property name="visible">True</property>
<property name="receives_default">True</property>
<property name="valign">center</property>
<child>
<object class="GtkOverlay">
<property name="visible">True</property>
......@@ -56,7 +53,6 @@
<child>
<object class="GtkButton" id="bookmark_button">
<property name="visible">True</property>
<property name="valign">center</property>
<!-- Translators: tooltip for the bookmark button -->
<property name="tooltip_text" translatable="yes">Bookmark page</property>
<child>
......@@ -74,7 +70,6 @@
<child>
<object class="GtkMenuButton" id="bookmarks_button">
<property name="visible">True</property>
<property name="valign">center</property>
<!-- Translators: tooltip for the bookmarks popover button -->
<property name="tooltip_text" translatable="yes">View and manage your bookmarks</property>
<property name="popover">bookmarks_popover</property>
......
......@@ -14,7 +14,6 @@
<object class="GtkButton" id="navigation_back">
<property name="visible">True</property>
<property name="action-name">toolbar.navigation-back</property>
<property name="valign">center</property>
<!-- Translators: tooltip for the back button -->
<property name="tooltip_text" translatable="yes">Go back to the previous page</property>
<style>
......@@ -33,7 +32,6 @@
<object class="GtkButton" id="navigation_forward">
<property name="visible">True</property>
<property name="action-name">toolbar.navigation-forward</property>
<property name="valign">center</property>
<!-- Translators: tooltip for the forward button -->
<property name="tooltip_text" translatable="yes">Go forward to the next page</property>
<style>
......@@ -54,7 +52,6 @@
<object class="GtkButton" id="combined_stop_reload_button">
<property name="visible">True</property>
<property name="action-name">toolbar.combined-stop-reload</property>
<property name="valign">center</property>
<style>
<class name="image-button"/>
</style>
......@@ -71,7 +68,6 @@
<object class="GtkButton" id="homepage_button">
<property name="visible">True</property>
<property name="action-name">win.home</property>
<property name="valign">center</property>
<!-- Translators: tooltip for the secret homepage button -->
<property name="tooltip_text" translatable="yes">Go to your homepage</property>
<style>
......@@ -90,7 +86,6 @@
<object class="GtkButton" id="new_tab_button">
<property name="visible">True</property>
<property name="action-name">win.new-tab</property>
<property name="valign">center</property>
<!-- Translators: tooltip for the new tab button -->
<property name="tooltip_text" translatable="yes">Open a new tab</property>
<style>
......
......@@ -19,7 +19,6 @@
<child>
<object class="EphyPagesButton" id="pages_button">
<property name="visible">True</property>
<property name="valign">center</property>
<!-- Translators: tooltip for the page switcher button -->
<property name="tooltip_text" translatable="yes">View open pages</property>
<property name="action_name">win.tabs-view</property>
......
......@@ -19,7 +19,7 @@
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="halign">start</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Name</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">name_entry</property>
......@@ -37,8 +37,7 @@
<child>
<object class="GtkLabel" id="address_label">
<property name="visible">True</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="xalign">0</property>
<property name="margin_top">6</property>
<property name="label" translatable="yes">_Address</property>
<property name="use-underline">True</property>
......@@ -56,8 +55,7 @@
<child>
<object class="GtkLabel" id="popover_tags_label">
<property name="visible">True</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="xalign">0</property>
<property name="margin_top">12</property>
<property name="label" translatable="yes">Tags</property>
<style>
......
......@@ -17,7 +17,6 @@
<child>
<object class="GtkLabel" id="title_label">
<property name="visible">True</property>
<property name="halign">fill</property>
<property name="hexpand">True</property>
<property name="ellipsize">end</property>
<property name="max_width_chars">1</property>
......
......@@ -21,7 +21,6 @@
<property name="visible">true</property>
<child>
<object class="GtkStackSwitcher">
<property name="hexpand">true</property>
<property name="halign">center</property>
<property name="stack">stack</property>
<property name="visible">true</property>
......
......@@ -54,7 +54,6 @@
<property name="visible">True</property>
<property name="label" translatable="yes">Clear selected personal data:</property>
<property name="use-underline">True</property>
<property name="halign">start</property>
<property name="xalign">0</property>
<property name="wrap">True</property>
<property name="justify">left</property>
......
......@@ -56,17 +56,13 @@
<child>
<object class="HdySearchBar" id="search_bar">
<property name="visible">True</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="search_mode_enabled">False</property>
<child>
<object class="HdyClamp">
<property name="visible">True</property>
<property name="hexpand">True</property>
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">False</property>
<property name="primary_icon_sensitive">False</property>
......
......@@ -29,7 +29,7 @@
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="halign">start</property>
<property name="xalign">0</property>
<property name="margin_left">6</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Use the encoding specified by the document</property>
......@@ -64,7 +64,7 @@
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="halign">start</property>
<property name="xalign">0</property>
<property name="margin_start">8</property>
<property name="label" translatable="yes">Recent encodings</property>
<attributes>
......@@ -96,7 +96,7 @@
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="halign">start</property>
<property name="xalign">0</property>
<property name="margin_start">8</property>
<property name="label" translatable="yes">Related encodings</property>
<attributes>
......
......@@ -35,7 +35,7 @@
<child>
<object class="GtkLabel" id="sync_firefox_iframe_label">
<property name="visible">False</property>
<property name="halign">start</property>
<property name="xalign">0</property>
</object>
</child>
</object>
......
......@@ -126,19 +126,15 @@
<child>
<object class="HdySearchBar" id="search_bar">
<property name="visible">True</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="search_mode_enabled">False</property>
<child>
<object class="HdyClamp">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="maximum_size">400</property>
<property name="tightening_threshold">300</property>
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="placeholder-text" translatable="yes">Search history</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">False</property>
......
Supports Markdown
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