diff options
author | monsta <[email protected]> | 2016-11-21 21:14:26 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-11-21 21:14:26 +0300 |
commit | d0ddaedffa7d417a699cafce73c1e418515c4a28 (patch) | |
tree | 645b7a86e32b21113e1ce14f563bfb8d8900fa53 /mate-panel/panel-ditem-editor.c | |
parent | 7dfeb78328039cf92a9f45d64c9b3662d967a1fe (diff) | |
download | mate-panel-d0ddaedffa7d417a699cafce73c1e418515c4a28.tar.bz2 mate-panel-d0ddaedffa7d417a699cafce73c1e418515c4a28.tar.xz |
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require libmate-desktop >= 1.17
WARNING: use GTK+3 build of libmateweather for this build.
that lib is not migrated to GTK+3 only as we will possibly
use libgweather instead of it.
Diffstat (limited to 'mate-panel/panel-ditem-editor.c')
-rw-r--r-- | mate-panel/panel-ditem-editor.c | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/mate-panel/panel-ditem-editor.c b/mate-panel/panel-ditem-editor.c index 3d83aa57..737925fd 100644 --- a/mate-panel/panel-ditem-editor.c +++ b/mate-panel/panel-ditem-editor.c @@ -62,11 +62,7 @@ struct _PanelDItemEditorPrivate PanelDitemSaveUri save_uri; gpointer save_uri_data; -#if GTK_CHECK_VERSION (3, 0, 0) GtkWidget *grid; -#else - GtkWidget *table; -#endif GtkWidget *type_label; GtkWidget *type_combo; GtkWidget *name_label; @@ -520,7 +516,6 @@ label_new_with_mnemonic (const char *text) } static inline void -#if GTK_CHECK_VERSION (3, 0, 0) grid_attach_label (GtkGrid *grid, GtkWidget *label, int left, int top, int width, int height) { gtk_grid_attach (grid, label, left, top, width, height); @@ -532,32 +527,6 @@ grid_attach_entry (GtkGrid *grid, GtkWidget *entry, int left, int top, int width gtk_widget_set_hexpand (entry, TRUE); gtk_grid_attach (grid, entry, left, top, width, height); } -#else -table_attach_label (GtkTable *table, - GtkWidget *label, - int left, - int right, - int top, - int bottom) -{ - gtk_table_attach (table, label, left, right, top, bottom, - GTK_FILL, GTK_FILL, - 0, 0); -} - -static inline void -table_attach_entry (GtkTable *table, - GtkWidget *entry, - int left, - int right, - int top, - int bottom) -{ - gtk_table_attach (table, entry, left, right, top, bottom, - GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_FILL, - 0, 0); -} -#endif static void setup_combo (GtkWidget *combo_box, @@ -630,22 +599,12 @@ panel_ditem_editor_make_ui (PanelDItemEditor *dialog) dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); gtk_box_set_spacing (GTK_BOX (dialog_vbox), 2); -#if GTK_CHECK_VERSION (3, 0, 0) priv->grid = gtk_grid_new (); gtk_container_set_border_width (GTK_CONTAINER (priv->grid), 5); gtk_grid_set_row_spacing (GTK_GRID (priv->grid), 6); gtk_grid_set_column_spacing (GTK_GRID (priv->grid), 12); gtk_box_pack_start (GTK_BOX (dialog_vbox), priv->grid, TRUE, TRUE, 0); gtk_widget_show (priv->grid); -#else - priv->table = gtk_table_new (4, 3, FALSE); - gtk_container_set_border_width (GTK_CONTAINER (priv->table), 5); - gtk_table_set_row_spacings (GTK_TABLE (priv->table), 6); - gtk_table_set_col_spacings (GTK_TABLE (priv->table), 12); - gtk_box_pack_start (GTK_BOX (dialog_vbox), - priv->table, TRUE, TRUE, 0); - gtk_widget_show (priv->table); -#endif /* Type */ priv->type_label = label_new_with_mnemonic (_("_Type:")); @@ -665,23 +624,13 @@ panel_ditem_editor_make_ui (PanelDItemEditor *dialog) priv->icon_chooser = panel_icon_chooser_new (NULL); panel_icon_chooser_set_fallback_icon_name (PANEL_ICON_CHOOSER (priv->icon_chooser), PANEL_ICON_LAUNCHER); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_grid_attach (GTK_GRID (priv->grid), priv->icon_chooser, 0, 0, 1, 2); -#else - gtk_table_attach (GTK_TABLE (priv->table), priv->icon_chooser, - 0, 1, 0, 2, - 0, 0, 0, 0); -#endif gtk_widget_show (priv->icon_chooser); /* Command */ priv->command_label = label_new_with_mnemonic (""); -#if GTK_CHECK_VERSION (3, 0, 0) priv->command_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); -#else - priv->command_hbox = gtk_hbox_new (FALSE, 12); -#endif gtk_widget_show (priv->command_hbox); priv->command_entry = gtk_entry_new (); @@ -772,7 +721,6 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog) GtkTreeModel *model; PanelDItemEditorType buf_type; -#if GTK_CHECK_VERSION (3, 0, 0) grid_attach_label (GTK_GRID (priv->grid), priv->type_label, 1, 0, 1, 1); grid_attach_entry (GTK_GRID (priv->grid), priv->type_combo, 2, 0, 1, 1); @@ -784,27 +732,6 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog) grid_attach_label (GTK_GRID (priv->grid), priv->comment_label, 1, 3, 1, 1); grid_attach_entry (GTK_GRID (priv->grid), priv->comment_entry, 2, 3, 1, 1); -#else - table_attach_label (GTK_TABLE (priv->table), priv->type_label, - 1, 2, 0, 1); - table_attach_entry (GTK_TABLE (priv->table), priv->type_combo, - 2, 3, 0, 1); - - table_attach_label (GTK_TABLE (priv->table), priv->name_label, - 1, 2, 1, 2); - table_attach_entry (GTK_TABLE (priv->table), priv->name_entry, - 2, 3, 1, 2); - - table_attach_label (GTK_TABLE (priv->table), priv->command_label, - 1, 2, 2, 3); - table_attach_entry (GTK_TABLE (priv->table), priv->command_hbox, - 2, 3, 2, 3); - - table_attach_label (GTK_TABLE (priv->table), priv->comment_label, - 1, 2, 3, 4); - table_attach_entry (GTK_TABLE (priv->table), priv->comment_entry, - 2, 3, 3, 4); -#endif /* FIXME: hack hack hack */ model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->type_combo)); @@ -820,7 +747,6 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog) } } while (gtk_tree_model_iter_next (model, &iter)); } else if (type == PANEL_DITEM_EDITOR_TYPE_DIRECTORY) { -#if GTK_CHECK_VERSION (3, 0, 0) grid_attach_label (GTK_GRID (priv->grid), priv->name_label, 1, 0, 1, 1); grid_attach_entry (GTK_GRID (priv->grid), priv->name_entry, 2, 0, 1, 1); @@ -835,32 +761,6 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog) grid_attach_label (GTK_GRID (priv->grid), priv->comment_label, 1, 2, 1, 1); grid_attach_entry (GTK_GRID (priv->grid), priv->comment_entry, 2, 2, 1, 1); -#else - table_attach_label (GTK_TABLE (priv->table), priv->name_label, - 1, 2, 0, 1); - table_attach_entry (GTK_TABLE (priv->table), priv->name_entry, - 2, 3, 0, 1); - - table_attach_label (GTK_TABLE (priv->table), priv->comment_label, - 1, 2, 1, 2); - table_attach_entry (GTK_TABLE (priv->table), priv->comment_entry, - 2, 3, 1, 2); - } else { - table_attach_label (GTK_TABLE (priv->table), priv->name_label, - 1, 2, 0, 1); - table_attach_entry (GTK_TABLE (priv->table), priv->name_entry, - 2, 3, 0, 1); - - table_attach_label (GTK_TABLE (priv->table), priv->command_label, - 1, 2, 1, 2); - table_attach_entry (GTK_TABLE (priv->table), priv->command_hbox, - 2, 3, 1, 2); - - table_attach_label (GTK_TABLE (priv->table), priv->comment_label, - 1, 2, 2, 3); - table_attach_entry (GTK_TABLE (priv->table), priv->comment_entry, - 2, 3, 2, 3); -#endif } type_combo_changed (dialog); @@ -874,12 +774,7 @@ panel_ditem_editor_setup_ui (PanelDItemEditor *dialog) focus_chain = g_list_prepend (focus_chain, priv->command_hbox); focus_chain = g_list_prepend (focus_chain, priv->comment_entry); focus_chain = g_list_reverse (focus_chain); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_container_set_focus_chain (GTK_CONTAINER (priv->grid), focus_chain); -#else - gtk_container_set_focus_chain (GTK_CONTAINER (priv->table), - focus_chain); -#endif g_list_free (focus_chain); gtk_widget_grab_focus (priv->name_entry); |