summaryrefslogtreecommitdiff
path: root/noncore/settings/appearance2/sample.cpp
Unidiff
Diffstat (limited to 'noncore/settings/appearance2/sample.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/sample.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/appearance2/sample.cpp b/noncore/settings/appearance2/sample.cpp
index b3a9d48..f6c4dca 100644
--- a/noncore/settings/appearance2/sample.cpp
+++ b/noncore/settings/appearance2/sample.cpp
@@ -70,79 +70,79 @@ public:
70 p.setPen( colorGroup().text() ); 70 p.setPen( colorGroup().text() );
71 p.drawText( rect(), AlignCenter, text ); 71 p.drawText( rect(), AlignCenter, text );
72 } 72 }
73 73
74private: 74private:
75 bool hl; 75 bool hl;
76 QString text; 76 QString text;
77}; 77};
78 78
79 79
80SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0) 80SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0)
81{ 81{
82 init(); 82 init();
83} 83}
84 84
85QSize SampleWindow::sizeHint() const 85QSize SampleWindow::sizeHint() const
86{ 86{
87 return container->sizeHint() + QSize( 10, 35 ); 87 return container->sizeHint() + QSize( 10, 35 );
88} 88}
89 89
90void SampleWindow::setFont( const QFont &f ) 90void SampleWindow::setFont( const QFont &f )
91{ 91{
92 QWidget::setFont( f ); 92 QWidget::setFont( f );
93 popup->setFont( f ); 93 popup->setFont( f );
94 QTimer::singleShot ( 0, this, SLOT( fixGeometry ( ))); 94 QTimer::singleShot ( 0, this, SLOT( fixGeometry()));
95} 95}
96 96
97static void setStyleRecursive ( QWidget *w, QStyle *s ) 97static void setStyleRecursive ( QWidget *w, QStyle *s )
98{ 98{
99 w->setStyle( s ); 99 w->setStyle( s );
100 QObjectList *childObjects=(QObjectList*)w->children(); 100 QObjectList *childObjects=(QObjectList*)w->children();
101 if ( childObjects ) { 101 if ( childObjects ) {
102 QObject * o; 102 QObject * o;
103 for(o=childObjects->first();o!=0;o=childObjects->next()) { 103 for(o=childObjects->first();o!=0;o=childObjects->next()) {
104 if( o->isWidgetType() ) { 104 if( o->isWidgetType() ) {
105 setStyleRecursive((QWidget *)o,s); 105 setStyleRecursive((QWidget *)o,s);
106 } 106 }
107 } 107 }
108 } 108 }
109} 109}
110 110
111 111
112void SampleWindow::setStyle2 ( QStyle *sty, const QPalette &pal ) 112void SampleWindow::setStyle2 ( QStyle *sty, const QPalette &pal )
113{ 113{
114 typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, QColorGroup &, bool, bool); 114 typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, QColorGroup &, bool, bool);
115 115
116 extern QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl); 116 extern QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl);
117 117
118 QPixmapCache::clear ( ); 118 QPixmapCache::clear ( );
119 QPalette p = pal; // ette ( ); 119 QPalette p = pal; // ette ( );
120 sty-> polish ( p ); 120 sty-> polish ( p );
121 qt_set_draw_menu_bar_impl ( 0 ); 121 qt_set_draw_menu_bar_impl ( 0 );
122 setStyleRecursive ( this, sty ); 122 setStyleRecursive ( this, sty );
123 setPalette ( p ); 123 setPalette ( p );
124 QTimer::singleShot ( 0, this, SLOT( fixGeometry ( ))); 124 QTimer::singleShot ( 0, this, SLOT( fixGeometry()));
125} 125}
126 126
127 127
128void SampleWindow::setDecoration( WindowDecorationInterface *i ) 128void SampleWindow::setDecoration( WindowDecorationInterface *i )
129{ 129{
130 iface = i; 130 iface = i;
131 wd.rect = QRect( 0, 0, 150, 75 ); 131 wd.rect = QRect( 0, 0, 150, 75 );
132 wd.caption = tr("Sample"); 132 wd.caption = tr("Sample");
133 wd.palette = palette(); 133 wd.palette = palette();
134 wd.flags = WindowDecorationInterface::WindowData::Dialog | 134 wd.flags = WindowDecorationInterface::WindowData::Dialog |
135 WindowDecorationInterface::WindowData::Active; 135 WindowDecorationInterface::WindowData::Active;
136 wd.reserved = 1; 136 wd.reserved = 1;
137 137
138 th = iface->metric(WindowDecorationInterface::TitleHeight, &wd); 138 th = iface->metric(WindowDecorationInterface::TitleHeight, &wd);
139 tb = iface->metric(WindowDecorationInterface::TopBorder, &wd); 139 tb = iface->metric(WindowDecorationInterface::TopBorder, &wd);
140 lb = iface->metric(WindowDecorationInterface::LeftBorder, &wd); 140 lb = iface->metric(WindowDecorationInterface::LeftBorder, &wd);
141 rb = iface->metric(WindowDecorationInterface::RightBorder, &wd); 141 rb = iface->metric(WindowDecorationInterface::RightBorder, &wd);
142 bb = iface->metric(WindowDecorationInterface::BottomBorder, &wd); 142 bb = iface->metric(WindowDecorationInterface::BottomBorder, &wd);
143 143
144 int yoff = th + tb; 144 int yoff = th + tb;
145 int xoff = lb; 145 int xoff = lb;
146 146
147 wd.rect.setX( 0 ); 147 wd.rect.setX( 0 );
148 wd.rect.setWidth( width() - lb - rb ); 148 wd.rect.setWidth( width() - lb - rb );