mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
Assure that the grid size for Icons View, Details View and Previews View has some proper default values.
svn path=/trunk/playground/utils/dolphin/; revision=607518
This commit is contained in:
parent
0e3d1576d5
commit
f271d952ec
|
@ -1272,7 +1272,7 @@ void Dolphin::setupActions()
|
|||
KToggleAction* detailsView = new KToggleAction(i18n("Details"), actionCollection(), "details");
|
||||
detailsView->setShortcut(Qt::CTRL | Qt::Key_2);
|
||||
detailsView->setIcon(KIcon("view_text"));
|
||||
connect(detailsView, SIGNAL(triggered()), this, SLOT(setIconsView()));
|
||||
connect(detailsView, SIGNAL(triggered()), this, SLOT(setDetailsView()));
|
||||
|
||||
KToggleAction* previewsView = new KToggleAction(i18n("Previews"), actionCollection(), "previews");
|
||||
previewsView->setShortcut(Qt::CTRL | Qt::Key_3);
|
||||
|
|
|
@ -107,6 +107,7 @@ DolphinView::DolphinView(QWidget *parent,
|
|||
m_iconsView = new DolphinIconsView(this);
|
||||
connect(m_iconsView, SIGNAL(clicked(const QModelIndex&)),
|
||||
this, SLOT(triggerItem(const QModelIndex&)));
|
||||
applyModeToView();
|
||||
|
||||
KDirModel* model = new KDirModel();
|
||||
model->setDirLister(m_dirLister);
|
||||
|
@ -164,6 +165,7 @@ void DolphinView::setMode(Mode mode)
|
|||
ViewProperties props(m_urlNavigator->url());
|
||||
props.setViewMode(m_mode);
|
||||
|
||||
applyModeToView();
|
||||
startDirLister(m_urlNavigator->url());
|
||||
|
||||
emit signalModeChanged();
|
||||
|
@ -996,4 +998,25 @@ bool DolphinView::isFilterBarVisible()
|
|||
return m_filterBar->isVisible();
|
||||
}
|
||||
|
||||
void DolphinView::applyModeToView()
|
||||
{
|
||||
// TODO: the following code just tries to test some QListView capabilities
|
||||
switch (m_mode) {
|
||||
case IconsView:
|
||||
m_iconsView->setViewMode(QListView::IconMode);
|
||||
m_iconsView->setGridSize(QSize(128, 64));
|
||||
break;
|
||||
|
||||
case DetailsView:
|
||||
m_iconsView->setViewMode(QListView::ListMode);
|
||||
m_iconsView->setGridSize(QSize(256, 24));
|
||||
break;
|
||||
|
||||
case PreviewsView:
|
||||
m_iconsView->setViewMode(QListView::IconMode);
|
||||
m_iconsView->setGridSize(QSize(128, 128));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#include "dolphinview.moc"
|
||||
|
|
|
@ -434,6 +434,12 @@ private:
|
|||
*/
|
||||
QString renameIndexPresentation(int index, int itemCount) const;
|
||||
|
||||
/**
|
||||
* Applies the current view mode m_mode to the
|
||||
* view implementation.
|
||||
*/
|
||||
void applyModeToView();
|
||||
|
||||
bool m_refreshing;
|
||||
bool m_showProgress;
|
||||
Mode m_mode;
|
||||
|
|
Loading…
Reference in New Issue
Block a user