Commit db0c09d742cebc90b9eaf5bae3654c86945bdc75
1 parent
0f69eb47
Exists in
master
and in
5 other branches
Mudando hostdialog para gtkgrid
Showing
1 changed file
with
25 additions
and
0 deletions
Show diff stats
src/pw3270/hostdialog.c
| ... | ... | @@ -72,6 +72,19 @@ |
| 72 | 72 | return 0; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | +#if GTK_CHECK_VERSION(3,0,0) | |
| 76 | + static void set_row(int row, GtkWidget *widget, GtkGrid *container, const gchar *text) | |
| 77 | + { | |
| 78 | + GtkWidget *label = gtk_label_new_with_mnemonic(text); | |
| 79 | + | |
| 80 | + gtk_misc_set_alignment(GTK_MISC(label),0,0.5); | |
| 81 | + | |
| 82 | + gtk_grid_attach(container,label,0,row,1,1); | |
| 83 | + gtk_grid_attach(container,widget,1,row,1,1); | |
| 84 | + | |
| 85 | + gtk_label_set_mnemonic_widget(GTK_LABEL(label),widget); | |
| 86 | + } | |
| 87 | +#else | |
| 75 | 88 | static void set_row(int row, GtkWidget *widget, GtkTable *container, const gchar *text) |
| 76 | 89 | { |
| 77 | 90 | GtkWidget *label = gtk_label_new_with_mnemonic(text); |
| ... | ... | @@ -80,8 +93,10 @@ |
| 80 | 93 | |
| 81 | 94 | gtk_table_attach(container,label,0,1,row,row+1,GTK_FILL,0,5,0); |
| 82 | 95 | gtk_table_attach(container,widget,1,2,row,row+1,GTK_FILL,0,0,0); |
| 96 | + | |
| 83 | 97 | gtk_label_set_mnemonic_widget(GTK_LABEL(label),widget); |
| 84 | 98 | } |
| 99 | +#endif // GTK_CHECK_VERSION | |
| 85 | 100 | |
| 86 | 101 | static void systype_changed(GtkComboBox *widget, int *iHostType) |
| 87 | 102 | { |
| ... | ... | @@ -218,7 +233,17 @@ |
| 218 | 233 | |
| 219 | 234 | int row = 0; |
| 220 | 235 | GtkWidget * expander = gtk_expander_new_with_mnemonic(_( "_Host options")); |
| 236 | + | |
| 237 | +#if GTK_CHECK_VERSION(3,0,0) | |
| 238 | + GtkGrid * container = gtk_grid_new(); | |
| 239 | + | |
| 240 | + gtk_grid_set_column_spacing(container,5); | |
| 241 | + gtk_grid_set_row_spacing(container,3); | |
| 242 | + | |
| 243 | +#else | |
| 221 | 244 | GtkTable * container = GTK_TABLE(gtk_table_new(3,2,FALSE)); |
| 245 | +#endif // GTK_CHECK_VERSION | |
| 246 | + | |
| 222 | 247 | |
| 223 | 248 | if(!systype) |
| 224 | 249 | { | ... | ... |