UI: Use separate font setting for VFO input and Time to
avoid inheriting asymmetric fonts from the main screen
This commit is contained in:
parent
bcf2aa636c
commit
2728dbcce1
|
|
@ -89,6 +89,7 @@ typedef struct layout_t
|
|||
fontSize_t line2_font;
|
||||
fontSize_t line3_font;
|
||||
fontSize_t bottom_font;
|
||||
fontSize_t input_font;
|
||||
} layout_t;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -207,6 +207,8 @@ layout_t _ui_calculateLayout()
|
|||
const fontSize_t line3_font = FONT_SIZE_16PT;
|
||||
// Bottom bar font: 8 pt
|
||||
const fontSize_t bottom_font = FONT_SIZE_8PT;
|
||||
// TimeDate/Frequency input font
|
||||
const fontSize_t input_font = FONT_SIZE_12PT;
|
||||
|
||||
// Radioddity GD-77
|
||||
#elif SCREEN_HEIGHT > 63
|
||||
|
|
@ -232,6 +234,8 @@ layout_t _ui_calculateLayout()
|
|||
const fontSize_t line3_font = FONT_SIZE_12PT;
|
||||
// Bottom bar font: 6 pt
|
||||
const fontSize_t bottom_font = FONT_SIZE_6PT;
|
||||
// TimeDate/Frequency input font
|
||||
const fontSize_t input_font = FONT_SIZE_8PT;
|
||||
|
||||
// Radioddity RD-5R
|
||||
#elif SCREEN_HEIGHT > 47
|
||||
|
|
@ -254,6 +258,8 @@ layout_t _ui_calculateLayout()
|
|||
// Middle line fonts: 16, 16
|
||||
const fontSize_t line2_font = FONT_SIZE_6PT;
|
||||
const fontSize_t line3_font = FONT_SIZE_12PT;
|
||||
// TimeDate/Frequency input font
|
||||
const fontSize_t input_font = FONT_SIZE_8PT;
|
||||
// Not present on this resolution
|
||||
const fontSize_t line1_font = 0;
|
||||
const fontSize_t bottom_font = 0;
|
||||
|
|
@ -289,7 +295,8 @@ layout_t _ui_calculateLayout()
|
|||
line1_font,
|
||||
line2_font,
|
||||
line3_font,
|
||||
bottom_font
|
||||
bottom_font,
|
||||
input_font
|
||||
};
|
||||
return new_layout;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ void _ui_drawVFOMiddleInput(ui_state_t* ui_state)
|
|||
snprintf(freq_buf, sizeof(freq_buf), ">Rx:%03lu.%05lu",
|
||||
(unsigned long)ui_state->new_rx_frequency/1000000,
|
||||
(unsigned long)ui_state->new_rx_frequency%1000000/10);
|
||||
gfx_print(layout.line1_pos, freq_buf, layout.line1_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line1_pos, freq_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
}
|
||||
else
|
||||
|
|
@ -115,13 +115,13 @@ void _ui_drawVFOMiddleInput(ui_state_t* ui_state)
|
|||
if(ui_state->input_position == 1)
|
||||
strcpy(ui_state->new_rx_freq_buf, ">Rx:___._____");
|
||||
ui_state->new_rx_freq_buf[insert_pos] = input_char;
|
||||
gfx_print(layout.line1_pos, ui_state->new_rx_freq_buf, layout.line1_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line1_pos, ui_state->new_rx_freq_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
}
|
||||
snprintf(freq_buf, sizeof(freq_buf), " Tx:%03lu.%05lu",
|
||||
(unsigned long)last_state.channel.tx_frequency/1000000,
|
||||
(unsigned long)last_state.channel.tx_frequency%1000000/10);
|
||||
gfx_print(layout.line2_pos, freq_buf, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line2_pos, freq_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
}
|
||||
else if(ui_state->input_set == SET_TX)
|
||||
|
|
@ -129,7 +129,7 @@ void _ui_drawVFOMiddleInput(ui_state_t* ui_state)
|
|||
snprintf(freq_buf, sizeof(freq_buf), " Rx:%03lu.%05lu",
|
||||
(unsigned long)ui_state->new_rx_frequency/1000000,
|
||||
(unsigned long)ui_state->new_rx_frequency%1000000/10);
|
||||
gfx_print(layout.line1_pos, freq_buf, layout.line1_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line1_pos, freq_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
// Replace Rx frequency with underscorses
|
||||
if(ui_state->input_position == 0)
|
||||
|
|
@ -137,7 +137,7 @@ void _ui_drawVFOMiddleInput(ui_state_t* ui_state)
|
|||
snprintf(freq_buf, sizeof(freq_buf), ">Tx:%03lu.%05lu",
|
||||
(unsigned long)ui_state->new_rx_frequency/1000000,
|
||||
(unsigned long)ui_state->new_rx_frequency%1000000/10);
|
||||
gfx_print(layout.line2_pos, freq_buf, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line2_pos, freq_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
}
|
||||
else
|
||||
|
|
@ -145,7 +145,7 @@ void _ui_drawVFOMiddleInput(ui_state_t* ui_state)
|
|||
if(ui_state->input_position == 1)
|
||||
strcpy(ui_state->new_tx_freq_buf, ">Tx:___._____");
|
||||
ui_state->new_tx_freq_buf[insert_pos] = input_char;
|
||||
gfx_print(layout.line2_pos, ui_state->new_tx_freq_buf, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line2_pos, ui_state->new_tx_freq_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,9 +281,9 @@ void _ui_drawSettingsTimeDate()
|
|||
last_state.time.date, last_state.time.month, last_state.time.year);
|
||||
snprintf(time_buf, sizeof(time_buf), "%02d:%02d:%02d",
|
||||
last_state.time.hour, last_state.time.minute, last_state.time.second);
|
||||
gfx_print(layout.line2_pos, date_buf, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line2_pos, date_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
gfx_print(layout.line3_pos, time_buf, layout.line3_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line3_pos, time_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
}
|
||||
|
||||
|
|
@ -321,9 +321,9 @@ void _ui_drawSettingsTimeDateSet(ui_state_t* ui_state)
|
|||
ui_state->new_time_buf[pos] = input_char;
|
||||
}
|
||||
}
|
||||
gfx_print(layout.line2_pos, ui_state->new_date_buf, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line2_pos, ui_state->new_date_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
gfx_print(layout.line3_pos, ui_state->new_time_buf, layout.line3_font, TEXT_ALIGN_CENTER,
|
||||
gfx_print(layout.line3_pos, ui_state->new_time_buf, layout.input_font, TEXT_ALIGN_CENTER,
|
||||
color_white);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue