summaryrefslogtreecommitdiff
path: root/libopie/ofontmenu.cc
Unidiff
Diffstat (limited to 'libopie/ofontmenu.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofontmenu.cc46
1 files changed, 45 insertions, 1 deletions
diff --git a/libopie/ofontmenu.cc b/libopie/ofontmenu.cc
index 52ff3ee..d16c5e5 100644
--- a/libopie/ofontmenu.cc
+++ b/libopie/ofontmenu.cc
@@ -4,7 +4,13 @@
4#include "ofontmenu.h" 4#include "ofontmenu.h"
5 5
6 6
7 7/**
8 * Constructs the FontMenu.
9 *
10 * @param parent The parent widget
11 * @param name A name for this widget
12 * @param list The list of widgets to be controlled
13 */
8OFontMenu::OFontMenu(QWidget *parent, const char *name, const QList<QWidget> &list ) 14OFontMenu::OFontMenu(QWidget *parent, const char *name, const QList<QWidget> &list )
9 : QPopupMenu( parent, name ) 15 : QPopupMenu( parent, name )
10{ 16{
@@ -20,11 +26,24 @@ OFontMenu::OFontMenu(QWidget *parent, const char *name, const QList<QWidget> &li
20 setCheckable( true ); 26 setCheckable( true );
21 m_size=10; 27 m_size=10;
22} 28}
29
30/**
31 * This method saves the font size
32 * into a Config object
33 * OFontMenu will be used as group and size as key
34 * @param cfg The Config object to be used
35 */
23void OFontMenu::save(Config *cfg ) 36void OFontMenu::save(Config *cfg )
24{ 37{
25 cfg->setGroup("OFontMenu" ); 38 cfg->setGroup("OFontMenu" );
26 cfg->writeEntry("size", m_size ); 39 cfg->writeEntry("size", m_size );
27} 40}
41
42/**
43 * This method restores the font size from a Config object
44 * it'll apply the sizes to the widgets and will also set the
45 * menu appropriate
46 */
28void OFontMenu::restore(Config *cfg ) 47void OFontMenu::restore(Config *cfg )
29{ 48{
30 cfg->setGroup("OFontMeny" ); 49 cfg->setGroup("OFontMeny" );
@@ -47,22 +66,47 @@ void OFontMenu::restore(Config *cfg )
47 } 66 }
48 setFontSize( m_size ); 67 setFontSize( m_size );
49} 68}
69
70/**
71 * set the list of widgets
72 * @param list the widget list
73 */
50void OFontMenu::setWidgets(const QList<QWidget> &list ) 74void OFontMenu::setWidgets(const QList<QWidget> &list )
51{ 75{
52 m_list = list; 76 m_list = list;
53} 77}
78
79/**
80 * add a widget to the list
81 * @param wid The widget to be added
82 */
54void OFontMenu::addWidget( QWidget *wid ) 83void OFontMenu::addWidget( QWidget *wid )
55{ 84{
56 m_list.append(wid ); 85 m_list.append(wid );
57} 86}
87
88/**
89 * removes the widget from the list of controlled objects
90 * @param wid the to be removed widget
91 */
58void OFontMenu::removeWidget( QWidget *wid ) 92void OFontMenu::removeWidget( QWidget *wid )
59{ 93{
60 m_list.remove( wid ); 94 m_list.remove( wid );
61} 95}
96
97/**
98 * The list of controlled widgets
99 */
62const QList<QWidget> &OFontMenu::widgets()const 100const QList<QWidget> &OFontMenu::widgets()const
63{ 101{
64 return m_list; 102 return m_list;
65} 103}
104
105/**
106 * Forces a size on a widget
107 * @param wid The widget
108 * @param size The font size forced onto the widget
109 */
66void OFontMenu::forceSize(QWidget *wid, int size ) 110void OFontMenu::forceSize(QWidget *wid, int size )
67{ 111{
68 WidSize *widz = new WidSize; 112 WidSize *widz = new WidSize;