author | harlekin <harlekin> | 2003-03-30 22:44:10 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-03-30 22:44:10 (UTC) |
commit | a014a9f0d0fe82dc5daf2b37ad4458cc5722db0d (patch) (unidiff) | |
tree | b3826416037c7650c3cc0fd9f0038ed705f3cc1c | |
parent | 0b6d158a2a2b52d83ad4b1046ce9dbffff2190e6 (diff) | |
download | opie-a014a9f0d0fe82dc5daf2b37ad4458cc5722db0d.zip opie-a014a9f0d0fe82dc5daf2b37ad4458cc5722db0d.tar.gz opie-a014a9f0d0fe82dc5daf2b37ad4458cc5722db0d.tar.bz2 |
layout fix, closes bug #761
-rw-r--r-- | core/pim/today/today.cpp | 10 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 4ec690c..83d8601 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -325,70 +325,72 @@ void Today::startConfig() { | |||
325 | m_refreshTimer->stop( ); | 325 | m_refreshTimer->stop( ); |
326 | 326 | ||
327 | TodayConfig conf( this, "dialog", true ); | 327 | TodayConfig conf( this, "dialog", true ); |
328 | 328 | ||
329 | TodayPlugin plugin; | 329 | TodayPlugin plugin; |
330 | QList<TodayConfigWidget> configWidgetList; | 330 | QList<TodayConfigWidget> configWidgetList; |
331 | 331 | ||
332 | for ( int i = pluginList.count() - 1; i >= 0; i-- ) { | 332 | for ( int i = pluginList.count() - 1; i >= 0; i-- ) { |
333 | plugin = pluginList[i]; | 333 | plugin = pluginList[i]; |
334 | 334 | ||
335 | // load the config widgets in the tabs | 335 | // load the config widgets in the tabs |
336 | if ( plugin.guiPart->configWidget( this ) != 0l ) { | 336 | if ( plugin.guiPart->configWidget( this ) != 0l ) { |
337 | TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); | 337 | TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); |
338 | configWidgetList.append( widget ); | 338 | configWidgetList.append( widget ); |
339 | conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() | 339 | conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() |
340 | , plugin.guiPart->appName() ); | 340 | , plugin.guiPart->appName() ); |
341 | } | 341 | } |
342 | // set the order/activate tab | 342 | // set the order/activate tab |
343 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), | 343 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), |
344 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); | 344 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); |
345 | } | 345 | } |
346 | 346 | ||
347 | if ( conf.exec() == QDialog::Accepted ) { | 347 | if ( conf.exec() == QDialog::Accepted ) { |
348 | conf.writeConfig(); | 348 | conf.writeConfig(); |
349 | TodayConfigWidget *confWidget; | 349 | TodayConfigWidget *confWidget; |
350 | for ( confWidget = configWidgetList.first(); confWidget != 0; | 350 | for ( confWidget = configWidgetList.first(); confWidget != 0; |
351 | confWidget = configWidgetList.next() ) { | 351 | confWidget = configWidgetList.next() ) { |
352 | confWidget->writeConfig(); | 352 | confWidget->writeConfig(); |
353 | } | 353 | } |
354 | loadPlugins(); | 354 | loadPlugins(); |
355 | } else { | 355 | } else { |
356 | // since refresh is not called in that case , reconnect the signal | 356 | // since refresh is not called in that case , reconnect the signal |
357 | m_refreshTimer->start( 15000 ); // get the config value in here later | 357 | m_refreshTimer->start( 15000 ); // get the config value in here later |
358 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 358 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
359 | } | 359 | } |
360 | } | 360 | } |
361 | 361 | ||
362 | 362 | ||
363 | /** | 363 | /** |
364 | * Refresh for the view. Reload all applets | 364 | * Refresh for the view. Reload all applets |
365 | * | 365 | * |
366 | */ | 366 | */ |
367 | void Today::refresh() { | 367 | void Today::refresh() { |
368 | 368 | ||
369 | init(); | 369 | init(); |
370 | 370 | ||
371 | QValueList<TodayPlugin>::Iterator it; | 371 | QValueList<TodayPlugin>::Iterator it; |
372 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { | 372 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { |
373 | if ( !(*it).excludeRefresh ) { | 373 | if ( !(*it).excludeRefresh ) { |
374 | (*it).guiPart->refresh(); | 374 | (*it).guiPart->refresh(); |
375 | qDebug( "refresh" ); | 375 | layout->addWidget( (*it).guiBox ); |
376 | } | 376 | qDebug( "refresh" ); |
377 | } | ||
377 | } | 378 | } |
379 | layout->addStretch(0); | ||
378 | } | 380 | } |
379 | 381 | ||
380 | void Today::startApplication() { | 382 | void Today::startApplication() { |
381 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 383 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
382 | e << QString( sender()->name() ); | 384 | e << QString( sender()->name() ); |
383 | } | 385 | } |
384 | 386 | ||
385 | /** | 387 | /** |
386 | * launch addressbook (personal card) | 388 | * launch addressbook (personal card) |
387 | */ | 389 | */ |
388 | void Today::editCard() { | 390 | void Today::editCard() { |
389 | QCopEnvelope env( "QPE/Application/addressbook", "editPersonalAndClose()" ); | 391 | QCopEnvelope env( "QPE/Application/addressbook", "editPersonalAndClose()" ); |
390 | } | 392 | } |
391 | 393 | ||
392 | Today::~Today() { | 394 | Today::~Today() { |
393 | } | 395 | } |
394 | 396 | ||
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index 7beed34..41daa7d 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp | |||
@@ -8,97 +8,96 @@ | |||
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #include "todaybase.h" | 17 | #include "todaybase.h" |
18 | 18 | ||
19 | #include <qvbox.h> | 19 | #include <qvbox.h> |
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qwhatsthis.h> | 21 | #include <qwhatsthis.h> |
22 | 22 | ||
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | 24 | ||
25 | 25 | ||
26 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) | 26 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) |
27 | : QWidget( parent, name, WStyle_ContextHelp ) { | 27 | : QWidget( parent, name, WStyle_ContextHelp ) { |
28 | 28 | ||
29 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo | 29 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo |
30 | QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla | 30 | QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla |
31 | QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon | 31 | QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon |
32 | 32 | ||
33 | layout = 0L; | 33 | layout = 0L; |
34 | 34 | ||
35 | QPalette pal = this->palette(); | 35 | QPalette pal = this->palette(); |
36 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); | 36 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); |
37 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); | 37 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); |
38 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); | 38 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); |
39 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); | 39 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); |
40 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); | 40 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); |
41 | this->setPalette( pal ); | 41 | this->setPalette( pal ); |
42 | 42 | ||
43 | // --- logo Section --- | 43 | // --- logo Section --- |
44 | QPalette pal2; | 44 | QPalette pal2; |
45 | QColorGroup cg; | 45 | QColorGroup cg; |
46 | cg.setColor( QColorGroup::Text, white ); | 46 | cg.setColor( QColorGroup::Text, white ); |
47 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); | 47 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); |
48 | pal2.setActive( cg ); | 48 | pal2.setActive( cg ); |
49 | 49 | ||
50 | // today logo | 50 | // today logo |
51 | Frame = new QLabel( this, "Frame" ); | 51 | Frame = new QLabel( this, "Frame" ); |
52 | Frame->setPalette( pal2 ); | 52 | Frame->setPalette( pal2 ); |
53 | Frame->setFrameShape( QFrame::StyledPanel ); | 53 | Frame->setFrameShape( QFrame::StyledPanel ); |
54 | Frame->setFrameShadow( QFrame::Raised ); | 54 | Frame->setFrameShadow( QFrame::Raised ); |
55 | Frame->setLineWidth( 0 ); | 55 | Frame->setLineWidth( 0 ); |
56 | Frame->setMaximumHeight( 50 ); | ||
57 | 56 | ||
58 | QHBoxLayout *frameLayout = new QHBoxLayout( Frame ); | 57 | QHBoxLayout *frameLayout = new QHBoxLayout( Frame ); |
59 | QVBox *box1 = new QVBox( Frame ); | 58 | QVBox *box1 = new QVBox( Frame ); |
60 | box1->setMinimumWidth( 100 ); | 59 | box1->setMinimumWidth( 100 ); |
61 | // Today text | 60 | // Today text |
62 | TodayLabel = new QLabel( box1, "TodayText" ); | 61 | TodayLabel = new QLabel( box1, "TodayText" ); |
63 | QFont TodayLabel_font( TodayLabel->font() ); | 62 | QFont TodayLabel_font( TodayLabel->font() ); |
64 | TodayLabel_font.setBold( TRUE ); | 63 | TodayLabel_font.setBold( TRUE ); |
65 | TodayLabel_font.setPointSize( 40 ); | 64 | TodayLabel_font.setPointSize( 40 ); |
66 | TodayLabel->setFont( TodayLabel_font ); | 65 | TodayLabel->setFont( TodayLabel_font ); |
67 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | 66 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); |
68 | TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); | 67 | TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); |
69 | 68 | ||
70 | // date | 69 | // date |
71 | DateLabel = new QLabel( box1, "TextLabel1" ); | 70 | DateLabel = new QLabel( box1, "TextLabel1" ); |
72 | QFont DateLabel_font( DateLabel->font() ); | 71 | QFont DateLabel_font( DateLabel->font() ); |
73 | DateLabel_font.setBold( TRUE ); | 72 | DateLabel_font.setBold( TRUE ); |
74 | DateLabel->setFont( DateLabel_font ); | 73 | DateLabel->setFont( DateLabel_font ); |
75 | DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | 74 | DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); |
76 | DateLabel->setTextFormat( RichText ); | 75 | DateLabel->setTextFormat( RichText ); |
77 | 76 | ||
78 | // Opiezilla | 77 | // Opiezilla |
79 | Opiezilla = new QLabel( Frame, "OpieZilla" ); | 78 | Opiezilla = new QLabel( Frame, "OpieZilla" ); |
80 | Opiezilla->setPixmap( opiezilla ); | 79 | Opiezilla->setPixmap( opiezilla ); |
81 | QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); | 80 | QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); |
82 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); | 81 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); |
83 | 82 | ||
84 | 83 | ||
85 | // Ownerfield | 84 | // Ownerfield |
86 | OwnerField = new OClickableLabel( this , "Owner" ); | 85 | OwnerField = new OClickableLabel( this , "Owner" ); |
87 | OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) ); | 86 | OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) ); |
88 | OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); | 87 | OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); |
89 | OwnerField->setMaximumHeight(12); | 88 | OwnerField->setMaximumHeight(12); |
90 | 89 | ||
91 | // config | 90 | // config |
92 | ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); | 91 | ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); |
93 | ConfigButton->setPixmap( config ); | 92 | ConfigButton->setPixmap( config ); |
94 | QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); | 93 | QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); |
95 | ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); | 94 | ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); |
96 | 95 | ||
97 | frameLayout->addWidget( box1 ); | 96 | frameLayout->addWidget( box1 ); |
98 | frameLayout->addStretch( 2 ); | 97 | frameLayout->addStretch( 2 ); |
99 | frameLayout->addWidget( ConfigButton, 0, AlignBottom ); | 98 | frameLayout->addWidget( ConfigButton, 0, AlignBottom ); |
100 | frameLayout->addWidget( Opiezilla ); | 99 | frameLayout->addWidget( Opiezilla ); |
101 | } | 100 | } |
102 | 101 | ||
103 | 102 | ||
104 | /** | 103 | /** |