diff --git a/gtk/hig.c b/gtk/hig.c index 17f62fe0d..4691cadaf 100644 --- a/gtk/hig.c +++ b/gtk/hig.c @@ -125,6 +125,21 @@ hig_workarea_add_label( GtkWidget * t, return l; } +static void +hig_workarea_add_tall_control( GtkWidget * t, + int row, + GtkWidget * control ) +{ + if( GTK_IS_MISC( control ) ) + gtk_misc_set_alignment( GTK_MISC( control ), 0.0f, 0.5f ); + + gtk_table_attach( GTK_TABLE( t ), control, + 1, 2, row, row + 1, + GTK_EXPAND | GTK_SHRINK | GTK_FILL, + GTK_EXPAND | GTK_SHRINK | GTK_FILL, + 0, 0 ); +} + void hig_workarea_add_control( GtkWidget * t, int row, @@ -166,6 +181,30 @@ hig_workarea_add_row( GtkWidget * t, return l; } +GtkWidget* +hig_workarea_add_tall_row( GtkWidget * table, + int * row, + const char * mnemonic_string, + GtkWidget * control, + GtkWidget * mnemonic ) +{ + GtkWidget * l = gtk_label_new_with_mnemonic( mnemonic_string ); + GtkWidget * h = gtk_hbox_new( FALSE, 0 ); + GtkWidget * v = gtk_vbox_new( FALSE, 0 ); + gtk_box_pack_start( GTK_BOX( h ), l, FALSE, FALSE, 0 ); + gtk_box_pack_start( GTK_BOX( v ), h, FALSE, FALSE, GUI_PAD_SMALL ); + + hig_workarea_add_label_w( table, *row, v ); + hig_workarea_add_tall_control( table, *row, control ); + + if( GTK_IS_LABEL( l ) ) + gtk_label_set_mnemonic_widget( GTK_LABEL( l ), + mnemonic ? mnemonic : control ); + + ++ * row; + return l; +} + void hig_workarea_finish( GtkWidget * t, int * row ) diff --git a/gtk/hig.h b/gtk/hig.h index 7b4c96947..502776b80 100644 --- a/gtk/hig.h +++ b/gtk/hig.h @@ -54,6 +54,12 @@ void hig_workarea_add_control( GtkWidget * table, int row, GtkWidget * control ); +GtkWidget* hig_workarea_add_tall_row( GtkWidget * table, + int * row, + const char * mnemonic_string, + GtkWidget * control, + GtkWidget * mnemonic_or_null_for_control ); + GtkWidget* hig_workarea_add_row( GtkWidget * table, int * row, const char * mnemonic_string,