diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-04-16 11:25:42 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-04-16 11:25:42 (GMT) |
commit | 1e42aa0003876f5416f723d535ca27e7b2f6dc68 (patch) | |
tree | e4cdc3a0c7610f9661f208ddb24086d8090b4303 /Swift/QtUI/Roster/DelegateCommons.h | |
parent | 76e1ad3b1290562ad0ebb4ed430eb1f2566645f0 (diff) | |
download | swift-contrib-1e42aa0003876f5416f723d535ca27e7b2f6dc68.zip swift-contrib-1e42aa0003876f5416f723d535ca27e7b2f6dc68.tar.bz2 |
Prettify the ChatList a bit.
Resolves: #322
Diffstat (limited to 'Swift/QtUI/Roster/DelegateCommons.h')
-rw-r--r-- | Swift/QtUI/Roster/DelegateCommons.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Swift/QtUI/Roster/DelegateCommons.h b/Swift/QtUI/Roster/DelegateCommons.h new file mode 100644 index 0000000..ac5efc4 --- /dev/null +++ b/Swift/QtUI/Roster/DelegateCommons.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010 Kevin Smith + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include <QApplication> +#include <QFont> + +namespace Swift { + class DelegateCommons { + public: + DelegateCommons() : nameFont(QApplication::font()), detailFont(QApplication::font()) { + detailFontSizeDrop = nameFont.pointSize() >= 10 ? 2 : 0; + detailFont.setStyle(QFont::StyleItalic); + detailFont.setPointSize(nameFont.pointSize() - detailFontSizeDrop); + } + + int detailFontSizeDrop; + QFont nameFont; + QFont detailFont; + static const int horizontalMargin; + static const int verticalMargin; + static const int farLeftMargin; + }; +} |