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>
|
2008-07-02 Vadim Kurland <vadim@vk.crocodile.org>
|
||||||
|
|
||||||
* instDialog.cpp (instDialog::addToLog): fixes in built-in
|
* instDialog.cpp (instDialog::addToLog): fixes in built-in
|
||||||
|
|||||||
+19
-5
@@ -188,9 +188,21 @@ PrefsDialog::PrefsDialog(QWidget *parent) : QDialog(parent)
|
|||||||
rulesFont = st->getRulesFont();
|
rulesFont = st->getRulesFont();
|
||||||
treeFont = st->getTreeFont();
|
treeFont = st->getTreeFont();
|
||||||
uiFont = st->getUiFont();
|
uiFont = st->getUiFont();
|
||||||
|
|
||||||
|
m_dialog->rulesFontDescr->setText(getFontDescription(rulesFont));
|
||||||
|
m_dialog->treeFontDescr->setText(getFontDescription(treeFont));
|
||||||
|
|
||||||
m_dialog->chClipComment->setChecked(st->getClipComment() );
|
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,
|
void PrefsDialog::changeColor(QPushButton *btn,
|
||||||
FWBSettings::LabelColors colorCode)
|
FWBSettings::LabelColors colorCode)
|
||||||
{
|
{
|
||||||
@@ -256,20 +268,22 @@ void PrefsDialog::changeShowIcons()
|
|||||||
|
|
||||||
void PrefsDialog::changeRulesFont()
|
void PrefsDialog::changeRulesFont()
|
||||||
{
|
{
|
||||||
changeFont(&rulesFont);
|
changeFont(rulesFont);
|
||||||
|
m_dialog->rulesFontDescr->setText(getFontDescription(rulesFont));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrefsDialog::changeTreeFont()
|
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;
|
bool ok;
|
||||||
QFont f = QFontDialog::getFont(&ok, *font, this);
|
QFont f = QFontDialog::getFont(&ok, font, this);
|
||||||
if (ok)
|
if (ok)
|
||||||
*font = f;
|
font = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrefsDialog::findWDir()
|
void PrefsDialog::findWDir()
|
||||||
|
|||||||
@@ -56,11 +56,14 @@ class PrefsDialog : public QDialog
|
|||||||
QFont rulesFont;
|
QFont rulesFont;
|
||||||
QFont treeFont;
|
QFont treeFont;
|
||||||
QFont uiFont;
|
QFont uiFont;
|
||||||
void changeFont(QFont *font);
|
void changeFont(QFont &font);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PrefsDialog(QWidget *parent);
|
PrefsDialog(QWidget *parent);
|
||||||
~PrefsDialog();
|
~PrefsDialog();
|
||||||
|
|
||||||
|
QString getFontDescription(const QFont &font);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void accept();
|
virtual void accept();
|
||||||
virtual void findWDir();
|
virtual void findWDir();
|
||||||
|
|||||||
+50
-13
@@ -8,7 +8,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>555</width>
|
<width>639</width>
|
||||||
<height>396</height>
|
<height>396</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QTabWidget" name="tabWidget" >
|
<widget class="QTabWidget" name="tabWidget" >
|
||||||
<property name="currentIndex" >
|
<property name="currentIndex" >
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="Widget2" >
|
<widget class="QWidget" name="Widget2" >
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
@@ -934,6 +934,18 @@
|
|||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QPushButton" name="btRulesFont" >
|
<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" >
|
<property name="toolTip" >
|
||||||
<string>Choose font for rules sets</string>
|
<string>Choose font for rules sets</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -942,21 +954,33 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item rowspan="3" row="0" column="1" >
|
<item row="0" column="1" >
|
||||||
<spacer>
|
<widget class="QLabel" name="rulesFontDescr" >
|
||||||
<property name="orientation" >
|
<property name="sizePolicy" >
|
||||||
<enum>Qt::Horizontal</enum>
|
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="text" >
|
||||||
<size>
|
<string>rules font description</string>
|
||||||
<width>40</width>
|
|
||||||
<height>121</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0" >
|
||||||
<widget class="QPushButton" name="btTreeFont" >
|
<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" >
|
<property name="toolTip" >
|
||||||
<string>Choose font for tree</string>
|
<string>Choose font for tree</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -965,7 +989,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
|||||||
Reference in New Issue
Block a user