Adjust the font selection display text when the current choice is to let webkit choose the default
This commit is contained in:
parent
569a2075d9
commit
4652ade6c0
@ -148,14 +148,7 @@ void UIPrefsDialog::setFromPrefs()
|
|||||||
// Result list font family and size
|
// Result list font family and size
|
||||||
reslistFontFamily = prefs.reslistfontfamily;
|
reslistFontFamily = prefs.reslistfontfamily;
|
||||||
reslistFontSize = prefs.reslistfontsize;
|
reslistFontSize = prefs.reslistfontsize;
|
||||||
QString s;
|
setupReslistFontPB();
|
||||||
if (prefs.reslistfontfamily.length() == 0) {
|
|
||||||
reslistFontPB->setText(this->font().family() + "-" +
|
|
||||||
s.setNum(this->font().pointSize()));
|
|
||||||
} else {
|
|
||||||
reslistFontPB->setText(reslistFontFamily + "-" +
|
|
||||||
s.setNum(reslistFontSize));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Style sheet
|
// Style sheet
|
||||||
qssFile = prefs.qssFile;
|
qssFile = prefs.qssFile;
|
||||||
@ -231,6 +224,17 @@ void UIPrefsDialog::setFromPrefs()
|
|||||||
idxLV->sortItems();
|
idxLV->sortItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UIPrefsDialog::setupReslistFontPB()
|
||||||
|
{
|
||||||
|
QString s;
|
||||||
|
if (reslistFontFamily.length() == 0) {
|
||||||
|
reslistFontPB->setText(tr("Default QtWebkit font"));
|
||||||
|
} else {
|
||||||
|
reslistFontPB->setText(reslistFontFamily + "-" +
|
||||||
|
s.setNum(reslistFontSize));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UIPrefsDialog::accept()
|
void UIPrefsDialog::accept()
|
||||||
{
|
{
|
||||||
prefs.ssearchOnWS = ssAutoSpaceCB->isChecked();
|
prefs.ssearchOnWS = ssAutoSpaceCB->isChecked();
|
||||||
@ -383,19 +387,9 @@ void UIPrefsDialog::showFontDialog()
|
|||||||
// to do wrong. So now always set the font. There is still a
|
// to do wrong. So now always set the font. There is still a
|
||||||
// way for the user to let webkit choose the default though:
|
// way for the user to let webkit choose the default though:
|
||||||
// click reset, then the font name and size will be empty.
|
// click reset, then the font name and size will be empty.
|
||||||
QString s;
|
reslistFontFamily = font.family();
|
||||||
if (1 || font.family().compare(this->font().family()) ||
|
reslistFontSize = font.pointSize();
|
||||||
font.pointSize() != this->font().pointSize()) {
|
setupReslistFontPB();
|
||||||
reslistFontFamily = font.family();
|
|
||||||
reslistFontSize = font.pointSize();
|
|
||||||
reslistFontPB->setText(reslistFontFamily + "-" +
|
|
||||||
s.setNum(reslistFontSize));
|
|
||||||
} else {
|
|
||||||
reslistFontFamily = "";
|
|
||||||
reslistFontSize = 0;
|
|
||||||
reslistFontPB->setText(this->font().family() + "-" +
|
|
||||||
s.setNum(this->font().pointSize()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,8 +421,7 @@ void UIPrefsDialog::resetReslistFont()
|
|||||||
{
|
{
|
||||||
reslistFontFamily = "";
|
reslistFontFamily = "";
|
||||||
reslistFontSize = 0;
|
reslistFontSize = 0;
|
||||||
reslistFontPB->setText(this->font().family() + "-" +
|
setupReslistFontPB();
|
||||||
QString().setNum(this->font().pointSize()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIPrefsDialog::showViewAction()
|
void UIPrefsDialog::showViewAction()
|
||||||
|
|||||||
@ -72,6 +72,7 @@ protected slots:
|
|||||||
virtual void accept();
|
virtual void accept();
|
||||||
virtual void reject();
|
virtual void reject();
|
||||||
private:
|
private:
|
||||||
|
void setupReslistFontPB();
|
||||||
// Locally stored data (pending ok/cancel)
|
// Locally stored data (pending ok/cancel)
|
||||||
QString paraFormat;
|
QString paraFormat;
|
||||||
QString headerText;
|
QString headerText;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user