diff options
-rw-r--r-- | kcontrol/konqhtml/htmlopts.cpp | 47 | ||||
-rw-r--r-- | kcontrol/konqhtml/htmlopts.h | 2 | ||||
-rw-r--r-- | libkonq/konq_defaults.h | 1 |
3 files changed, 49 insertions, 1 deletions
diff --git a/kcontrol/konqhtml/htmlopts.cpp b/kcontrol/konqhtml/htmlopts.cpp index e6a6c59bb..88e9685bb 100644 --- a/kcontrol/konqhtml/htmlopts.cpp +++ b/kcontrol/konqhtml/htmlopts.cpp @@ -29,6 +29,7 @@ enum UnderlineLinkType { UnderlineAlways=0, UnderlineNever=1, UnderlineHover=2 }; enum AnimationsType { AnimationsAlways=0, AnimationsNever=1, AnimationsLoopOnce=2 }; +enum SmoothScrollingType { SmoothScrollingAlways=0, SmoothScrollingNever=1, SmoothScrollingWhenEfficient=2 }; //----------------------------------------------------------------------------- KMiscHTMLOptions::KMiscHTMLOptions(KConfig *config, TQString group, TQWidget *parent, const char *) @@ -187,11 +188,30 @@ KMiscHTMLOptions::KMiscHTMLOptions(KConfig *config, TQString group, TQWidget *pa whatsThis = i18n("Controls how Konqueror shows animated images:<br>" "<ul><li><b>Enabled</b>: Show all animations completely.</li>" "<li><b>Disabled</b>: Never show animations, show the start image only.</li>" - "<li><b>Show only once</b>: Show all animations completely but do not repeat them.</li>"); + "<li><b>Show only once</b>: Show all animations completely but do not repeat them.</li></ul>"); TQWhatsThis::add( label, whatsThis); TQWhatsThis::add( m_pAnimationsCombo, whatsThis); connect(m_pAnimationsCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + label = new TQLabel( i18n("Sm&ooth scrolling"), this); + m_pSmoothScrollingCombo = new TQComboBox( false, this ); + label->setBuddy(m_pSmoothScrollingCombo); + m_pSmoothScrollingCombo->insertItem(i18n("SmoothScrolling","Enabled"), SmoothScrollingAlways); + m_pSmoothScrollingCombo->insertItem(i18n("SmoothScrolling","Disabled"), SmoothScrollingNever); + // not implemented: m_pSmoothScrollingCombo->insertItem(i18n("SmoothScrolling","WhenEfficient"), SmoothScrollingWhenEfficient); + lay->addWidget(label, row, 0); + lay->addWidget(m_pSmoothScrollingCombo, row, 1); + row++; + whatsThis = i18n("Determines whether Konqueror should use smooth steps to scroll HTML pages, or whole steps:<br>" + "<ul><li><b>Always</b>: Always use smooth steps when scrolling.</li>" + "<li><b>Never</b>: Never use smooth scrolling, scroll with whole steps instead.</li>" + // not implemented: "<li><b>When Efficient</b>: Only use smooth scrolling on pages where it can be achieved with moderate usage of system resources.</li>" + "</ul>"); + TQWhatsThis::add( label, whatsThis); + TQWhatsThis::add( m_pSmoothScrollingCombo, whatsThis); + connect(m_pSmoothScrollingCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + + lay->setRowStretch(row, 1); load(); @@ -276,6 +296,15 @@ void KMiscHTMLOptions::load( bool useDefaults ) m_pAdvancedAddBookmarkCheckBox->setChecked( config.readBoolEntry("AdvancedAddBookmarkDialog", false) ); m_pOnlyMarkedBookmarksCheckBox->setChecked( config.readBoolEntry("FilteredToolbar", false) ); + KConfig kdeglobals("kdeglobals", true, false); + kdeglobals.setReadDefaults( useDefaults ); + kdeglobals.setGroup("KDE"); + bool smoothScrolling = kdeglobals.readBoolEntry("SmoothScroll", DEFAULT_SMOOTHSCROLL); + if (smoothScrolling) + m_pSmoothScrollingCombo->setCurrentItem( SmoothScrollingAlways ); + else + m_pSmoothScrollingCombo->setCurrentItem( SmoothScrollingNever ); + emit changed( useDefaults ); #undef READ_ENTRY @@ -340,6 +369,22 @@ void KMiscHTMLOptions::save() config.writeEntry("FilteredToolbar", m_pOnlyMarkedBookmarksCheckBox->isChecked()); config.sync(); + KConfig kdeglobals("kdeglobals", false, false); + kdeglobals.setGroup("KDE"); + switch(m_pSmoothScrollingCombo->currentItem()) + { + case SmoothScrollingAlways: + kdeglobals.writeEntry( "SmoothScroll", true ); + break; + case SmoothScrollingNever: + kdeglobals.writeEntry( "SmoothScroll", false ); + break; + // case SmoothScrollingWhenEfficient: + // kdeglobals.writeEntry( "SmoothScroll", somethingelse ); + // break; + } + kdeglobals.sync(); + TQByteArray data; if ( !kapp->dcopClient()->isAttached() ) kapp->dcopClient()->attach(); diff --git a/kcontrol/konqhtml/htmlopts.h b/kcontrol/konqhtml/htmlopts.h index 503eadfdd..42024f71b 100644 --- a/kcontrol/konqhtml/htmlopts.h +++ b/kcontrol/konqhtml/htmlopts.h @@ -20,6 +20,7 @@ // Change cursor over links // Underline links // AutoLoad Images +// Smooth Scrolling // ... there is room for others :)) @@ -51,6 +52,7 @@ private: TQComboBox* m_pUnderlineCombo; TQComboBox* m_pAnimationsCombo; + TQComboBox* m_pSmoothScrollingCombo; TQCheckBox* m_cbCursor; TQCheckBox* m_pAutoLoadImagesCheckBox; TQCheckBox* m_pUnfinishedImageFrameCheckBox; diff --git a/libkonq/konq_defaults.h b/libkonq/konq_defaults.h index fac4fdb3d..bff2fe8f1 100644 --- a/libkonq/konq_defaults.h +++ b/libkonq/konq_defaults.h @@ -24,6 +24,7 @@ // appearance tab #define DEFAULT_UNDERLINELINKS false +#define DEFAULT_SMOOTHSCROLL false #define DEFAULT_WORDWRAPTEXT true // kfm-like, sorry Reggie :-) #define DEFAULT_TEXTHEIGHT 2 #define DEFAULT_TEXTWIDTH 0 // 0 = automatic (font depending) |