From 9779807ba804d77c0b9fce9ca3c8d584e1e2b1d1 Mon Sep 17 00:00:00 2001 From: John Melton G0ORX Date: Tue, 15 Oct 2019 14:21:54 +0100 Subject: [PATCH] updated sliders panel height --- radio.c | 2 +- radio_menu.c | 23 ++++++++++------------- sliders.c | 40 ++++++++++++++++++++-------------------- 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/radio.c b/radio.c index 46f9382..43fd88a 100644 --- a/radio.c +++ b/radio.c @@ -85,7 +85,7 @@ #define METER_HEIGHT (60) #define METER_WIDTH (200) #define PANADAPTER_HEIGHT (105) -#define SLIDERS_HEIGHT (90) +#define SLIDERS_HEIGHT (100) #define TOOLBAR_HEIGHT (30) #define WATERFALL_HEIGHT (105) #ifdef PSK diff --git a/radio_menu.c b/radio_menu.c index 26d5ab3..62840fe 100644 --- a/radio_menu.c +++ b/radio_menu.c @@ -572,31 +572,28 @@ void radio_menu(GtkWidget *parent) { if(radio->info.soapy.rx_gains>0) { GtkWidget *rx_gain=gtk_label_new("Rx Gains:"); gtk_grid_attach(GTK_GRID(grid),rx_gain,col,row,1,1); - row++; - } - - - if(radio->info.soapy.rx_has_automatic_gain) { - GtkWidget *agc=gtk_check_button_new_with_label("Hardware AGC: "); - gtk_grid_attach(GTK_GRID(grid),agc,col,row,1,1); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(agc),adc[0].agc); - g_signal_connect(agc,"toggled",G_CALLBACK(agc_changed_cb),&adc[0]); - row++; } - row=temp_row; - if(can_transmit) { if(radio->info.soapy.tx_gains>0) { col=2; GtkWidget *tx_gain=gtk_label_new("Tx Gains:"); gtk_grid_attach(GTK_GRID(grid),tx_gain,col,row,1,1); - row++; } } + row++; temp_row=row; + if(radio->info.soapy.rx_has_automatic_gain) { + GtkWidget *agc=gtk_check_button_new_with_label("Hardware AGC: "); + gtk_grid_attach(GTK_GRID(grid),agc,col,row,1,1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(agc),adc[0].agc); + g_signal_connect(agc,"toggled",G_CALLBACK(agc_changed_cb),&adc[0]); + row++; + } + + for(i=0;iinfo.soapy.rx_gains;i++) { col=0; GtkWidget *rx_gain_label=gtk_label_new(radio->info.soapy.rx_gain[i]); diff --git a/sliders.c b/sliders.c index 0631e34..f6ffca5 100644 --- a/sliders.c +++ b/sliders.c @@ -497,7 +497,7 @@ void set_drive(double value) { scale_dialog=gtk_dialog_new_with_buttons("Drive",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL); GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog)); drive_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.00); - //gtk_widget_override_font(drive_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(drive_scale, pango_font_description_from_string("Sans 10")); gtk_widget_set_size_request (drive_scale, 400, 30); gtk_range_set_value (GTK_RANGE(drive_scale),value); gtk_widget_show(drive_scale); @@ -566,7 +566,7 @@ void set_squelch() { scale_dialog=gtk_dialog_new_with_buttons("Squelch",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL); GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog)); squelch_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.00); - //gtk_widget_override_font(squelch_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(squelch_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(squelch_scale),active_receiver->squelch); gtk_widget_set_size_request (squelch_scale, 400, 30); gtk_widget_show(squelch_scale); @@ -601,7 +601,7 @@ void set_compression(TRANSMITTER* tx) { scale_dialog=gtk_dialog_new_with_buttons("COMP",GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL); GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog)); comp_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 20.0, 1.00); - //gtk_widget_override_font(comp_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(comp_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(comp_scale),tx->compressor_level); gtk_widget_set_size_request (comp_scale, 400, 30); gtk_widget_show(comp_scale); @@ -687,24 +687,24 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); gtk_grid_set_column_homogeneous(GTK_GRID(sliders),TRUE); af_gain_label=gtk_label_new("AF:"); - //gtk_widget_override_font(af_gain_label, pango_font_description_from_string("Sans 11")); + gtk_widget_override_font(af_gain_label, pango_font_description_from_string("Sans 10")); gtk_widget_show(af_gain_label); gtk_grid_attach(GTK_GRID(sliders),af_gain_label,0,0,1,1); af_gain_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.00); - //gtk_widget_override_font(af_gain_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(af_gain_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(af_gain_scale),active_receiver->volume*100.0); gtk_widget_show(af_gain_scale); gtk_grid_attach(GTK_GRID(sliders),af_gain_scale,1,0,2,1); g_signal_connect(G_OBJECT(af_gain_scale),"value_changed",G_CALLBACK(afgain_value_changed_cb),NULL); agc_gain_label=gtk_label_new("AGC:"); - //gtk_widget_override_font(agc_gain_label, pango_font_description_from_string("Sans 11")); + gtk_widget_override_font(agc_gain_label, pango_font_description_from_string("Sans 10")); gtk_widget_show(agc_gain_label); gtk_grid_attach(GTK_GRID(sliders),agc_gain_label,3,0,1,1); agc_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,-20.0, 120.0, 1.0); - //gtk_widget_override_font(agc_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(agc_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(agc_scale),active_receiver->agc_gain); gtk_widget_show(agc_scale); gtk_grid_attach(GTK_GRID(sliders),agc_scale,4,0,2,1); @@ -717,7 +717,7 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); sprintf(title,"ATT (dB)"/*,active_receiver->adc*/); #endif attenuation_label=gtk_label_new(title); - //gtk_widget_override_font(attenuation_label, pango_font_description_from_string("Sans 11")); + gtk_widget_override_font(attenuation_label, pango_font_description_from_string("Sans 10")); gtk_widget_show(attenuation_label); gtk_grid_attach(GTK_GRID(sliders),attenuation_label,6,0,1,1); @@ -728,18 +728,18 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); attenuation_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 31.0, 1.0); gtk_range_set_value (GTK_RANGE(attenuation_scale),adc_attenuation[active_receiver->adc]); #endif - //gtk_widget_override_font(attenuation_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(attenuation_scale, pango_font_description_from_string("Sans 10")); gtk_widget_show(attenuation_scale); gtk_grid_attach(GTK_GRID(sliders),attenuation_scale,7,0,2,1); g_signal_connect(G_OBJECT(attenuation_scale),"value_changed",G_CALLBACK(attenuation_value_changed_cb),NULL); c25_att_preamp_label = gtk_label_new("Att/PreAmp"); - //gtk_widget_override_font(c25_att_preamp_label, pango_font_description_from_string("Sans 11")); + gtk_widget_override_font(c25_att_preamp_label, pango_font_description_from_string("Sans 10")); gtk_grid_attach(GTK_GRID(sliders), c25_att_preamp_label, 6, 0, 1, 1); c25_att_combobox = gtk_combo_box_text_new(); - //gtk_widget_override_font(c25_att_combobox, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(c25_att_combobox, pango_font_description_from_string("Sans 10")); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_att_combobox), "0", "0 dB"); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_att_combobox), "1", "-12 dB"); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_att_combobox), "2", "-24 dB"); @@ -748,7 +748,7 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); g_signal_connect(G_OBJECT(c25_att_combobox), "changed", G_CALLBACK(c25_att_combobox_changed), NULL); c25_preamp_combobox = gtk_combo_box_text_new(); - //gtk_widget_override_font(c25_preamp_combobox, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(c25_preamp_combobox, pango_font_description_from_string("Sans 10")); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_preamp_combobox), "0", "0 dB"); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_preamp_combobox), "1", "18 dB"); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(c25_preamp_combobox), "2", "36 dB"); @@ -760,21 +760,21 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); if(can_transmit) { mic_gain_label=gtk_label_new(mic_linein?"Linein:":"Mic (dB):"); - //gtk_widget_override_font(mic_gain_label, pango_font_description_from_string("Sans 11")); + gtk_widget_override_font(mic_gain_label, pango_font_description_from_string("Sans 10")); gtk_grid_attach(GTK_GRID(sliders),mic_gain_label,0,1,1,1); mic_gain_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,mic_linein?0.0:-10.0,mic_linein?31.0:50.0, 1.0); - //gtk_widget_override_font(mic_gain_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(mic_gain_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(mic_gain_scale),mic_linein?linein_gain:mic_gain); gtk_grid_attach(GTK_GRID(sliders),mic_gain_scale,1,1,2,1); g_signal_connect(G_OBJECT(mic_gain_scale),"value_changed",G_CALLBACK(micgain_value_changed_cb),NULL); drive_label=gtk_label_new("Drive:"); - //gtk_widget_override_font(drive_label, pango_font_description_from_string("Sans 11")); + gtk_widget_override_font(drive_label, pango_font_description_from_string("Sans 10")); gtk_grid_attach(GTK_GRID(sliders),drive_label,3,1,1,1); drive_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.0); - //gtk_widget_override_font(drive_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(drive_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(drive_scale),getDrive()); gtk_widget_show(drive_scale); gtk_grid_attach(GTK_GRID(sliders),drive_scale,4,1,2,1); @@ -783,12 +783,12 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); #ifndef COMPRESSION_SLIDER_INSTEAD_OF_SQUELCH squelch_label=gtk_label_new("Squelch:"); - //gtk_widget_override_font(squelch_label, pango_font_description_from_string("Sans 11")); + gtk_widget_override_font(squelch_label, pango_font_description_from_string("Sans 10")); gtk_widget_show(squelch_label); gtk_grid_attach(GTK_GRID(sliders),squelch_label,6,1,1,1); squelch_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 100.0, 1.0); - //gtk_widget_override_font(squelch_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(squelch_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(squelch_scale),active_receiver->squelch); gtk_widget_show(squelch_scale); gtk_grid_attach(GTK_GRID(sliders),squelch_scale,7,1,2,1); @@ -802,12 +802,12 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height); #else if(can_transmit) { comp_label=gtk_label_new("COMP:"); - //gtk_widget_override_font(comp_label, pango_font_description_from_string("Sans 11")); + gtk_widget_override_font(comp_label, pango_font_description_from_string("Sans 10")); gtk_widget_show(comp_label); gtk_grid_attach(GTK_GRID(sliders),comp_label,6,1,1,1); comp_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 20.0, 1.0); - //gtk_widget_override_font(comp_scale, pango_font_description_from_string("Sans 10")); + gtk_widget_override_font(comp_scale, pango_font_description_from_string("Sans 10")); gtk_range_set_value (GTK_RANGE(comp_scale),transmitter->compressor_level); gtk_widget_show(comp_scale); gtk_grid_attach(GTK_GRID(sliders),comp_scale,7,1,2,1); -- 2.45.2