* clear the selection toggle when zooming in or out

* clear the selection toggle when using the scroll wheel (this is only a temporary workaround until Qt-issue #200665 has been fixed)

BUG: 159737

svn path=/trunk/KDE/kdebase/apps/; revision=797808
This commit is contained in:
Peter Penz 2008-04-16 21:08:09 +00:00
parent eb36093c2c
commit 3a27f30799
6 changed files with 44 additions and 10 deletions

View file

@ -53,6 +53,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
QListView(parent),
m_active(true),
m_view(columnView),
m_selectionManager(0),
m_url(url),
m_childUrl(),
m_font(),
@ -125,11 +126,11 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
const bool useSelManager = KGlobalSettings::singleClick() &&
DolphinSettings::instance().generalSettings()->showSelectionToggle();
if (useSelManager) {
SelectionManager* selManager = new SelectionManager(this);
connect(selManager, SIGNAL(selectionChanged()),
m_selectionManager = new SelectionManager(this);
connect(m_selectionManager, SIGNAL(selectionChanged()),
this, SLOT(requestActivation()));
connect(m_view->m_controller, SIGNAL(urlChanged(const KUrl&)),
selManager, SLOT(reset()));
m_selectionManager, SLOT(reset()));
}
new KMimeTypeResolver(this, m_dolphinModel);
@ -163,6 +164,9 @@ void DolphinColumnWidget::setDecorationSize(const QSize& size)
if (m_iconManager != 0) {
m_iconManager->updatePreviews();
}
if (m_selectionManager != 0) {
m_selectionManager->reset();
}
}
void DolphinColumnWidget::setActive(bool active)
@ -365,11 +369,16 @@ void DolphinColumnWidget::contextMenuEvent(QContextMenuEvent* event)
void DolphinColumnWidget::wheelEvent(QWheelEvent* event)
{
if (m_selectionManager != 0) {
m_selectionManager->reset();
}
// let Ctrl+wheel events propagate to the DolphinView for icon zooming
if (event->modifiers() & Qt::ControlModifier) {
event->ignore();
return;
}
QListView::wheelEvent(event);
}

View file

@ -37,6 +37,7 @@ class KDirLister;
class KJob;
class KFileItem;
class KFileItemList;
class SelectionManager;
class QPixmap;
/**
@ -133,6 +134,7 @@ private:
private:
bool m_active;
DolphinColumnView* m_view;
SelectionManager* m_selectionManager;
KUrl m_url; // URL of the directory that is shown
KUrl m_childUrl; // URL of the next column that is shown

View file

@ -47,6 +47,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
QTreeView(parent),
m_autoResize(true),
m_controller(controller),
m_selectionManager(0),
m_font(),
m_decorationSize(),
m_showElasticBand(false),
@ -98,12 +99,12 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
connect(this, SIGNAL(clicked(const QModelIndex&)),
controller, SLOT(triggerItem(const QModelIndex&)));
if (DolphinSettings::instance().generalSettings()->showSelectionToggle()) {
SelectionManager* selManager = new SelectionManager(this);
connect(selManager, SIGNAL(selectionChanged()),
m_selectionManager = new SelectionManager(this);
connect(m_selectionManager, SIGNAL(selectionChanged()),
this, SLOT(requestActivation()));
connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
selManager, SLOT(reset()));
}
m_selectionManager, SLOT(reset()));
}
} else {
connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
controller, SLOT(triggerItem(const QModelIndex&)));
@ -345,11 +346,16 @@ void DolphinDetailsView::resizeEvent(QResizeEvent* event)
void DolphinDetailsView::wheelEvent(QWheelEvent* event)
{
if (m_selectionManager != 0) {
m_selectionManager->reset();
}
// let Ctrl+wheel events propagate to the DolphinView for icon zooming
if (event->modifiers() & Qt::ControlModifier) {
event->ignore();
return;
}
QTreeView::wheelEvent(event);
}
@ -555,6 +561,10 @@ void DolphinDetailsView::updateDecorationSize()
m_controller->setZoomInPossible(isZoomInPossible());
m_controller->setZoomOutPossible(isZoomOutPossible());
if (m_selectionManager != 0) {
m_selectionManager->reset();
}
doItemsLayout();
}

View file

@ -26,6 +26,7 @@
#include <libdolphin_export.h>
class DolphinController;
class SelectionManager;
/**
* @brief Represents the details view which shows the name, size,
@ -158,6 +159,7 @@ private:
bool m_autoResize; // if true, the columns are resized automatically to the available width
DolphinController* m_controller;
SelectionManager* m_selectionManager;
QFont m_font;
QSize m_decorationSize;

View file

@ -41,6 +41,7 @@
DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controller) :
KCategorizedView(parent),
m_controller(controller),
m_selectionManager(0),
m_categoryDrawer(0),
m_font(),
m_decorationSize(),
@ -68,11 +69,11 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
connect(this, SIGNAL(clicked(const QModelIndex&)),
controller, SLOT(triggerItem(const QModelIndex&)));
if (DolphinSettings::instance().generalSettings()->showSelectionToggle()) {
SelectionManager* selManager = new SelectionManager(this);
connect(selManager, SIGNAL(selectionChanged()),
m_selectionManager = new SelectionManager(this);
connect(m_selectionManager, SIGNAL(selectionChanged()),
this, SLOT(requestActivation()));
connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
selManager, SLOT(reset()));
m_selectionManager, SLOT(reset()));
}
} else {
connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
@ -247,6 +248,10 @@ void DolphinIconsView::keyPressEvent(QKeyEvent* event)
void DolphinIconsView::wheelEvent(QWheelEvent* event)
{
if (m_selectionManager != 0) {
m_selectionManager->reset();
}
// let Ctrl+wheel events propagate to the DolphinView for icon zooming
if (event->modifiers() & Qt::ControlModifier) {
event->ignore();
@ -453,6 +458,10 @@ void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount)
if (delegate != 0) {
delegate->setMaximumSize(m_itemSize);
}
if (m_selectionManager != 0) {
m_selectionManager->reset();
}
}
int DolphinIconsView::additionalInfoCount() const

View file

@ -32,6 +32,7 @@
#include <libdolphin_export.h>
class DolphinController;
class SelectionManager;
class DolphinCategoryDrawer;
/**
@ -97,6 +98,7 @@ private:
private:
DolphinController* m_controller;
SelectionManager* m_selectionManager;
DolphinCategoryDrawer* m_categoryDrawer;
QFont m_font;