diff options
author | monsta <[email protected]> | 2018-01-28 19:57:20 +0300 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-01-29 21:14:28 +0100 |
commit | 2611e01e644e4a44aec8189bfbcd437bbb27051e (patch) | |
tree | 9350a0f0c1389dcff697567850539a01e7191756 /src | |
parent | 2b454bbabcb0dd7c37fe2856c1020ba18e38e038 (diff) | |
download | mate-terminal-2611e01e644e4a44aec8189bfbcd437bbb27051e.tar.bz2 mate-terminal-2611e01e644e4a44aec8189bfbcd437bbb27051e.tar.xz |
require GTK+ 3.22 and GLib 2.50
and drop additional checks for min/max GLib versions, it's not needed
Diffstat (limited to 'src')
-rw-r--r-- | src/terminal-info-bar.c | 4 | ||||
-rw-r--r-- | src/terminal-tab-label.c | 5 | ||||
-rw-r--r-- | src/terminal-util.c | 24 | ||||
-rw-r--r-- | src/terminal-window.c | 22 |
4 files changed, 2 insertions, 53 deletions
diff --git a/src/terminal-info-bar.c b/src/terminal-info-bar.c index 40a6e72..9a40c17 100644 --- a/src/terminal-info-bar.c +++ b/src/terminal-info-bar.c @@ -113,12 +113,8 @@ terminal_info_bar_format_text (TerminalInfoBar *bar, gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_selectable (GTK_LABEL (label), TRUE); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.0); gtk_label_set_yalign (GTK_LABEL (label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); -#endif gtk_box_pack_start (GTK_BOX (priv->content_box), label, FALSE, FALSE, 0); gtk_widget_show_all (priv->content_box); diff --git a/src/terminal-tab-label.c b/src/terminal-tab-label.c index 1aac1e1..05355a7 100644 --- a/src/terminal-tab-label.c +++ b/src/terminal-tab-label.c @@ -121,13 +121,8 @@ terminal_tab_label_constructor (GType type, priv->label = label = gtk_label_new (NULL); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.0); gtk_label_set_yalign (GTK_LABEL (label), 0.5); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_misc_set_padding (GTK_MISC (label), 0, 0); -#endif gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END); gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE); diff --git a/src/terminal-util.c b/src/terminal-util.c index 71bcf5f..3c7cb3b 100644 --- a/src/terminal-util.c +++ b/src/terminal-util.c @@ -123,26 +123,6 @@ terminal_util_show_error_dialog (GtkWindow *transient_parent, g_free (message); } -static gboolean -open_url (GtkWindow *parent, - const char *uri, - guint32 user_time, - GError **error) -{ -#if GTK_CHECK_VERSION (3, 22, 0) - return gtk_show_uri_on_window (parent, uri, user_time, error); -#else - GdkScreen *screen; - - if (parent) - screen = gtk_widget_get_screen (GTK_WIDGET (parent)); - else - screen = gdk_screen_get_default (); - - return gtk_show_uri (screen, uri, user_time, error); -#endif -} - void terminal_util_show_help (const char *topic, GtkWindow *parent) @@ -159,7 +139,7 @@ terminal_util_show_help (const char *topic, url = g_strdup ("help:mate-terminal"); } - if (!open_url (GTK_WINDOW (parent), url, gtk_get_current_event_time (), &error)) + if (!gtk_show_uri_on_window (GTK_WINDOW (parent), url, gtk_get_current_event_time (), &error)) { terminal_util_show_error_dialog (GTK_WINDOW (parent), NULL, error, _("There was an error displaying help")); @@ -231,7 +211,7 @@ terminal_util_open_url (GtkWidget *parent, g_assert_not_reached (); } - if (!open_url (GTK_WINDOW (parent), uri, user_time, &error)) + if (!gtk_show_uri_on_window (GTK_WINDOW (parent), uri, user_time, &error)) { terminal_util_show_error_dialog (GTK_WINDOW (parent), NULL, error, _("Could not open the address ā%sā"), diff --git a/src/terminal-window.c b/src/terminal-window.c index 734fab3..3f0a234 100644 --- a/src/terminal-window.c +++ b/src/terminal-window.c @@ -577,13 +577,8 @@ position_menu_under_widget (GtkMenu *menu, GtkRequisition req; GtkRequisition menu_req; GdkRectangle monitor; -#if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor_num; GdkDisplay *display; -#else - int monitor_num; - GdkScreen *screen; -#endif GtkAllocation widget_allocation; widget_window = gtk_widget_get_window (widget); @@ -593,19 +588,11 @@ position_menu_under_widget (GtkMenu *menu, gtk_widget_get_preferred_size (widget, &req, NULL); gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_req, NULL); -#if GTK_CHECK_VERSION (3, 22, 0) display = gtk_widget_get_display (GTK_WIDGET (menu)); monitor_num = gdk_display_get_monitor_at_window (display, widget_window); if (monitor_num == NULL) monitor_num = gdk_display_get_monitor (display, 0); gdk_monitor_get_geometry (monitor_num, &monitor); -#else - screen = gtk_widget_get_screen (GTK_WIDGET (menu)); - monitor_num = gdk_screen_get_monitor_at_window (screen, widget_window); - if (monitor_num < 0) - monitor_num = 0; - gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); -#endif gdk_window_get_origin (widget_window, x, y); if (!gtk_widget_get_has_window (widget)) @@ -2656,7 +2643,6 @@ terminal_window_remove_screen (TerminalWindow *window, update_tab_visibility (window, -1); screen_container = terminal_screen_container_get_from_screen (screen); -#if GTK_CHECK_VERSION(3, 16, 0) if (detach_tab) { gtk_notebook_detach_tab (GTK_NOTEBOOK (priv->notebook), @@ -2666,10 +2652,6 @@ terminal_window_remove_screen (TerminalWindow *window, else gtk_container_remove (GTK_CONTAINER (priv->notebook), GTK_WIDGET (screen_container)); -#else - gtk_container_remove (GTK_CONTAINER (priv->notebook), - GTK_WIDGET (screen_container)); -#endif } void @@ -4242,12 +4224,8 @@ terminal_set_title_callback (GtkAction *action, gtk_box_pack_start (GTK_BOX (message_area), hbox, FALSE, FALSE, 0); label = gtk_label_new_with_mnemonic (_("_Title:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.0); gtk_label_set_yalign (GTK_LABEL (label), 0.5); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); entry = gtk_entry_new (); |