@@ -1969,7 +1969,7 @@ void
1969
1969
visual_show (BACKTRELLIS * bt )
1970
1970
{
1971
1971
GtkWidget * window , * button , * draw , * entry , * scale , * headerbar ;
1972
- GtkWidget * box1 , * box2 , * label , * frame , * box3 , * start_box , * zoom_box ;
1972
+ GtkWidget * box1 , * box2 , * label , * box3 , * start_box , * zoom_box ;
1973
1973
GSList * group ;
1974
1974
GList * glist ;
1975
1975
@@ -2007,20 +2007,19 @@ visual_show(BACKTRELLIS *bt)
2007
2007
gtk_window_set_titlebar (GTK_WINDOW (window ), headerbar );
2008
2008
2009
2009
/* create horizontal packing box */
2010
- box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 5 );
2011
- gtk_container_set_border_width (GTK_CONTAINER (box1 ), 18 );
2010
+ box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 0 );
2012
2011
gtk_container_add (GTK_CONTAINER (window ), box1 );
2013
2012
2014
2013
/* box containing the drawing area and labels */
2015
- start_box = gtk_box_new (GTK_ORIENTATION_VERTICAL , 6 );
2014
+ start_box = gtk_box_new (GTK_ORIENTATION_VERTICAL , 12 );
2016
2015
gtk_widget_set_hexpand (start_box , TRUE);
2017
2016
gtk_widget_set_vexpand (start_box , TRUE);
2018
2017
gtk_container_add (GTK_CONTAINER (box1 ), start_box );
2019
2018
2020
2019
/* create scrolled window */
2021
2020
scrolled_window = gtk_scrolled_window_new (NULL , NULL );
2021
+ gtk_widget_set_margin_top (scrolled_window , 12 );
2022
2022
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window ), GTK_POLICY_AUTOMATIC , GTK_POLICY_AUTOMATIC );
2023
- gtk_container_set_border_width (GTK_CONTAINER (scrolled_window ), 18 );
2024
2023
2025
2024
/* create drawing area */
2026
2025
draw = gtk_drawing_area_new ();
@@ -2048,23 +2047,34 @@ visual_show(BACKTRELLIS *bt)
2048
2047
g_signal_connect_swapped (button , "clicked" , G_CALLBACK (action_zoom_in ), draw );
2049
2048
gtk_container_add (GTK_CONTAINER (zoom_box ), button );
2050
2049
2050
+ /* vertical separator */
2051
+ gtk_container_add (GTK_CONTAINER (start_box ), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL ));
2051
2052
2052
2053
/* labels */
2053
2054
op_label = gtk_label_new ("Accumulated score (normalized by time)" );
2054
2055
gtk_widget_set_halign (op_label , GTK_ALIGN_START );
2055
2056
gtk_container_add (GTK_CONTAINER (start_box ), op_label );
2057
+ gtk_widget_set_margin_start (op_label , 18 );
2058
+ gtk_widget_set_margin_bottom (op_label , 12 );
2059
+
2060
+ /* vertical separator */
2061
+ gtk_container_add (GTK_CONTAINER (box1 ), gtk_separator_new (GTK_ORIENTATION_VERTICAL ));
2056
2062
2057
2063
/* create packing box for buttons */
2058
2064
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL , 6 );
2059
2065
gtk_box_pack_start (GTK_BOX (box1 ), box2 , FALSE, TRUE, 0 );
2066
+ gtk_container_set_border_width (GTK_CONTAINER (box2 ), 12 );
2067
+ gtk_widget_set_size_request (box2 , 200 , -1 );
2060
2068
2061
2069
if (re -> speechlen != 0 ) {
2062
- /* create waveform related frame */
2063
- frame = gtk_frame_new ( " Waveform" );
2064
- gtk_box_pack_start (GTK_BOX (box2 ), frame , FALSE, FALSE, 0 );
2070
+ /* create waveform related section */
2071
+ label = gtk_label_new ( "<b> Waveform</b> " );
2072
+ gtk_box_pack_start (GTK_BOX (box2 ), label , FALSE, FALSE, 0 );
2065
2073
box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 6 );
2074
+ gtk_widget_set_margin_start (box3 , 12 );
2075
+ gtk_widget_set_margin_bottom (box3 , 12 );
2066
2076
gtk_container_set_border_width (GTK_CONTAINER (box3 ), 12 );
2067
- gtk_container_add (GTK_CONTAINER (frame ), box3 );
2077
+ gtk_container_add (GTK_CONTAINER (box2 ), box3 );
2068
2078
2069
2079
/* create play button if supported */
2070
2080
#ifdef PLAYCOMMAND
@@ -2084,11 +2094,15 @@ visual_show(BACKTRELLIS *bt)
2084
2094
}
2085
2095
2086
2096
/* create scaling frame */
2087
- frame = gtk_frame_new ("Change view" );
2088
- gtk_box_pack_start (GTK_BOX (box2 ), frame , FALSE, FALSE, 0 );
2089
- box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 6 );
2097
+ label = gtk_label_new ("<b>Change view</b>" );
2098
+ gtk_widget_set_halign (label , GTK_ALIGN_START );
2099
+ gtk_label_set_use_markup (GTK_LABEL (label ), TRUE);
2100
+ gtk_box_pack_start (GTK_BOX (box2 ), label , FALSE, FALSE, 0 );
2101
+ box3 = gtk_box_new (GTK_ORIENTATION_VERTICAL , 6 );
2102
+ gtk_widget_set_margin_start (box3 , 12 );
2103
+ gtk_widget_set_margin_bottom (box3 , 12 );
2090
2104
gtk_container_set_border_width (GTK_CONTAINER (box3 ), 12 );
2091
- gtk_container_add (GTK_CONTAINER (frame ), box3 );
2105
+ gtk_container_add (GTK_CONTAINER (box2 ), box3 );
2092
2106
2093
2107
/* create word view button */
2094
2108
button = gtk_radio_button_new_with_label (NULL , "Word" );
@@ -2108,38 +2122,34 @@ visual_show(BACKTRELLIS *bt)
2108
2122
g_signal_connect (button , "toggled" , G_CALLBACK (action_view_beam ), draw );
2109
2123
gtk_box_pack_start (GTK_BOX (box3 ), button , FALSE, FALSE, 0 );
2110
2124
2111
- /* create show/hide frame */
2112
- frame = gtk_frame_new ("Show/hide" );
2113
- gtk_box_pack_start (GTK_BOX (box2 ), frame , FALSE, FALSE, 0 );
2114
- box3 = gtk_box_new (GTK_ORIENTATION_VERTICAL , 6 );
2115
- gtk_container_set_border_width (GTK_CONTAINER (box3 ), 12 );
2116
- gtk_container_add (GTK_CONTAINER (frame ), box3 );
2117
-
2118
2125
/* create text toggle button */
2119
- button = gtk_toggle_button_new_with_label ("Arcs" );
2126
+ button = gtk_check_button_new_with_label ("Hide arcs" );
2127
+ gtk_widget_set_halign (button , GTK_ALIGN_START );
2128
+ gtk_widget_set_margin_start (button , 12 );
2129
+ gtk_widget_set_margin_bottom (button , 18 );
2120
2130
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button ), TRUE);
2121
2131
g_signal_connect (button , "toggled" , G_CALLBACK (action_toggle_arc ), draw );
2122
- gtk_box_pack_start (GTK_BOX (box3 ), button , FALSE, FALSE, 0 );
2123
-
2124
- /* create word entry frame */
2125
- frame = gtk_frame_new ("View Words" );
2126
- gtk_box_pack_start (GTK_BOX (box2 ), frame , FALSE, FALSE, 0 );
2127
- box3 = gtk_box_new (GTK_ORIENTATION_VERTICAL , 6 );
2128
- gtk_container_set_border_width (GTK_CONTAINER (box3 ), 12 );
2129
- gtk_container_add (GTK_CONTAINER (frame ), box3 );
2132
+ gtk_box_pack_start (GTK_BOX (box2 ), button , FALSE, FALSE, 0 );
2130
2133
2131
2134
/* create word ID entry */
2132
- entry = gtk_entry_new ();
2133
- gtk_entry_set_max_length (GTK_ENTRY (entry ), 16 );
2135
+ entry = gtk_search_entry_new ();
2136
+ gtk_entry_set_max_length (GTK_ENTRY (entry ), 32 );
2137
+ gtk_entry_set_width_chars (GTK_ENTRY (entry ), 32 );
2138
+ gtk_entry_set_placeholder_text (GTK_ENTRY (entry ), "Type the word to search..." );
2134
2139
g_signal_connect (entry , "activate" , G_CALLBACK (action_set_wid ), draw );
2135
- gtk_box_pack_start (GTK_BOX (box3 ), entry , FALSE, FALSE, 0 );
2136
-
2137
- /* create replay frame */
2138
- frame = gtk_frame_new ("Pass2 Replay" );
2139
- gtk_box_pack_start (GTK_BOX (box2 ), frame , FALSE, FALSE, 0 );
2140
+ g_signal_connect (entry , "search-changed" , G_CALLBACK (action_set_wid ), draw );
2141
+ gtk_header_bar_set_custom_title (GTK_HEADER_BAR (headerbar ), entry );
2142
+
2143
+ /* create replay section */
2144
+ label = gtk_label_new ("<b>Pass2 Replay</b>" );
2145
+ gtk_widget_set_halign (label , GTK_ALIGN_START );
2146
+ gtk_label_set_use_markup (GTK_LABEL (label ), TRUE);
2147
+ gtk_box_pack_start (GTK_BOX (box2 ), label , FALSE, FALSE, 0 );
2140
2148
box3 = gtk_box_new (GTK_ORIENTATION_VERTICAL , 6 );
2149
+ gtk_widget_set_margin_start (box3 , 12 );
2150
+ gtk_widget_set_margin_bottom (box3 , 12 );
2141
2151
gtk_container_set_border_width (GTK_CONTAINER (box3 ), 12 );
2142
- gtk_container_add (GTK_CONTAINER (frame ), box3 );
2152
+ gtk_container_add (GTK_CONTAINER (box2 ), box3 );
2143
2153
2144
2154
/* create replay start button */
2145
2155
button = gtk_toggle_button_new_with_label ("Start" );
0 commit comments