mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-11 15:41:41 +02:00
prefs dialog shows currently selected fonts
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2008-07-03 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* PrefsDialog.cpp (PrefsDialog::getFontDescription): Tab "Fonts"
|
||||
of the Preferences dialog shows currently selected fonts for both
|
||||
the tree and rules.
|
||||
|
||||
2008-07-02 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* instDialog.cpp (instDialog::addToLog): fixes in built-in
|
||||
|
||||
+19
-5
@@ -188,9 +188,21 @@ PrefsDialog::PrefsDialog(QWidget *parent) : QDialog(parent)
|
||||
rulesFont = st->getRulesFont();
|
||||
treeFont = st->getTreeFont();
|
||||
uiFont = st->getUiFont();
|
||||
|
||||
m_dialog->rulesFontDescr->setText(getFontDescription(rulesFont));
|
||||
m_dialog->treeFontDescr->setText(getFontDescription(treeFont));
|
||||
|
||||
m_dialog->chClipComment->setChecked(st->getClipComment() );
|
||||
}
|
||||
|
||||
QString PrefsDialog::getFontDescription(const QFont &font)
|
||||
{
|
||||
ostringstream str;
|
||||
str << font.family().toLatin1().constData()
|
||||
<< " " << font.pointSize();
|
||||
return QString(str.str().c_str());
|
||||
}
|
||||
|
||||
void PrefsDialog::changeColor(QPushButton *btn,
|
||||
FWBSettings::LabelColors colorCode)
|
||||
{
|
||||
@@ -256,20 +268,22 @@ void PrefsDialog::changeShowIcons()
|
||||
|
||||
void PrefsDialog::changeRulesFont()
|
||||
{
|
||||
changeFont(&rulesFont);
|
||||
changeFont(rulesFont);
|
||||
m_dialog->rulesFontDescr->setText(getFontDescription(rulesFont));
|
||||
}
|
||||
|
||||
void PrefsDialog::changeTreeFont()
|
||||
{
|
||||
changeFont(&treeFont);
|
||||
changeFont(treeFont);
|
||||
m_dialog->treeFontDescr->setText(getFontDescription(treeFont));
|
||||
}
|
||||
|
||||
void PrefsDialog::changeFont(QFont *font)
|
||||
void PrefsDialog::changeFont(QFont &font)
|
||||
{
|
||||
bool ok;
|
||||
QFont f = QFontDialog::getFont(&ok, *font, this);
|
||||
QFont f = QFontDialog::getFont(&ok, font, this);
|
||||
if (ok)
|
||||
*font = f;
|
||||
font = f;
|
||||
}
|
||||
|
||||
void PrefsDialog::findWDir()
|
||||
|
||||
@@ -56,11 +56,14 @@ class PrefsDialog : public QDialog
|
||||
QFont rulesFont;
|
||||
QFont treeFont;
|
||||
QFont uiFont;
|
||||
void changeFont(QFont *font);
|
||||
void changeFont(QFont &font);
|
||||
|
||||
public:
|
||||
PrefsDialog(QWidget *parent);
|
||||
~PrefsDialog();
|
||||
|
||||
QString getFontDescription(const QFont &font);
|
||||
|
||||
public slots:
|
||||
virtual void accept();
|
||||
virtual void findWDir();
|
||||
|
||||
+50
-13
@@ -8,7 +8,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>555</width>
|
||||
<width>639</width>
|
||||
<height>396</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -104,7 +104,7 @@
|
||||
<item row="0" column="0" >
|
||||
<widget class="QTabWidget" name="tabWidget" >
|
||||
<property name="currentIndex" >
|
||||
<number>0</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="Widget2" >
|
||||
<attribute name="title" >
|
||||
@@ -934,6 +934,18 @@
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QPushButton" name="btRulesFont" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Choose font for rules sets</string>
|
||||
</property>
|
||||
@@ -942,21 +954,33 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="3" row="0" column="1" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLabel" name="rulesFontDescr" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>121</height>
|
||||
</size>
|
||||
<property name="text" >
|
||||
<string>rules font description</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QPushButton" name="btTreeFont" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Choose font for tree</string>
|
||||
</property>
|
||||
@@ -965,7 +989,20 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<item row="1" column="1" >
|
||||
<widget class="QLabel" name="treeFontDescr" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>tree font description</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
||||
Reference in New Issue
Block a user