-rw-r--r-- | microkde/kglobalsettings.cpp | 16 | ||||
-rw-r--r-- | microkde/kglobalsettings.h | 1 | ||||
-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index b6d2feb..b837b23 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp @@ -1,50 +1,66 @@ #include "kglobalsettings.h" #include "kconfig.h" #include "kglobal.h" #include "kconfigbase.h" #include <qapplication.h> QFont KGlobalSettings::generalFont() { int size = 12; if (QApplication::desktop()->width() < 480 ) { size = 10; } #ifndef DESKTOP_VERSION else if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) size = 18; #endif QFont f = QApplication::font(); //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); f.setPointSize( size ); return f; } +QFont KGlobalSettings::generalMaxFont() +{ + int size = 12; + if (QApplication::desktop()->width() < 480 ) { + size = 10; + } +#ifndef DESKTOP_VERSION + else + if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) + size = 18; +#endif + QFont f = QApplication::font(); + if ( f.pointSize() > size ) + f.setPointSize( size ); + return f; +} QFont KGlobalSettings::toolBarFont() { return QApplication::font(); } QColor KGlobalSettings::toolBarHighlightColor() { return QColor( "black" ); } QRect KGlobalSettings::desktopGeometry( QWidget * ) { return QApplication::desktop()->rect(); } /** * Returns whether KDE runs in single (default) or double click * mode. * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html * @return true if single click mode, or false if double click mode. **/ bool KGlobalSettings::singleClick() { KConfig *c = KGlobal::config(); KConfigGroupSaver cgs( c, "KDE" ); return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); } diff --git a/microkde/kglobalsettings.h b/microkde/kglobalsettings.h index 7df8012..075bb1c 100644 --- a/microkde/kglobalsettings.h +++ b/microkde/kglobalsettings.h @@ -1,30 +1,31 @@ #ifndef MICROKDE_KGLOBALSETTINGS_H #define MICROKDE_KGLOBALSETTINGS_H #include <qfont.h> #include <qrect.h> #define KDE_DEFAULT_SINGLECLICK true class KGlobalSettings { public: static QFont generalFont(); + static QFont generalMaxFont(); static QFont toolBarFont(); static QColor toolBarHighlightColor(); static QRect desktopGeometry( QWidget * ); /** * Returns whether KDE runs in single (default) or double click * mode. * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html * @return true if single click mode, or false if double click mode. **/ static bool singleClick(); }; #endif diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index bb41b18..9c87682 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp @@ -1,141 +1,141 @@ /* Copyright (c) 2000 Matthias Elter <elter@kde.org> Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qhbox.h> #include <qvbox.h> #include <qcursor.h> #include <qlayout.h> #include <klocale.h> #include <kglobal.h> #include <kdebug.h> #include <kiconloader.h> #include <kmessagebox.h> //US #include <klibloader.h> #include <krun.h> #include <kprocess.h> #include <kglobalsettings.h> #include "kcmultidialog.h" //US #include "kcmultidialog.moc" //US #include "kcmoduleloader.h" KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal) : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, parent, name, modal, true), d(0L) { - setFont( KGlobalSettings::generalFont() ); + setFont( KGlobalSettings::generalMaxFont() ); enableButton(Apply, false); //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) ); _baseGroup = baseGroup; mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); setMainWidget(mMainWidget ); #ifdef DESKTOP_VERSION resize(640,480); #else //resize(640,480); //setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480)); resize(800,800); setMaximumSize( 800, 800 ); //showMaximized(); #endif } KCMultiDialog::~KCMultiDialog() { //US moduleDict.setAutoDelete(true); } void KCMultiDialog::slotDefault() { int curPageIndex = activePageIndex(); QPtrListIterator<KCModule> it(modules); for (; it.current(); ++it) { if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) { (*it)->defaults(); clientChanged(true); return; } } } void KCMultiDialog::accept() { slotOk(); } void KCMultiDialog::slotApply() { QPtrListIterator<KCModule> it(modules); for (; it.current(); ++it) (*it)->save(); clientChanged(false); emit applyClicked(); } void KCMultiDialog::slotOk() { qDebug("KCMultiDialog::slotOk clicked"); QPtrListIterator<KCModule> it(modules); for (; it.current(); ++it) (*it)->save(); QDialog::accept(); emit okClicked(); } void KCMultiDialog::slotHelp() { /*US KURL url( KURL("help:/"), _docPath ); if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { KProcess process; process << "khelpcenter" << url.url(); process.start(KProcess::DontCare); process.detach(); } else { new KRun(url); } */ } void KCMultiDialog::clientChanged(bool state) { enableButton(Apply, state); } /*US void KCMultiDialog::addModule(const QString& path, bool withfallback) { kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; |