restore zooming functionality

svn path=/trunk/KDE/kdebase/apps/; revision=1016779
This commit is contained in:
Peter Penz 2009-08-28 21:12:46 +00:00
parent 41c14c5f8e
commit 656763c930
4 changed files with 24 additions and 19 deletions

View file

@ -33,6 +33,7 @@
#include "selectionmanager.h"
#include "tooltips/tooltipmanager.h"
#include "versioncontrolobserver.h"
#include "zoomlevelinfo.h"
#include <kcolorscheme.h>
#include <kdirlister.h>
@ -167,7 +168,11 @@ DolphinColumnView::DolphinColumnView(QWidget* parent,
new VersionControlObserver(this);*/
updateDecorationSize(m_container->m_controller->dolphinView()->showPreview());
DolphinController* controller = m_container->m_controller;
connect(controller, SIGNAL(zoomLevelChanged(int)),
this, SLOT(setZoomLevel(int)));
updateDecorationSize(dolphinView->showPreview());
}
DolphinColumnView::~DolphinColumnView()
@ -453,6 +458,22 @@ void DolphinColumnView::currentChanged(const QModelIndex& current, const QModelI
m_autoScroller->handleCurrentIndexChange(current, previous);
}
void DolphinColumnView::setZoomLevel(int level)
{
const int size = ZoomLevelInfo::iconSizeForZoomLevel(level);
ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
const bool showPreview = m_container->m_controller->dolphinView()->showPreview();
if (showPreview) {
settings->setPreviewSize(size);
} else {
settings->setIconSize(size);
}
updateDecorationSize(showPreview);
}
void DolphinColumnView::slotEntered(const QModelIndex& index)
{
m_container->m_controller->setItemView(this);

View file

@ -104,6 +104,8 @@ protected:
virtual void currentChanged(const QModelIndex& current, const QModelIndex& previous);
private slots:
void setZoomLevel(int level);
void slotEntered(const QModelIndex& index);
void requestActivation();
void updateFont();

View file

@ -23,7 +23,6 @@
#include "dolphincontroller.h"
#include "dolphinsortfilterproxymodel.h"
#include "settings/dolphinsettings.h"
#include "zoomlevelinfo.h"
#include "dolphin_columnmodesettings.h"
@ -53,8 +52,6 @@ DolphinColumnViewContainer::DolphinColumnViewContainer(QWidget* parent, DolphinC
connect(this, SIGNAL(viewportEntered()),
controller, SLOT(emitViewportEntered()));
connect(controller, SIGNAL(zoomLevelChanged(int)),
this, SLOT(setZoomLevel(int)));
connect(controller, SIGNAL(activationChanged(bool)),
this, SLOT(updateColumnsBackground(bool)));
@ -221,19 +218,6 @@ void DolphinColumnViewContainer::wheelEvent(QWheelEvent* event)
}
}
void DolphinColumnViewContainer::setZoomLevel(int level)
{
const int size = ZoomLevelInfo::iconSizeForZoomLevel(level);
ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
const bool showPreview = m_controller->dolphinView()->showPreview();
if (showPreview) {
settings->setPreviewSize(size);
} else {
settings->setIconSize(size);
}
}
void DolphinColumnViewContainer::moveContentHorizontally(int x)
{
m_contentX = isRightToLeft() ? +x : -x;

View file

@ -82,8 +82,6 @@ protected:
virtual void wheelEvent(QWheelEvent* event);
private slots:
void setZoomLevel(int level);
/**
* Moves the content of the columns view to represent
* the scrollbar position \a x.