summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/contactlistview.cpp8
-rw-r--r--microkde/kdeui/klistview.cpp3
-rw-r--r--microkde/kglobalsettings.cpp9
-rw-r--r--microkde/kglobalsettings.h1
4 files changed, 15 insertions, 6 deletions
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp
index 09d9c03..9accf78 100644
--- a/kaddressbook/views/contactlistview.cpp
+++ b/kaddressbook/views/contactlistview.cpp
@@ -225,69 +225,69 @@ ContactListView *ContactListViewItem::parent()
225 225
226 226
227void ContactListViewItem::refresh() 227void ContactListViewItem::refresh()
228{ 228{
229 // Update our addressee, since it may have changed else were 229 // Update our addressee, since it may have changed else were
230 mAddressee = mDocument->findByUid(mAddressee.uid()); 230 mAddressee = mDocument->findByUid(mAddressee.uid());
231 if (mAddressee.isEmpty()) 231 if (mAddressee.isEmpty())
232 return; 232 return;
233 233
234 int i = 0; 234 int i = 0;
235 KABC::Field::List::ConstIterator it; 235 KABC::Field::List::ConstIterator it;
236 for( it = mFields.begin(); it != mFields.end(); ++it ) { 236 for( it = mFields.begin(); it != mFields.end(); ++it ) {
237 setText( i++, (*it)->value( mAddressee ) ); 237 setText( i++, (*it)->value( mAddressee ) );
238 } 238 }
239} 239}
240 240
241/////////////////////////////// 241///////////////////////////////
242// ContactListView 242// ContactListView
243 243
244ContactListView::ContactListView(KAddressBookTableView *view, 244ContactListView::ContactListView(KAddressBookTableView *view,
245 KABC::AddressBook* /* doc */, 245 KABC::AddressBook* /* doc */,
246 QWidget *parent, 246 QWidget *parent,
247 const char *name ) 247 const char *name )
248 : KListView( parent, name ), 248 : KListView( parent, name ),
249 pabWidget( view ), 249 pabWidget( view ),
250 oldColumn( 0 ) 250 oldColumn( 0 )
251{ 251{
252 mFlagBlockKeyPressed = false; 252 mFlagBlockKeyPressed = false;
253 mFlagKeyPressed = false; 253 mFlagKeyPressed = false;
254 mABackground = true; 254 mABackground = true;
255 mSingleLine = false; 255 mSingleLine = false;
256 mToolTips = true; 256 mToolTips = true;
257#ifndef KAB_EMBEDDED 257
258 mAlternateColor = KGlobalSettings::alternateBackgroundColor(); 258 mAlternateColor = KGlobalSettings::alternateBackgroundColor();
259#else //KAB_EMBEDDED 259
260 mAlternateColor = QColor(240, 240, 240); 260
261#endif //KAB_EMBEDDED 261
262 262
263 setAlternateBackgroundEnabled(mABackground); 263 setAlternateBackgroundEnabled(mABackground);
264 setAcceptDrops( true ); 264 setAcceptDrops( true );
265 viewport()->setAcceptDrops( true ); 265 viewport()->setAcceptDrops( true );
266 setAllColumnsShowFocus( true ); 266 setAllColumnsShowFocus( true );
267 setShowSortIndicator(true); 267 setShowSortIndicator(true);
268 268
269 setSelectionModeExt( KListView::Extended ); 269 setSelectionModeExt( KListView::Extended );
270 setDropVisualizer(false); 270 setDropVisualizer(false);
271 // setFrameStyle(QFrame::NoFrame); 271 // setFrameStyle(QFrame::NoFrame);
272 //setLineWidth ( 0 ); 272 //setLineWidth ( 0 );
273 //setMidLineWidth ( 0 ); 273 //setMidLineWidth ( 0 );
274 //setMargin ( 0 ); 274 //setMargin ( 0 );
275#ifndef KAB_EMBEDDED 275#ifndef KAB_EMBEDDED
276 connect(this, SIGNAL(dropped(QDropEvent*)), 276 connect(this, SIGNAL(dropped(QDropEvent*)),
277 this, SLOT(itemDropped(QDropEvent*))); 277 this, SLOT(itemDropped(QDropEvent*)));
278#endif //KAB_EMBEDDED 278#endif //KAB_EMBEDDED
279 279
280 280
281 new DynamicTip( this ); 281 new DynamicTip( this );
282} 282}
283void ContactListView::printMe() 283void ContactListView::printMe()
284{ 284{
285#ifdef DESKTOP_VERSION 285#ifdef DESKTOP_VERSION
286 QPrinter printer; 286 QPrinter printer;
287 if (!printer.setup() ) 287 if (!printer.setup() )
288 return; 288 return;
289 QPainter p; 289 QPainter p;
290 p.begin ( &printer ); 290 p.begin ( &printer );
291 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 291 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
292 float dx, dy; 292 float dx, dy;
293 int wid = (m.width() * 9)/10; 293 int wid = (m.width() * 9)/10;
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp
index 31e2053..25327aa 100644
--- a/microkde/kdeui/klistview.cpp
+++ b/microkde/kdeui/klistview.cpp
@@ -430,66 +430,65 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse
430 430
431 if (kapp) 431 if (kapp)
432 { 432 {
433 connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); 433 connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) );
434 kapp->addKipcEventMask( KIPC::SettingsChanged ); 434 kapp->addKipcEventMask( KIPC::SettingsChanged );
435 } 435 }
436*/ 436*/
437 slotSettingsChanged(1); //US do this to initialize the connections 437 slotSettingsChanged(1); //US do this to initialize the connections
438 438
439 439
440 connect(&d->autoSelect, SIGNAL( timeout() ), 440 connect(&d->autoSelect, SIGNAL( timeout() ),
441 this, SLOT( slotAutoSelect() ) ); 441 this, SLOT( slotAutoSelect() ) );
442 connect(&d->dragExpand, SIGNAL( timeout() ), 442 connect(&d->dragExpand, SIGNAL( timeout() ),
443 this, SLOT( slotDragExpand() ) ); 443 this, SLOT( slotDragExpand() ) );
444 444
445 // context menu handling 445 // context menu handling
446 if (d->showContextMenusOnPress) 446 if (d->showContextMenusOnPress)
447 { 447 {
448 connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), 448 connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)),
449 this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); 449 this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int)));
450 } 450 }
451 else 451 else
452 { 452 {
453 connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), 453 connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)),
454 this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); 454 this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int)));
455 } 455 }
456 456
457 connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)), 457 connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)),
458 this, SLOT (emitContextMenu (KListView*, QListViewItem*))); 458 this, SLOT (emitContextMenu (KListView*, QListViewItem*)));
459 459
460 460
461 //qDebug("KListView::KListView make alternate color configurable"); 461 //qDebug("KListView::KListView make alternate color configurable");
462//US d->alternateBackground = KGlobalSettings::alternateBackgroundColor(); 462 d->alternateBackground = KGlobalSettings::alternateBackgroundColor();
463 d->alternateBackground = QColor(240, 240, 240);
464} 463}
465 464
466 465
467 466
468KListView::~KListView() 467KListView::~KListView()
469{ 468{
470 delete d; 469 delete d;
471} 470}
472 471
473bool KListView::isExecuteArea( const QPoint& point ) 472bool KListView::isExecuteArea( const QPoint& point )
474{ 473{
475 if ( itemAt( point ) ) 474 if ( itemAt( point ) )
476 return isExecuteArea( point.x() ); 475 return isExecuteArea( point.x() );
477 476
478 return false; 477 return false;
479} 478}
480 479
481bool KListView::isExecuteArea( int x ) 480bool KListView::isExecuteArea( int x )
482{ 481{
483 if( allColumnsShowFocus() ) 482 if( allColumnsShowFocus() )
484 return true; 483 return true;
485 else { 484 else {
486 int offset = 0; 485 int offset = 0;
487 int width = columnWidth( 0 ); 486 int width = columnWidth( 0 );
488 int pos = header()->mapToIndex( 0 ); 487 int pos = header()->mapToIndex( 0 );
489 488
490 for ( int index = 0; index < pos; index++ ) 489 for ( int index = 0; index < pos; index++ )
491 offset += columnWidth( header()->mapToSection( index ) ); 490 offset += columnWidth( header()->mapToSection( index ) );
492 491
493 x += contentsX(); // in case of a horizontal scrollbar 492 x += contentsX(); // in case of a horizontal scrollbar
494 return ( x > offset && x < ( offset + width ) ); 493 return ( x > offset && x < ( offset + width ) );
495 } 494 }
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp
index b65ce66..92a2b48 100644
--- a/microkde/kglobalsettings.cpp
+++ b/microkde/kglobalsettings.cpp
@@ -29,49 +29,58 @@ QFont KGlobalSettings::generalMaxFont()
29 } 29 }
30#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
31 else 31 else
32 if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 32 if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
33 size = 18; 33 size = 18;
34#endif 34#endif
35 QFont f = QApplication::font(); 35 QFont f = QApplication::font();
36 if ( f.pointSize() > size ) 36 if ( f.pointSize() > size )
37 f.setPointSize( size ); 37 f.setPointSize( size );
38 return f; 38 return f;
39} 39}
40 40
41QString KGlobalSettings::timeTrackerDir() 41QString KGlobalSettings::timeTrackerDir()
42{ 42{
43 static QString dir; 43 static QString dir;
44 if ( dir.isEmpty() ) { 44 if ( dir.isEmpty() ) {
45 dir = locateLocal( "data", "timetrackerdir/d.ttl" ); 45 dir = locateLocal( "data", "timetrackerdir/d.ttl" );
46 dir = dir.left ( dir.length() - 5); 46 dir = dir.left ( dir.length() - 5);
47 } 47 }
48 return dir; 48 return dir;
49} 49}
50 50
51QFont KGlobalSettings::toolBarFont() 51QFont KGlobalSettings::toolBarFont()
52{ 52{
53 return QApplication::font(); 53 return QApplication::font();
54} 54}
55 55
56QColor KGlobalSettings::toolBarHighlightColor() 56QColor KGlobalSettings::toolBarHighlightColor()
57{ 57{
58 return QColor( "black" ); 58 return QColor( "black" );
59} 59}
60 60
61QColor KGlobalSettings::alternateBackgroundColor()
62{
63#ifdef DESKTOP_VERSION
64 return QColor( 235, 235, 235 );
65#else
66 return QColor( 220, 220, 220 );
67#endif
68}
69
61QRect KGlobalSettings::desktopGeometry( QWidget * ) 70QRect KGlobalSettings::desktopGeometry( QWidget * )
62{ 71{
63 return QApplication::desktop()->rect(); 72 return QApplication::desktop()->rect();
64} 73}
65 74
66 /** 75 /**
67 * Returns whether KDE runs in single (default) or double click 76 * Returns whether KDE runs in single (default) or double click
68 * mode. 77 * mode.
69 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html 78 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html
70 * @return true if single click mode, or false if double click mode. 79 * @return true if single click mode, or false if double click mode.
71 **/ 80 **/
72bool KGlobalSettings::singleClick() 81bool KGlobalSettings::singleClick()
73{ 82{
74 KConfig *c = KGlobal::config(); 83 KConfig *c = KGlobal::config();
75 KConfigGroupSaver cgs( c, "KDE" ); 84 KConfigGroupSaver cgs( c, "KDE" );
76 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); 85 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK);
77} 86}
diff --git a/microkde/kglobalsettings.h b/microkde/kglobalsettings.h
index 3eeda35..e2620b3 100644
--- a/microkde/kglobalsettings.h
+++ b/microkde/kglobalsettings.h
@@ -1,32 +1,33 @@
1#ifndef MICROKDE_KGLOBALSETTINGS_H 1#ifndef MICROKDE_KGLOBALSETTINGS_H
2#define MICROKDE_KGLOBALSETTINGS_H 2#define MICROKDE_KGLOBALSETTINGS_H
3 3
4#include <qfont.h> 4#include <qfont.h>
5#include <qrect.h> 5#include <qrect.h>
6 6
7 7
8#define KDE_DEFAULT_SINGLECLICK true 8#define KDE_DEFAULT_SINGLECLICK true
9 9
10 10
11class KGlobalSettings 11class KGlobalSettings
12{ 12{
13 public: 13 public:
14 static QFont generalFont(); 14 static QFont generalFont();
15 static QFont generalMaxFont(); 15 static QFont generalMaxFont();
16 static QFont toolBarFont(); 16 static QFont toolBarFont();
17 17
18 static QColor toolBarHighlightColor(); 18 static QColor toolBarHighlightColor();
19 static QColor alternateBackgroundColor();
19 static QRect desktopGeometry( QWidget * ); 20 static QRect desktopGeometry( QWidget * );
20 static QString timeTrackerDir(); 21 static QString timeTrackerDir();
21 22
22 /** 23 /**
23 * Returns whether KDE runs in single (default) or double click 24 * Returns whether KDE runs in single (default) or double click
24 * mode. 25 * mode.
25 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html 26 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html
26 * @return true if single click mode, or false if double click mode. 27 * @return true if single click mode, or false if double click mode.
27 **/ 28 **/
28 static bool singleClick(); 29 static bool singleClick();
29 30
30}; 31};
31 32
32#endif 33#endif