From kde-core-devel Tue Dec 28 11:19:27 2004 From: Martin Koller Date: Tue, 28 Dec 2004 11:19:27 +0000 To: kde-core-devel Subject: [patch] Re: Set shadowSortColumn false per default Message-Id: <200412281219.32019.m.koller () surfeu ! at> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=110423282531734 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart1357595.BX5t9Hyr1M" --nextPart1357595.BX5t9Hyr1M Content-Type: multipart/mixed; boundary="Boundary-01=_/EU0BOOyGkSiSNR" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_/EU0BOOyGkSiSNR Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Monday 27 December 2004 18:52, Ingo Kl=F6cker wrote: > Obviously, the real point of disagreement is not the default behavior > but the fact that it's not configurable. So, regardless of the default, > pretty please with sugar on top make it configurable (at least via > KConfEdit). OK, what about adding a checkbox in the colors KCM and storing it in=20 kdeglobals/General ? (So it's also a member of a color scheme) See attached patch. =2D-=20 Best regards/Sch=F6ne Gr=FC=DFe Martin () ascii ribbon campaign - against html mail=20 /\ - against microsoft attachments Some operating systems are called 'user friendly', Linux however is 'expert friendly'. --Boundary-01=_/EU0BOOyGkSiSNR Content-Type: text/x-diff; charset="iso-8859-1"; name="shadeconfig-base.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="shadeconfig-base.patch" Index: kcontrol/colors/colorscm.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdebase/kcontrol/colors/colorscm.cpp,v retrieving revision 1.95 diff -u -3 -p -r1.95 colorscm.cpp =2D-- kcontrol/colors/colorscm.cpp 22 Oct 2004 19:11:11 -0000 1.95 +++ kcontrol/colors/colorscm.cpp 28 Dec 2004 11:15:37 -0000 @@ -238,6 +238,13 @@ KColorScheme::KColorScheme(QWidget *pare " box where you can choose a color for the \"widget\" selected" " in the above list.") ); =20 + cbShadeList =3D new QCheckBox(i18n("Shade sorted column in lists"), th= is); + stackLayout->addWidget(cbShadeList); + connect(cbShadeList, SIGNAL(toggled(bool)), this, SLOT(changed())); + + QWhatsThis::add(cbShadeList, + i18n("Check this box to show the sorted column in a list with a sha= ded background")); + group =3D new QGroupBox( i18n("Con&trast"), this ); stackLayout->addWidget(group); =20 @@ -293,6 +300,8 @@ void KColorScheme::load() sList->setCurrentItem(findSchemeByName(sCurrentScheme)); readScheme(0); =20 + cbShadeList->setChecked(cs->shadeSortColumn); + cs->drawSampleWidgets(); slotWidgetColor(wcCombo->currentItem()); sb->blockSignals(true); @@ -324,6 +333,8 @@ void KColorScheme::save() cfg->writeEntry("visitedLinkColor", cs->visitedLink, true, true); cfg->writeEntry("alternateBackground", cs->alternateBackground, true, = true); =20 + cfg->writeEntry("shadeSortColumn", cbShadeList->isChecked()); + cfg->setGroup( "WM" ); cfg->writeEntry("activeForeground", cs->aTxt, true, true); cfg->writeEntry("inactiveBackground", cs->iaTitle, true, true); @@ -400,6 +411,8 @@ void KColorScheme::defaults() readScheme(1); sList->setCurrentItem(1); =20 + cbShadeList->setChecked(cs->shadeSortColumn); + cs->drawSampleWidgets(); slotWidgetColor(wcCombo->currentItem()); sb->blockSignals(true); @@ -754,6 +767,7 @@ void KColorScheme::readScheme( int index cs->alternateBackground =3D KGlobalSettings::calculateAlternateBackg= roundColor(cs->window); =20 cs->contrast =3D 7; + cs->shadeSortColumn =3D KDE_DEFAULT_SHADE_SORT_COLUMN; =20 return; } @@ -774,6 +788,8 @@ void KColorScheme::readScheme( int index sCurrentScheme =3D sCurrentScheme.mid(i+1); } =20 + cs->shadeSortColumn =3D config->readBoolEntry( "shadeSortColumn", KDE_= DEFAULT_SHADE_SORT_COLUMN ); + // note: defaults should be the same as the KDE default cs->txt =3D config->readColorEntry( "foreground", &black ); cs->back =3D config->readColorEntry( "background", &widget ); @@ -897,6 +913,8 @@ void KColorScheme::slotPreviewScheme(int =20 // Set various appropriate for the scheme =20 + cbShadeList->setChecked(cs->shadeSortColumn); + cs->drawSampleWidgets(); sb->blockSignals(true); sb->setValue(cs->contrast); Index: kcontrol/colors/colorscm.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdebase/kcontrol/colors/colorscm.h,v retrieving revision 1.15 diff -u -3 -p -r1.15 colorscm.h =2D-- kcontrol/colors/colorscm.h 22 Oct 2004 19:11:11 -0000 1.15 +++ kcontrol/colors/colorscm.h 28 Dec 2004 11:15:37 -0000 @@ -82,6 +82,7 @@ private: WidgetCanvas *cs; =20 QCheckBox *cbExportColors; + QCheckBox *cbShadeList; }; =20 #endif Index: kcontrol/colors/widgetcanvas.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdebase/kcontrol/colors/widgetcanvas.cpp,v retrieving revision 1.13 diff -u -3 -p -r1.13 widgetcanvas.cpp =2D-- kcontrol/colors/widgetcanvas.cpp 23 Dec 2003 17:29:41 -0000 1.13 +++ kcontrol/colors/widgetcanvas.cpp 28 Dec 2004 11:15:37 -0000 @@ -42,7 +42,7 @@ static QPixmap* dis_menu_pix =3D 0; =20 =20 WidgetCanvas::WidgetCanvas( QWidget *parent, const char *name ) =2D : QWidget( parent, name ) + : QWidget( parent, name ), shadeSortColumn( true ) { setMouseTracking( true ); setBackgroundMode( NoBackground ); Index: kcontrol/colors/widgetcanvas.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdebase/kcontrol/colors/widgetcanvas.h,v retrieving revision 1.5 diff -u -3 -p -r1.5 widgetcanvas.h =2D-- kcontrol/colors/widgetcanvas.h 23 Oct 2003 05:19:48 -0000 1.5 +++ kcontrol/colors/widgetcanvas.h 28 Dec 2004 11:15:37 -0000 @@ -95,6 +95,7 @@ public: QColor alternateBackground; =20 int contrast; + bool shadeSortColumn; =20 signals: void widgetSelected( int ); Index: konqueror/listview/konq_listviewwidget.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdebase/konqueror/listview/konq_listviewwidget.cc,v retrieving revision 1.260 diff -u -3 -p -r1.260 konq_listviewwidget.cc =2D-- konqueror/listview/konq_listviewwidget.cc 24 Dec 2004 11:56:39 -0000 = 1.260 +++ konqueror/listview/konq_listviewwidget.cc 28 Dec 2004 11:15:42 -0000 @@ -115,7 +115,6 @@ KonqBaseListViewWidget::KonqBaseListView setSelectionModeExt( FileManager ); setDragEnabled(true); setItemsMovable(false); =2D setShadeSortColumn(true); =20 initConfig(); #if 0 --Boundary-01=_/EU0BOOyGkSiSNR Content-Type: text/x-diff; charset="iso-8859-1"; name="shadeconfig-libs.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="shadeconfig-libs.patch" Index: kdecore/kglobalsettings.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdelibs/kdecore/kglobalsettings.cpp,v retrieving revision 1.84 diff -u -3 -p -r1.84 kglobalsettings.cpp =2D-- kdecore/kglobalsettings.cpp 26 Oct 2004 17:30:49 -0000 1.84 +++ kdecore/kglobalsettings.cpp 28 Dec 2004 11:13:29 -0000 @@ -271,6 +271,12 @@ QColor KGlobalSettings::calculateAlterna } } =20 +bool KGlobalSettings::shadeSortColumn() +{ + KConfigGroup g( KGlobal::config(), "General" ); + return g.readBoolEntry( "shadeSortColumn", KDE_DEFAULT_SHADE_SORT_COLU= MN ); +} + QColor KGlobalSettings::linkColor() { initColors(); Index: kdecore/kglobalsettings.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdelibs/kdecore/kglobalsettings.h,v retrieving revision 1.56 diff -u -3 -p -r1.56 kglobalsettings.h =2D-- kdecore/kglobalsettings.h 24 Sep 2004 12:15:09 -0000 1.56 +++ kdecore/kglobalsettings.h 28 Dec 2004 11:13:30 -0000 @@ -34,6 +34,7 @@ #define KDE_DEFAULT_ICON_ON_PUSHBUTTON false #define KDE_DEFAULT_OPAQUE_RESIZE true #define KDE_DEFAULT_BUTTON_LAYOUT 0 +#define KDE_DEFAULT_SHADE_SORT_COLUMN true =20 class KURL; =20 @@ -342,6 +343,13 @@ class KDECORE_EXPORT KGlobalSettings */ static QColor calculateAlternateBackgroundColor(const QColor& base); =20 + /** + * Returns if the sorted column in a KListView shall be drawn with a + * shaded background color. + * @return true if the sorted column shall be shaded + * @since 3.4 + */ + static bool shadeSortColumn(); =20 /** * Returns the default general font. Index: kdeui/klistview.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdelibs/kdeui/klistview.cpp,v retrieving revision 1.249 diff -u -3 -p -r1.249 klistview.cpp =2D-- kdeui/klistview.cpp 20 Dec 2004 21:45:55 -0000 1.249 +++ kdeui/klistview.cpp 28 Dec 2004 11:13:32 -0000 @@ -101,7 +101,7 @@ public: paintCurrent (0), paintBelow (0), painting (false), =2D shadeSortColumn (false) + shadeSortColumn(KGlobalSettings::shadeSortColumn()) { renameable.append(0); connect(editor, SIGNAL(done(QListViewItem*,int)), listview, SLOT(don= eEditing(QListViewItem*,int))); --Boundary-01=_/EU0BOOyGkSiSNR-- --nextPart1357595.BX5t9Hyr1M Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB0UFDUeHBRvgua64RApSAAJ989bzCmqKxBnr/TqRbKx7J87PshgCeOS7w ZvsZu/3VLe+eHZnxIuYctyQ= =IJEt -----END PGP SIGNATURE----- --nextPart1357595.BX5t9Hyr1M--