Use gtk_widget_set_[hv]align instead of gtk_misc_set_alignment

parent ae1cf06f
......@@ -502,13 +502,13 @@ build_single_doc_dialog (GeditCloseConfirmationDialog *dlg)
/* Image */
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_DIALOG);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
gtk_widget_set_halign (image, GTK_ALIGN_START);
/* Primary label */
primary_label = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5);
gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
gtk_widget_set_can_focus (primary_label, FALSE);
......@@ -541,7 +541,7 @@ build_single_doc_dialog (GeditCloseConfirmationDialog *dlg)
secondary_label = gtk_label_new (str);
g_free (str);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0.0, 0.5);
gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_widget_set_can_focus (secondary_label, FALSE);
......@@ -687,7 +687,7 @@ build_multiple_docs_dialog (GeditCloseConfirmationDialog *dlg)
/* Image */
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_DIALOG);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
gtk_widget_set_halign (image, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
......@@ -697,7 +697,7 @@ build_multiple_docs_dialog (GeditCloseConfirmationDialog *dlg)
primary_label = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5);
gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
if (priv->disable_save_to_disk)
......@@ -736,7 +736,7 @@ build_multiple_docs_dialog (GeditCloseConfirmationDialog *dlg)
gtk_box_pack_start (GTK_BOX (vbox2), select_label, FALSE, FALSE, 0);
gtk_label_set_line_wrap (GTK_LABEL (select_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (select_label), 0.0, 0.5);
gtk_widget_set_halign (select_label, GTK_ALIGN_START);
scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow, TRUE, TRUE, 0);
......@@ -762,7 +762,7 @@ build_multiple_docs_dialog (GeditCloseConfirmationDialog *dlg)
gtk_box_pack_start (GTK_BOX (vbox2), secondary_label, FALSE, FALSE, 0);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_mnemonic_widget (GTK_LABEL (select_label), treeview);
......
......@@ -97,7 +97,7 @@ create_option_menu (GeditFileChooserDialog *dialog)
GtkWidget *menu;
label = gtk_label_new_with_mnemonic (_("C_haracter Encoding:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_widget_set_halign (label, GTK_ALIGN_START);
menu = gedit_encodings_combo_box_new (
gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE);
......@@ -156,7 +156,7 @@ create_newline_combo (GeditFileChooserDialog *dialog)
GtkTreeIter iter;
label = gtk_label_new_with_mnemonic (_("L_ine Ending:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_widget_set_halign (label, GTK_ALIGN_START);
store = gtk_list_store_new (2, G_TYPE_STRING, GEDIT_TYPE_DOCUMENT_NEWLINE_TYPE);
combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
......
......@@ -125,7 +125,7 @@ set_info_bar_text_and_icon (GtkWidget *info_bar,
image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
gtk_widget_set_valign (image, GTK_ALIGN_START);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
......@@ -136,7 +136,7 @@ set_info_bar_text_and_icon (GtkWidget *info_bar,
gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_widget_set_can_focus (primary_label, TRUE);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
......@@ -151,7 +151,7 @@ set_info_bar_text_and_icon (GtkWidget *info_bar,
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
}
gtk_widget_show_all (hbox_content);
......@@ -522,8 +522,8 @@ create_conversion_error_info_bar (const gchar *primary_text,
image = gtk_image_new_from_stock ("gtk-dialog-error", GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
gtk_widget_set_valign (image, GTK_ALIGN_START);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
......@@ -533,7 +533,7 @@ create_conversion_error_info_bar (const gchar *primary_text,
gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_widget_set_can_focus (primary_label, TRUE);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
......@@ -548,7 +548,7 @@ create_conversion_error_info_bar (const gchar *primary_text,
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
}
create_combo_box (info_bar, vbox);
......@@ -793,7 +793,7 @@ gedit_file_already_open_warning_info_bar_new (GFile *location)
image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
gtk_widget_set_halign (image, GTK_ALIGN_START);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
......@@ -808,7 +808,7 @@ gedit_file_already_open_warning_info_bar_new (GFile *location)
gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_widget_set_can_focus (primary_label, TRUE);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
......@@ -823,7 +823,7 @@ gedit_file_already_open_warning_info_bar_new (GFile *location)
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
gtk_widget_show_all (hbox_content);
set_contents (info_bar, hbox_content);
......@@ -883,7 +883,7 @@ gedit_externally_modified_saving_error_info_bar_new (GFile *location,
image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
gtk_widget_set_valign (image, GTK_ALIGN_START);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
......@@ -903,7 +903,7 @@ gedit_externally_modified_saving_error_info_bar_new (GFile *location,
gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_widget_set_can_focus (primary_label, TRUE);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
......@@ -917,7 +917,7 @@ gedit_externally_modified_saving_error_info_bar_new (GFile *location,
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
gtk_widget_show_all (hbox_content);
set_contents (info_bar, hbox_content);
......@@ -981,7 +981,7 @@ gedit_no_backup_saving_error_info_bar_new (GFile *location,
image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
gtk_widget_set_valign (image, GTK_ALIGN_START);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
......@@ -1013,7 +1013,7 @@ gedit_no_backup_saving_error_info_bar_new (GFile *location,
gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_widget_set_can_focus (primary_label, TRUE);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
......@@ -1029,7 +1029,7 @@ gedit_no_backup_saving_error_info_bar_new (GFile *location,
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
gtk_widget_show_all (hbox_content);
set_contents (info_bar, hbox_content);
......@@ -1270,7 +1270,7 @@ gedit_invalid_character_info_bar_new (GFile *location)
image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
gtk_widget_set_valign (image, GTK_ALIGN_START);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
......@@ -1287,7 +1287,7 @@ gedit_invalid_character_info_bar_new (GFile *location)
gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_widget_set_can_focus (primary_label, TRUE);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
......@@ -1302,7 +1302,7 @@ gedit_invalid_character_info_bar_new (GFile *location)
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
gtk_widget_show_all (hbox_content);
set_contents (info_bar, hbox_content);
......
......@@ -584,7 +584,7 @@ build_vertical_panel (GeditPanel *panel)
0);
panel->priv->title_label = gtk_label_new (_("Empty"));
gtk_misc_set_alignment (GTK_MISC (panel->priv->title_label), 0, 0.5);
gtk_widget_set_halign (panel->priv->title_label, GTK_ALIGN_START);
gtk_label_set_ellipsize(GTK_LABEL (panel->priv->title_label), PANGO_ELLIPSIZE_END);
gtk_box_pack_start (GTK_BOX (icon_name_hbox),
......@@ -679,7 +679,7 @@ build_tab_label (GeditPanel *panel,
/* setup label */
label = gtk_label_new (name);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_misc_set_padding (GTK_MISC (label), 0, 0);
gtk_box_pack_start (GTK_BOX (label_hbox), label, TRUE, TRUE, 0);
......@@ -787,7 +787,7 @@ gedit_panel_add_item (GeditPanel *panel,
tab_label = build_tab_label (panel, item, data->display_name, data->icon);
menu_label = gtk_label_new (display_name);
gtk_misc_set_alignment (GTK_MISC (menu_label), 0.0, 0.5);
gtk_widget_set_halign (menu_label, GTK_ALIGN_START);
if (!gtk_widget_get_visible (item))
gtk_widget_show (item);
......
......@@ -130,14 +130,13 @@ gedit_progress_info_bar_init (GeditProgressInfoBar *bar)
bar->priv->image = gtk_image_new_from_icon_name (GTK_STOCK_MISSING_IMAGE,
GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_widget_show (bar->priv->image);
gtk_misc_set_alignment (GTK_MISC (bar->priv->image), 0.5, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), bar->priv->image, FALSE, FALSE, 4);
bar->priv->label = gtk_label_new ("");
gtk_widget_show (bar->priv->label);
gtk_box_pack_start (GTK_BOX (hbox), bar->priv->label, FALSE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (bar->priv->label), TRUE);
gtk_misc_set_alignment (GTK_MISC (bar->priv->label), 0, 0.5);
gtk_widget_set_halign (bar->priv->label, GTK_ALIGN_START);
gtk_label_set_ellipsize (GTK_LABEL (bar->priv->label),
PANGO_ELLIPSIZE_END);
......
......@@ -351,7 +351,7 @@ gedit_status_combo_box_init (GeditStatusComboBox *self)
gtk_widget_show (self->priv->label);
gtk_label_set_single_line_mode (GTK_LABEL (self->priv->label), TRUE);
gtk_misc_set_alignment (GTK_MISC (self->priv->label), 0.0, 0.5);
gtk_widget_set_halign (self->priv->label, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (self->priv->hbox), self->priv->label, FALSE, TRUE, 0);
......@@ -359,13 +359,12 @@ gedit_status_combo_box_init (GeditStatusComboBox *self)
gtk_widget_show (self->priv->item);
gtk_label_set_single_line_mode (GTK_LABEL (self->priv->item), TRUE);
gtk_misc_set_alignment (GTK_MISC (self->priv->item), 0, 0.5);
gtk_widget_set_halign (self->priv->item, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (self->priv->hbox), self->priv->item, TRUE, TRUE, 0);
self->priv->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
gtk_widget_show (self->priv->arrow);
gtk_misc_set_alignment (GTK_MISC (self->priv->arrow), 0.5, 0.5);
gtk_box_pack_start (GTK_BOX (self->priv->hbox), self->priv->arrow, FALSE, TRUE, 0);
......
......@@ -299,7 +299,7 @@ gedit_tab_label_init (GeditTabLabel *tab_label)
tab_label->priv->icon = icon;
label = gtk_label_new ("");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_misc_set_padding (GTK_MISC (label), 0, 0);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
tab_label->priv->label = label;
......
......@@ -207,7 +207,7 @@ set_message_area_text_and_icon (GtkWidget *message_area,
image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG);
gtk_widget_show (image);
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
gtk_widget_set_valign (image, GTK_ALIGN_START);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_widget_show (vbox);
......@@ -220,7 +220,7 @@ set_message_area_text_and_icon (GtkWidget *message_area,
gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_widget_set_can_focus (primary_label, TRUE);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
......@@ -236,7 +236,7 @@ set_message_area_text_and_icon (GtkWidget *message_area,
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
}
set_contents (message_area, hbox_content);
......
......@@ -105,7 +105,7 @@ class Popup(Gtk.Dialog):
vbox.pack_start(sw, True, True, 0)
lbl = Gtk.Label()
lbl.set_alignment(0, 0.5)
lbl.set_halign(Gtk.Align.START)
lbl.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
self._info_label = lbl
......
......@@ -454,7 +454,7 @@ build_suggestion_menu (GeditAutomaticSpellChecker *spell, const gchar *word)
label = gtk_label_new (label_text);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_widget_set_halign (label, GTK_ALIGN_START);
mi = gtk_menu_item_new ();
gtk_container_add (GTK_CONTAINER(mi), label);
......
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