Commit d6b4b1bb authored by Basile Starynkevitch's avatar Basile Starynkevitch
Browse files

no want to set window-label-font. See issue#30

parent 4e2e3d79
# default RefPerSys Qt settings
# see http://refpersys.org/
# see http://refpersys.org/ and https://doc.qt.io/qt-5/qsettings.html
# file refpersys/.qt-refpersys.ini
## the font for windows label
window/label/font= FreeSans, 15
window_label_font=Bitstream%20Vera%20Sans,12,-1,5,75,0,0,0,0,0
## to output tagged integers
out/int/bgcolor= azure
......
......@@ -72,15 +72,19 @@ RpsQWindow::RpsQWindow (QWidget *parent, int rank)
{
QSettings* qst = RpsQApplication::qt_settings();
RPS_ASSERT(qst);
constexpr const char*label_setting_name = "window_label_font";
RPS_DEBUG_LOG(GUI, "RpsQWindow::RpsQWindow settings path: "
<< qst->fileName().toStdString());
QFont label_font = qst->value("window/label/font").value<QFont>();
<< qst->fileName().toStdString() << " "
<< ((qst->contains(QString(label_setting_name)))?"has":"without")
<< " "
<< label_setting_name);
QFont label_font = qst->value(label_setting_name).value<QFont>();
int label_fontsize = label_font.pointSize();
int label_minheight = (label_fontsize)>2?((4*label_fontsize)/3+1):10;
int label_maxheight = (label_fontsize)>2?(2*label_fontsize):24;
if (label_maxheight <= label_minheight+2)
label_maxheight = (9*label_minheight)/8+1;
RPS_DEBUG_LOG(GUI, "RpsQWindow::RpsQWindow label_font: " << label_font.toString().toStdString()
RPS_DEBUG_LOG(GUI, "RpsQWindow::RpsQWindow " << label_setting_name << ":=" << label_font.toString().toStdString()
<< ", label_fontsize=" << label_fontsize
<< ", label_minheight=" << label_minheight
<< ", label_maxheight=" << label_maxheight);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment