]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
a) use typeface defined in radio.h to label the sliders
authorc vw <dl1ycf@darc.de>
Tue, 1 Dec 2020 09:53:40 +0000 (10:53 +0100)
committerc vw <dl1ycf@darc.de>
Tue, 1 Dec 2020 09:53:40 +0000 (10:53 +0100)
b) align Zoom/Pan sliders with other sliders

radio.h
sliders.c
zoompan.c

diff --git a/radio.h b/radio.h
index e3625ccb3a1ebcc4e100909a833f4be8089eaa72..74b4e8a7f433f52d44640f2bf2085aed898f48e1 100644 (file)
--- a/radio.h
+++ b/radio.h
@@ -35,6 +35,8 @@
 #define DISPLAY_FONT_SIZE3 16
 #define DISPLAY_FONT_SIZE4 22
 
+#define SLIDERS_FONT "FreeSans Bold 10"   // Used for description in the sliders/zoompan area
+
 #define NEW_MIC_IN 0x00
 #define NEW_LINE_IN 0x01
 #define NEW_MIC_BOOST 0x02
index a13eb3ba1a80fcb2dd650c6bc2372b2e4dd7c45b..76163eda07d63e390d1c7d9b5b61d165f573a7a1 100644 (file)
--- a/sliders.c
+++ b/sliders.c
@@ -599,7 +599,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, drive_max, 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(SLIDERS_FONT));
       gtk_widget_set_size_request (drive_scale, 400, 30);
       gtk_range_set_value (GTK_RANGE(drive_scale),value);
       gtk_widget_show(drive_scale);
@@ -685,7 +685,7 @@ void set_squelch() {
       scale_dialog=gtk_dialog_new_with_buttons(title,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(SLIDERS_FONT));
       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);
@@ -722,7 +722,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(SLIDERS_FONT));
       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);
@@ -806,12 +806,12 @@ 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 10"));
+  gtk_widget_override_font(af_gain_label, pango_font_description_from_string(SLIDERS_FONT));
   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(SLIDERS_FONT));
   gtk_range_set_increments (GTK_RANGE(af_gain_scale),1.0,1.0);
   gtk_range_set_value (GTK_RANGE(af_gain_scale),active_receiver->volume*100.0);
   gtk_widget_show(af_gain_scale);
@@ -819,12 +819,12 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height);
   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 10"));
+  gtk_widget_override_font(agc_gain_label, pango_font_description_from_string(SLIDERS_FONT));
   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(SLIDERS_FONT));
   gtk_range_set_increments (GTK_RANGE(agc_scale),1.0,1.0);
   gtk_range_set_value (GTK_RANGE(agc_scale),active_receiver->agc_gain);
   gtk_widget_show(agc_scale);
@@ -838,7 +838,7 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height);
         sprintf(title,"ATT (dB):");
   }
   attenuation_label=gtk_label_new(title);
-  gtk_widget_override_font(attenuation_label, pango_font_description_from_string("Sans 10"));
+  gtk_widget_override_font(attenuation_label, pango_font_description_from_string(SLIDERS_FONT));
   gtk_widget_show(attenuation_label);
   gtk_grid_attach(GTK_GRID(sliders),attenuation_label,6,0,1,1);
 
@@ -851,18 +851,18 @@ fprintf(stderr,"sliders_init: width=%d height=%d\n", width,height);
   }
   gtk_range_set_increments (GTK_RANGE(attenuation_scale),1.0,1.0);
  
-  gtk_widget_override_font(attenuation_scale, pango_font_description_from_string("Sans 10"));
+  gtk_widget_override_font(attenuation_scale, pango_font_description_from_string(SLIDERS_FONT));
   
   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 10"));
+  gtk_widget_override_font(c25_att_preamp_label, pango_font_description_from_string(SLIDERS_FONT));
   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(SLIDERS_FONT));
   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");
@@ -871,7 +871,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(SLIDERS_FONT));
   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");
@@ -883,21 +883,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:");
-    gtk_widget_override_font(mic_gain_label, pango_font_description_from_string("Sans 10"));
+    gtk_widget_override_font(mic_gain_label, pango_font_description_from_string(SLIDERS_FONT));
     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:-12.0,mic_linein?31.0:50.0, 1.0);
     gtk_range_set_increments (GTK_RANGE(mic_gain_scale),1.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(SLIDERS_FONT));
     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 10"));
+    gtk_widget_override_font(drive_label, pango_font_description_from_string(SLIDERS_FONT));
     gtk_grid_attach(GTK_GRID(sliders),drive_label,3,1,1,1);
     drive_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, drive_max, 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(SLIDERS_FONT));
     gtk_range_set_increments (GTK_RANGE(drive_scale),1.0,1.0);
     gtk_range_set_value (GTK_RANGE(drive_scale),getDrive());
     gtk_widget_show(drive_scale);
@@ -907,12 +907,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 10"));
+  gtk_widget_override_font(squelch_label, pango_font_description_from_string(SLIDERS_FONT));
   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(SLIDERS_FONT));
   gtk_range_set_increments (GTK_RANGE(squelch_scale),1.0,1.0);
   gtk_range_set_value (GTK_RANGE(squelch_scale),active_receiver->squelch);
   gtk_widget_show(squelch_scale);
@@ -927,12 +927,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 10"));
+    gtk_widget_override_font(comp_label, pango_font_description_from_string(SLIDERS_FONT));
     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(SLIDERS_FONT));
     gtk_range_set_increments (GTK_RANGE(comp_scale),1.0,1.0);
     gtk_range_set_value (GTK_RANGE(comp_scale),transmitter->compressor_level);
     gtk_widget_show(comp_scale);
index bcf86c9079fec788dfc141c56035aeb1fd8f07ae..d83b6077110bb6994ca7ba1bc1678fe2f04ad467 100644 (file)
--- a/zoompan.c
+++ b/zoompan.c
@@ -236,13 +236,13 @@ fprintf(stderr,"zoompan_init: width=%d height=%d\n", width,height);
   gtk_grid_set_row_homogeneous(GTK_GRID(zoompan), FALSE);
   gtk_grid_set_column_homogeneous(GTK_GRID(zoompan),TRUE);
 
-  zoom_label=gtk_label_new("Zoom");
-  gtk_widget_override_font(zoom_label, pango_font_description_from_string("Sans 10"));
+  zoom_label=gtk_label_new("Zoom:");
+  gtk_widget_override_font(zoom_label, pango_font_description_from_string(SLIDERS_FONT));
   gtk_widget_show(zoom_label);
   gtk_grid_attach(GTK_GRID(zoompan),zoom_label,0,0,1,1);
 
   zoom_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,1.0,MAX_ZOOM,1.00);
-  gtk_widget_override_font(zoom_scale, pango_font_description_from_string("Sans 10"));
+  gtk_widget_override_font(zoom_scale, pango_font_description_from_string(SLIDERS_FONT));
   gtk_range_set_increments (GTK_RANGE(zoom_scale),1.0,1.0);
   gtk_range_set_value (GTK_RANGE(zoom_scale),active_receiver->zoom);
   gtk_widget_show(zoom_scale);
@@ -250,17 +250,17 @@ fprintf(stderr,"zoompan_init: width=%d height=%d\n", width,height);
   zoom_signal_id=g_signal_connect(G_OBJECT(zoom_scale),"value_changed",G_CALLBACK(zoom_value_changed_cb),NULL);
 
   pan_label=gtk_label_new("Pan:");
-  gtk_widget_override_font(pan_label, pango_font_description_from_string("Sans 10"));
+  gtk_widget_override_font(pan_label, pango_font_description_from_string(SLIDERS_FONT));
   gtk_widget_show(pan_label);
   gtk_grid_attach(GTK_GRID(zoompan),pan_label,3,0,1,1);
 
   pan_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0,active_receiver->zoom==1?active_receiver->width:active_receiver->width*(active_receiver->zoom-1),1.0);
-  gtk_widget_override_font(pan_scale, pango_font_description_from_string("Sans 10"));
+  gtk_widget_override_font(pan_scale, pango_font_description_from_string(SLIDERS_FONT));
   gtk_scale_set_draw_value (GTK_SCALE(pan_scale), FALSE);
   gtk_range_set_increments (GTK_RANGE(pan_scale),10.0,10.0);
   gtk_range_set_value (GTK_RANGE(pan_scale),active_receiver->pan);
   gtk_widget_show(pan_scale);
-  gtk_grid_attach(GTK_GRID(zoompan),pan_scale,4,0,5,1);
+  gtk_grid_attach(GTK_GRID(zoompan),pan_scale,4,0,6,1);
   pan_signal_id=g_signal_connect(G_OBJECT(pan_scale),"value_changed",G_CALLBACK(pan_value_changed_cb),NULL);
 
   if(active_receiver->zoom == 1) {